-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL] Add new tests for int8 and bfloat16 automatic transpose and VNNI transform #1415
[SYCL] Add new tests for int8 and bfloat16 automatic transpose and VNNI transform #1415
Conversation
yubingex007-a11y
commented
Nov 24, 2022
- Add new tests for automatic transpose and VNNI transform
- fix a bug in bfloat16's testcase
- add testcases for subB(int8, colmajor/rowmajor) and subA(int8, colmajor/rowmajor)
@dkhaldi i fixed the bug in testcases itself and provide more cases for int8. |
Sorry, I am on vacation. Adding intel/llvm-reviewers-runtime again. |
using namespace sycl::ext::oneapi::experimental::matrix; | ||
using bfloat16 = sycl::ext::oneapi::experimental::bfloat16; | ||
|
||
#define SG_SZ 8 |
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 transform the tests to follow the existing https://github.com/intel/llvm-test-suite/blob/intel/SYCL/Matrix/joint_matrix_bfloat16.cpp
SG size needs to be 16 for PVC and SPR.
sg size = 8 test needs to be in XMX8 folder
#define SG_SZ 8 | ||
|
||
#define TM 8 | ||
#define TN 8 |
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.
#define TN SG_SZ
bool res = true; | ||
for (int i = 0; i < MATRIX_M; i++) { | ||
for (int j = 0; j < MATRIX_N; j++) { | ||
if (C[i][j] != D[i][j]) { |
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 ((fabs(C[i][j]) - fabs(D[i][j])) > BF16_EPSILON)
see https://github.com/intel/llvm-test-suite/blob/intel/SYCL/Matrix/joint_matrix_bfloat16_impl.hpp
using namespace sycl::ext::oneapi::experimental::matrix; | ||
using bfloat16 = sycl::ext::oneapi::experimental::bfloat16; | ||
|
||
#define SG_SZ 8 |
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.
same as above
@@ -0,0 +1,170 @@ | |||
//==-------joint_matrix_bfloat16_row_major.cpp - DPC++ joint_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.
should this be called ...row_majorB?
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 really has question about naming the testcase here.
SYCL/Matrix/joint_matrix_bfloat16_col_majorA.cpp(A is colmajor and B is colmajor, we can test colmajor=>packed and colmajor=>rowmajor)
i suggest change it into joint_matrix_bfloat16_colmajorA_colmajorB.cpp
joint_matrix_bfloat16_row_major.cpp => joint_matrix_bfloat16_rowmajorA_rowmajorB.cpp(we can test colmajor=>packed)
with joint_matrix_bfloat16_colmajorA_colmajorB.cpp and joint_matrix_bfloat16_rowmajorA_rowmajorB.cpp, we can test all the auto-vnnitransform cases.
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 agree with the naming you have now
@@ -0,0 +1,170 @@ | |||
//==----- joint_matrix_bfloat16_col_major.cpp - DPC++ joint_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.
should this be called ...col_majorB
bool res = true; | ||
for (int i = 0; i < MATRIX_M; i++) { | ||
for (int j = 0; j < MATRIX_N; j++) { | ||
if (C[i][j] != D[i][j]) { |
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.
same as above
6599813
to
98f24ea
Compare
Sorry, but I just realized after you made the change that we will never get XMX8 to support transpose and VNNI transform. This will be only PVC feature (XMX16). So we should put back the three tests you have into one file. There is no need to split it since we won't have them in XMX8 folder. |
maybe let's keep the code style with other cases? we may have other arch in the future. |
Fine by me |
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
ping? @intel/llvm-reviewers-runtime |
// RUN: %clangxx -fsycl %s -o %t.out | ||
// RUN: %CPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %GPU_RUN_PLACEHOLDER %t.out | ||
// CHECK: passed |
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.
This only has an effect if you run the output through FileCheck. It would be easier to just have the main functions return a non-0 value if they fail.
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.
maybe later we change all of it. other tesctcases have such issue as well.
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 this is indeed a problem for the other tests, I am okay with merging it as-is, but it should be addressed ASAP. Note that anything that can cause "failed" to be printed will not currently be considered a failure by the test system for these tests.
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.
Patch for fixing this: #1432
…NI transform (intel#1415) - Add new tests for automatic transpose and VNNI transform - fix a bug in bfloat16's testcase - add testcases for subB(int8, colmajor/rowmajor) and subA(int8, colmajor/rowmajor)
…NI transform (intel/llvm-test-suite#1415) - Add new tests for automatic transpose and VNNI transform - fix a bug in bfloat16's testcase - add testcases for subB(int8, colmajor/rowmajor) and subA(int8, colmajor/rowmajor)