[SYCL][Matrix] Add support for tf32 type using the unified interface#8702
[SYCL][Matrix] Add support for tf32 type using the unified interface#8702steffenlarsen merged 12 commits intointel:syclfrom
Conversation
| auto wi_data_a = | ||
| sycl::ext::intel::experimental::matrix::get_wi_data(sg, sub_a); | ||
| for (int i = 0; i < wi_data_a.length(); i++) { | ||
| wi_data_a[i] = round_to_tf32(wi_data_a[i]); |
There was a problem hiding this comment.
nit, but shouldn't this type of usage of round_to_tf32 really use joint_matrix_apply?
There was a problem hiding this comment.
Yes, I will use joint_matrix_apply for A and leave the loop way for B to show both usages.
|
I think this should be fine from NVPTX point of view: will wait for confirmation from the cuda llvm-test-suite run. |
| @@ -0,0 +1,164 @@ | |||
| // RUN: %clangxx -fsycl -O2 -DSYCL_EXT_ONEAPI_MATRIX_VERSION=4 %s -o %t.out | |||
| #include <iostream> | |||
There was a problem hiding this comment.
Shouldn't this kind of runtime test be placed in llvm-test-suite/SYCL/Matrix instead?
There was a problem hiding this comment.
I will update the header to only check compilation
There was a problem hiding this comment.
If we use -emit-llvm and FileCheck shouldn't we add checks for the actual IR generated by the compiler?
| @@ -0,0 +1,164 @@ | |||
| // RUN: %clangxx -fsycl -O2 -DSYCL_EXT_ONEAPI_MATRIX_VERSION=4 %s -o %t.out | |||
| #include <iostream> | |||
There was a problem hiding this comment.
If we use -emit-llvm and FileCheck shouldn't we add checks for the actual IR generated by the compiler?
| joint_matrix_apply(sg, sub_a, [=](float x) { x *= 2; }); | ||
| for (int i = 0; i < wi_slice_a.length(); i++) { | ||
| float elem = wi_slice_a[i]; | ||
| wi_slice_a[i] *= 2; |
There was a problem hiding this comment.
move this ewo line to ewo test in llvm-test-suite
There was a problem hiding this comment.
tests are added here: intel/llvm-test-suite#1677
|
@MrSidims, I am changing the name to __spirv_RoundFToTF32INTEL |
|
e2e testcases got approval in intel/llvm-test-suite#1677 |
|
ping? |
|
@yubingex007-a11y the build is failing here because the round function is not available yet in intel/llvm. |
|
the testcases fail are not related with this pr i think. |
|
ping? |
steffenlarsen
left a comment
There was a problem hiding this comment.
Small naming change request, but otherwise LGTM.
| template <typename T> struct helper_traits { | ||
| using element_type = T; | ||
| using storage_element_type = T; | ||
| using fill_argument_type = T; |
There was a problem hiding this comment.
remove fill_argument_type as it is currently unused
|
@steffenlarsen Hi, can you help us merge this patch |
|
@yubingex007-a11y - Could you please push another merge commit to rerun pre-commit tests? CI issues should hopefully have been addressed. |
| //===----------------------------------------------------------------------===// | ||
| // REQUIRES: matrix | ||
|
|
||
| // RUN: %clangxx -fsycl %s -o %t.out -Dsycl/test-e2e_EXT_ONEAPI_MATRIX_VERSION=4 |
There was a problem hiding this comment.
Should be -DSYCL_EXT_ONEAPI_MATRIX_VERSION=4
| //===----------------------------------------------------------------------===// | ||
| // REQUIRES: matrix | ||
|
|
||
| // RUN: %clangxx -fsycl %s -o %t.out -Dsycl/test-e2e_EXT_ONEAPI_MATRIX_VERSION=4 |
There was a problem hiding this comment.
Should be -DSYCL_EXT_ONEAPI_MATRIX_VERSION=4
| auto wi_data_b = | ||
| sycl::ext::intel::experimental::matrix::get_wi_data(sg, sub_b); | ||
| for (int i = 0; i < wi_data_b.length(); i++) { | ||
| wi_data_b[i] = round_to_tf32(wi_data_b[i]); |
There was a problem hiding this comment.
No known conversion from wi_element<> to float &
No description provided.