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

[SYCL][matrix] add a new test for irregular slicing on packed matrix … #899

Merged
merged 7 commits into from
Jun 9, 2022

Conversation

dkhaldi
Copy link

@dkhaldi dkhaldi commented Mar 7, 2022

…that calculates sum of rows of the matrix

@dkhaldi dkhaldi requested a review from a team as a code owner March 7, 2022 17:20
@dkhaldi dkhaldi requested a review from steffenlarsen March 7, 2022 17:20
@dkhaldi
Copy link
Author

dkhaldi commented Mar 7, 2022

@Nuullll, this is a test for irregular slicing but it is still a draft.

@dkhaldi dkhaldi requested a review from yubingex007-a11y March 7, 2022 17:27
@Nuullll
Copy link

Nuullll commented Mar 8, 2022

@Nuullll, this is a test for irregular slicing but it is still a draft.

Thanks!

const auto sg_starty = global_idy - spmd_item.get_local_id(1);

ext::oneapi::sub_group sg = spmd_item.get_sub_group();
joint_matrix<T, TK, TN, matrix_layout::packed_b> sub_b(sg);
Copy link

Choose a reason for hiding this comment

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

IIUC, the template arguments specify the logical size of sub_b, then why is it a 32 x 8 matrix? Shouldn't it be 8 x 8?

Copy link
Author

Choose a reason for hiding this comment

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

I will correct the test, it should be 32x8 as I am imitating a real use for matrix B

Comment on lines 110 to 112
for (int i = 0; i < MATRIX_M / 4; i++) {
for (int j = 0; j < MATRIX_N * 4; j++) {
B[i][j] = i;
Copy link

Choose a reason for hiding this comment

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

The loop size doesn't match B's declaration size at line 99. We'll end up with:

// 16x16 view
B = [0, 0, 0, ... 0;
1, 1, 1, ... 1;
2, 2, 2, ... 2;
3, 3, 3, ... 3;
3, 3, 3, ... 3;
3, 3, 3, ... 3;
3, 3, 3, ... 3;
0, 0, 0, ... 0;
...
0, 0, 0, ... 0;]

Is this expected?

Comment on lines 84 to 85
// TODO: communicate this mapping information to the user using a
// query interface

Choose a reason for hiding this comment

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

Should this TODO be here? Is it expected to affect the test when it is implemented?

Choose a reason for hiding this comment

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

Only half of the TODO was removed.

void matrix_sum_rows(queue q, big_matrix<T, M, N> &B, nd_range<2> &r) {
buffer<int8_t, 2> bufB(B.get_data(), range<2>(M, N));
// size of vector is known because SG size of set by the user in this case
buffer<int> sum_rows_v(M); // there are total of tK/4 * 2, 16 rows
Copy link

Choose a reason for hiding this comment

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

Initialize the buffer with zeros, otherwise atomic_fetch_add would add numbers to uninitialized values and get weird results.

Suggested change
buffer<int> sum_rows_v(M); // there are total of tK/4 * 2, 16 rows
int sum_rows[M] = {0};
buffer<int> sum_rows_v(sum_rows, M); // there are total of tK/4 * 2, 16 rows

@dkhaldi
Copy link
Author

dkhaldi commented Jun 8, 2022

@steffenlarsen is SYCL :: SubGroup/attributes.cpp expected to fail?

@steffenlarsen
Copy link

@steffenlarsen is SYCL :: SubGroup/attributes.cpp expected to fail?

There are some known sporadic failures caused by driver issues. We hope to have them fixed soon.

Copy link

@Nuullll Nuullll left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you, Dounia.

@dkhaldi
Copy link
Author

dkhaldi commented Jun 9, 2022

@steffenlarsen can we merge this PR?

@steffenlarsen steffenlarsen merged commit 2af10df into intel:intel Jun 9, 2022
myler added a commit to myler/llvm-test-suite that referenced this pull request Mar 22, 2023
CMPLRTOOLS-26492: enable ESIMD_EMULATOR for optset opt_use_esimd_emu
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Mar 22, 2023
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
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.

3 participants