-
Notifications
You must be signed in to change notification settings - Fork 766
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] Add support for tf32 type using the unified interface #8702
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, but shouldn't this type of usage of round_to_tf32
really use joint_matrix_apply
?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this kind of runtime test be placed in llvm-test-suite/SYCL/Matrix instead?
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.
I will update the header to only check compilation
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.
If we use -emit-llvm and FileCheck shouldn't we add checks for the actual IR generated by the compiler?
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.
Changes are LGTM
@@ -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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this ewo line to ewo test in llvm-test-suite
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.
tests are added here: intel/llvm-test-suite#1677
@MrSidims, I am changing the name to __spirv_RoundFToTF32INTEL |
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
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? |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove fill_argument_type as it is currently unused
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!
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No known conversion from wi_element<>
to float &
No description provided.