-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL][Matrix] Use KHR cooperative matrix instructions instead of Intel's #13817
[SYCL][Matrix] Use KHR cooperative matrix instructions instead of Intel's #13817
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit comment from me above. otherwise, LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add tests for this new functionality (i.e. for the case when __SPIRV_USE_COOPERATIVE_MATRIX is enabled)?
@againull It's possible and E2E test will be passing in pre-commit on GPU (as pre-commit right now is using the freshest GPU drivers as possible). But it will be failing in nightly as it uses older driver. Also such test won't be passing any time soon on CPU. For non E2E tests I'll be modifying check_device_code/matrix/matrix_load_store_as.cpp and some of matrix non-E2E tests once #13645 is merged. Please tell me which option is preferable to you. On my side I'll will be modifying some internal scripts that @YuriPlyakhin has anyway to ensure __SPIRV_USE_COOPERATIVE_MATRIX case is also being validated. |
The current script works only on PVC. |
Then in my opinion it will be perfect if we have these E2E tests. It is possible to add REQUIRE statement where you can indicate required minimum driver version and that tests require gpu. |
f9785d5
to
9b6779e
Compare
@againull apologies for a long delay. I've added the tests. I plan to enable all of the tests for cooperative matrices in the next PR, but first need to have some driver version containing the fix I'm committing right now there. |
5f83083
to
f7fed77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MrSidims , If eventually we plan to make SPV Cooperative Matrix a default, I believe, we should enable all Matrix E2E tests in SPVCooperativeMatrix folder, not a subset, to make sure no regressions, when we try to switch the default.
Do we really need a new folder? To all the existing tests. |
sycl/test-e2e/Matrix/SPVCooperativeMatrix/SG32/joint_matrix_apply_two_matrices.cpp
Outdated
Show resolved
Hide resolved
//===----------------------------------------------------------------------===// | ||
// SG size = 32 is not currently supported for SYCL Joint Matrix by IGC on DG2 | ||
// UNSUPPORTED: gpu-intel-dg2 | ||
// REQUIRES: gpu, aspect-ext_intel_matrix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, clean-up REQUIRES: gpu
that were not present in the original tests here and other tests
// REQUIRES: gpu, aspect-ext_intel_matrix | |
// REQUIRES: aspect-ext_intel_matrix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed here an in another cases
// REQUIRES: gpu, aspect-ext_intel_matrix | ||
// REQUIRES-INTEL-DRIVER: lin: 27501, win: 101.4943 | ||
|
||
// RUN: %{build} -D__SPIRV_USE_COOPERATIVE_MATRIX -o %t.out -ffp-model=precise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it seems you are using outdated set of tests. For example, please compare this file with: https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/Matrix/SG32/joint_matrix_bf16_fill_k_cache.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
@YuriPlyakhin went manually through the tests, should be better now. I've also removed XFAIL from several cpu runs. Few notes: the result of the testing on SPR inconsistent and it depends on the machine I'm running the tests. Not going to internal details: it might make sense. Eventually I expect more tests to pass in the post-commit, so something should be adjusted afterwards. |
Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
sycl/test-e2e/Matrix/SPVCooperativeMatrix/SG32/joint_matrix_bf16_fill_k_cache_init.cpp
Outdated
Show resolved
Hide resolved
sycl/test-e2e/Matrix/SPVCooperativeMatrix/SG32/joint_matrix_bfloat16_array.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my side I only found couple more places to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except more xfails need to be removed on both cpu and pvc like.
SG32/joint_matrix_apply_two_matrices.cpp
If these are known bugs with the new coop matrix implementation, please create a jira.
Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Failed Tests (1): is unrelated. @intel/llvm-gatekeepers please help with the merge |
Issue reported in #15088. |
The usage is currently guarded by __SPIRV_USE_COOPERATIVE_MATRIX macro.
It's a split from #13316