Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Add new tests for int8 and bfloat16 automatic transpose and VNNI transform #1415

Merged

Conversation

yubingex007-a11y
Copy link

  • 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)

@yubingex007-a11y yubingex007-a11y requested a review from a team as a code owner November 24, 2022 07:58
@yubingex007-a11y yubingex007-a11y requested review from v-klochkov and removed request for a team November 24, 2022 07:58
@yubingex007-a11y yubingex007-a11y changed the title row col major int8 bfloat16 @dkhaldi Add new tests for int8 and bfloat16 automatic transpose and VNNI transform Nov 24, 2022
@yubingex007-a11y yubingex007-a11y changed the title @dkhaldi Add new tests for int8 and bfloat16 automatic transpose and VNNI transform Add new tests for int8 and bfloat16 automatic transpose and VNNI transform Nov 24, 2022
@yubingex007-a11y
Copy link
Author

@dkhaldi i fixed the bug in testcases itself and provide more cases for int8.
seems we need to rename the testcases.

@v-klochkov
Copy link

Sorry, I am on vacation. Adding intel/llvm-reviewers-runtime again.

@v-klochkov v-klochkov requested review from a team and removed request for v-klochkov November 28, 2022 04:40
using namespace sycl::ext::oneapi::experimental::matrix;
using bfloat16 = sycl::ext::oneapi::experimental::bfloat16;

#define SG_SZ 8
Copy link

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
Copy link

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]) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using namespace sycl::ext::oneapi::experimental::matrix;
using bfloat16 = sycl::ext::oneapi::experimental::bfloat16;

#define SG_SZ 8
Copy link

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--------==//
Copy link

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?

Copy link
Author

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.

Copy link

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---------==//
Copy link

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]) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@yubingex007-a11y yubingex007-a11y force-pushed the row-col-major-int8-bfloat16 branch from 6599813 to 98f24ea Compare November 30, 2022 08:21
@yubingex007-a11y yubingex007-a11y changed the base branch from sum_accumulate to intel November 30, 2022 08:23
@AlexeySachkov AlexeySachkov removed the request for review from a team November 30, 2022 09:10
@yubingex007-a11y yubingex007-a11y deleted the row-col-major-int8-bfloat16 branch November 30, 2022 09:13
@yubingex007-a11y yubingex007-a11y restored the row-col-major-int8-bfloat16 branch November 30, 2022 09:14
@yubingex007-a11y yubingex007-a11y requested review from dkhaldi and removed request for a team November 30, 2022 09:17
@yubingex007-a11y yubingex007-a11y removed request for a team and Pennycook November 30, 2022 09:22
@dkhaldi
Copy link

dkhaldi commented Nov 30, 2022

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.
Does this make sense?

@yubingex007-a11y
Copy link
Author

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. Does this make sense?

maybe let's keep the code style with other cases? we may have other arch in the future.

@dkhaldi
Copy link

dkhaldi commented Dec 1, 2022

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. Does this make sense?

maybe let's keep the code style with other cases? we may have other arch in the future.

Fine by me

Copy link

@dkhaldi dkhaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yubingex007-a11y
Copy link
Author

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

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.

Copy link
Author

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.

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.

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

@steffenlarsen steffenlarsen changed the title Add new tests for int8 and bfloat16 automatic transpose and VNNI transform [SYCL] Add new tests for int8 and bfloat16 automatic transpose and VNNI transform Dec 2, 2022
@steffenlarsen steffenlarsen merged commit 85caea5 into intel:intel Dec 2, 2022
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Mar 22, 2023
…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)
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
…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)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants