Skip to content

Commit 251eb90

Browse files
authored
[SYCL][Matrix][E2E] Organize matrix tests (#16563)
Move Matrix E2E test header files into the `Matrix/Inputs` folder. Also adds that folder to the included directories by adding to the `%clangxx` expansion in the `Matrix/lit.local.cfg` file to simplify the include statements.
1 parent 43ee651 commit 251eb90

File tree

83 files changed

+111
-103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+111
-103
lines changed

sycl/test-e2e/Matrix/joint_matrix_bf16_fill_k_cache_impl.hpp renamed to sycl/test-e2e/Matrix/Inputs/joint_matrix_bf16_fill_k_cache_impl.hpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,17 @@ template <size_t TM, size_t TN, size_t TK> class MatMul;
3838

3939
template <
4040
#if !defined(ARG_DIM) && !defined(RUNTIME_DIM)
41-
size_t rowsA, size_t colsA, size_t rowsB, size_t colsB,
41+
size_t rowsA, size_t colsA, size_t rowsB, size_t colsB,
4242
#endif // ARG_DIM, RUNTIME_DIM
43-
size_t vnniFactor, typename TOperand, typename TResult, size_t TM,
44-
size_t TN, size_t TK, size_t MCache1, size_t NCache1, size_t KCache1,
45-
size_t MCache2, size_t NCache2, size_t KCache2>
43+
size_t vnniFactor, typename TOperand, typename TResult, size_t TM,
44+
size_t TN, size_t TK, size_t MCache1, size_t NCache1, size_t KCache1,
45+
size_t MCache2, size_t NCache2, size_t KCache2>
4646
double joint_matmul(TOperand *A, TOperand *B, TResult *C, queue &q, int i
4747
#if defined(ARG_DIM) || defined(RUNTIME_DIM)
48-
, size_t rowsA, size_t colsA, size_t rowsB, size_t colsB
48+
,
49+
size_t rowsA, size_t colsA, size_t rowsB, size_t colsB
4950
#endif // ARG_DIM, RUNTIME_DIM
50-
) {
51+
) {
5152

5253
size_t sgSize = get_sg_size<MatMul<TM, TN, TK>>(q);
5354
range<2> global{rowsA / MCache1, (colsB / NCache1) * sgSize};
@@ -118,12 +119,12 @@ double joint_matmul(TOperand *A, TOperand *B, TResult *C, queue &q, int i
118119
// pm1B and pn1B are used to identify the distribution of subgroups
119120
// along the workgroup prefetch for B matrix. For A matrix, sgId is
120121
// enough.
121-
size_t pm1B = sgId / 16; // prefetch m1 (sgId/16)
122-
size_t pn1B = sgId & 0xF; // prefetch n1 (sgId%16)
123-
#else // VNNI
122+
size_t pm1B = sgId / 16; // prefetch m1 (sgId/16)
123+
size_t pn1B = sgId & 0xF; // prefetch n1 (sgId%16)
124+
#else // VNNI
124125
size_t pm1B = sgId / 8; // prefetch m1 (sgId/8)
125126
size_t pn1B = sgId & 0x7; // prefetch n1 (sgId%8)
126-
#endif // VNNI
127+
#endif // VNNI
127128
constexpr size_t prefDistance = 3;
128129
for (int p = 0; p < prefDistance; p++)
129130
joint_matrix_prefetch<prefRow, prefCol>(
@@ -306,8 +307,8 @@ double joint_matmul(TOperand *A, TOperand *B, TResult *C, queue &q, int i
306307
pm1B * prefRow) *
307308
(colsB)*vnniFactor +
308309
(n2 * NCache2 * vnniFactor + pn1B * prefCol);
309-
if ((prefetch_offsetB + (prefRow * colsB * vnniFactor) +
310-
prefCol) < (rowsB * colsB))
310+
if ((prefetch_offsetB + (prefRow * colsB * vnniFactor) + prefCol) <
311+
(rowsB * colsB))
311312
joint_matrix_prefetch<prefRow, prefCol>(
312313
sg, B + prefetch_offsetB, colsB * vnniFactor,
313314
layout::row_major,
@@ -395,18 +396,17 @@ void test(size_t matrix_size_input) {
395396
// run testIterations time, aggregate and calculate average run time
396397
double totalDuration = 0;
397398
for (unsigned int i = 0; i < testIterations; i++) {
398-
double duration =
399-
joint_matmul<
399+
double duration = joint_matmul<
400400
#if !defined(ARG_DIM) && !defined(RUNTIME_DIM)
401-
matrix_size, matrix_size, matrix_size, matrix_size,
401+
matrix_size, matrix_size, matrix_size, matrix_size,
402402
#endif // ARG_DIM, RUNTIME_DIM
403-
vnniFactor, T, TResult, TM, TN, TK, MCache1, NCache1,
404-
KCache1, MCache2, NCache2, KCache2>
405-
(A, B, C, q, i
403+
vnniFactor, T, TResult, TM, TN, TK, MCache1, NCache1, KCache1, MCache2,
404+
NCache2, KCache2>(A, B, C, q, i
406405
#if defined(ARG_DIM) || defined(RUNTIME_DIM)
407-
, matrix_size, matrix_size, matrix_size, matrix_size
406+
,
407+
matrix_size, matrix_size, matrix_size, matrix_size
408408
#endif // ARG_DIM, RUNTIME_DIM
409-
);
409+
);
410410

411411
if (i >= recordThresh) {
412412
totalDuration += duration;
@@ -431,19 +431,19 @@ void test(size_t matrix_size_input) {
431431

432432
int main(
433433
#ifdef RUNTIME_DIM
434-
int argc, char *argv[]
435-
#endif //RUNTIME_DIM
436-
) {
434+
int argc, char *argv[]
435+
#endif // RUNTIME_DIM
436+
) {
437437

438-
size_t matrix_size = -1;
438+
size_t matrix_size = -1;
439439
#ifdef RUNTIME_DIM
440440
if (argc == 2) {
441441
matrix_size = std::stoul(argv[1]);
442442
} else {
443443
std::cerr << "Usage: ./program matrix_size\n";
444444
return 1; // Error if no argument
445445
}
446-
#endif //RUNTIME_DIM
446+
#endif // RUNTIME_DIM
447447

448448
queue q;
449449
std::vector<combination> combinations =

sycl/test-e2e/Matrix/SG32/element_wise_abc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// RUN: %{build} -o %t.out
1414
// RUN: %{run} %t.out
1515

16-
#include "../common.hpp"
16+
#include "common.hpp"
1717

1818
#define SG_SZ 32
1919

20-
#include "../element_wise_abc_impl.hpp"
20+
#include "element_wise_abc_impl.hpp"

sycl/test-e2e/Matrix/SG32/element_wise_all_ops.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// RUN: %{build} -o %t.out
1414
// RUN: %{run} %t.out
1515

16-
#include "../common.hpp"
16+
#include "common.hpp"
1717

1818
#define SG_SZ 32
1919

20-
#include "../element_wise_all_ops_impl.hpp"
20+
#include "element_wise_all_ops_impl.hpp"

sycl/test-e2e/Matrix/SG32/element_wise_all_ops_half.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// RUN: %{build} -o %t.out
1515
// RUN: %{run} %t.out
1616

17-
#include "../common.hpp"
17+
#include "common.hpp"
1818

1919
#define SG_SZ 32
2020

21-
#include "../element_wise_all_ops_half_impl.hpp"
21+
#include "element_wise_all_ops_half_impl.hpp"

sycl/test-e2e/Matrix/SG32/element_wise_all_ops_int8.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// RUN: %{build} -o %t.out
1414
// RUN: %{run} %t.out
1515

16-
#include "../common.hpp"
16+
#include "common.hpp"
1717

1818
#define SG_SZ 32
1919

20-
#include "../element_wise_all_ops_int8_impl.hpp"
20+
#include "element_wise_all_ops_int8_impl.hpp"

sycl/test-e2e/Matrix/SG32/element_wise_all_ops_int8_packed.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
// This test stores the matrix B that is VNNIed (packed).
1717

18-
#include "../common.hpp"
18+
#include "common.hpp"
1919

2020
#define SG_SZ 32
2121

22-
#include "../element_wise_all_ops_int8_packed_impl.hpp"
22+
#include "element_wise_all_ops_int8_packed_impl.hpp"

sycl/test-e2e/Matrix/SG32/element_wise_all_ops_tf32.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// RUN: %{build} -o %t.out
1212
// RUN: %{run} %t.out
1313

14-
#include "../common.hpp"
14+
#include "common.hpp"
1515

1616
#define SG_SZ 32
1717
constexpr size_t TN = 16;
1818

19-
#include "../element_wise_all_ops_tf32_impl.hpp"
19+
#include "element_wise_all_ops_tf32_impl.hpp"

sycl/test-e2e/Matrix/SG32/element_wise_all_sizes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// RUN: %{build} -o %t.out
1515
// RUN: %{run} %t.out
1616

17-
#include "../common.hpp"
17+
#include "common.hpp"
1818

1919
#define SG_SZ 32
2020

21-
#include "../element_wise_all_sizes_impl.hpp"
21+
#include "element_wise_all_sizes_impl.hpp"

sycl/test-e2e/Matrix/SG32/element_wise_ops.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// RUN: %{build} -o %t.out
1414
// RUN: %{run} %t.out
1515

16-
#include "../common.hpp"
16+
#include "common.hpp"
1717

1818
#define SG_SZ 32
1919

20-
#include "../element_wise_ops_impl.hpp"
20+
#include "element_wise_ops_impl.hpp"

sycl/test-e2e/Matrix/SG32/get_coordinate_ops.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
// RUN: %{build} -o %t.out
2020
// RUN: %{run} %t.out
2121

22-
#include "../common.hpp"
22+
#include "common.hpp"
2323

2424
#define SG_SZ 32
2525

26-
#include "../get_coordinate_ops_impl.hpp"
26+
#include "get_coordinate_ops_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_all_sizes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// RUN: %{build} -o %t.out
1414
// RUN: %{run} %t.out
1515

16-
#include "../common.hpp"
16+
#include "common.hpp"
1717

1818
#define SG_SZ 32
1919

20-
#include "../joint_matrix_all_sizes_impl.hpp"
20+
#include "joint_matrix_all_sizes_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_annotated_ptr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
// XFAIL: gpu
1616
// XFAIL-TRACKER: GSD-4181
1717

18-
#include "../common.hpp"
18+
#include "common.hpp"
1919

2020
#define SG_SZ 32
2121
constexpr size_t TN = 16;
2222

23-
#include "../joint_matrix_annotated_ptr_impl.hpp"
23+
#include "joint_matrix_annotated_ptr_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_apply_bf16.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// RUN: %{build} -o %t.out
1414
// RUN: %{run} %t.out
1515

16-
#include "../common.hpp"
16+
#include "common.hpp"
1717

1818
#define SG_SZ 32
1919

20-
#include "../joint_matrix_apply_bf16_impl.hpp"
20+
#include "joint_matrix_apply_bf16_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_apply_two_matrices.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// RUN: %{build} %fp-model-precise -o %t.out
1414
// RUN: %{run} %t.out
1515

16-
#include "../common.hpp"
16+
#include "common.hpp"
1717

1818
#define SG_SZ 32
1919

20-
#include "../joint_matrix_apply_two_matrices_impl.hpp"
20+
#include "joint_matrix_apply_two_matrices_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bf16_fill_k_cache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
// -ffp-model=precise is added to not depend on compiler defaults.
2020

21-
#include "../common.hpp"
21+
#include "common.hpp"
2222

2323
#define SG_SZ 32
2424

25-
#include "../joint_matrix_bf16_fill_k_cache_impl.hpp"
25+
#include "joint_matrix_bf16_fill_k_cache_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bf16_fill_k_cache_SLM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
// -ffp-model=precise is added to not depend on compiler defaults.
1919

20-
#include "../common.hpp"
20+
#include "common.hpp"
2121
#define SG_SZ 32
2222

23-
#include "../joint_matrix_bf16_fill_k_cache_impl.hpp"
23+
#include "joint_matrix_bf16_fill_k_cache_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bf16_fill_k_cache_init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
// -ffp-model=precise is added to not depend on compiler defaults.
1717

18-
#include "../common.hpp"
18+
#include "common.hpp"
1919

2020
#define SG_SZ 32
2121

22-
#include "../joint_matrix_bf16_fill_k_cache_impl.hpp"
22+
#include "joint_matrix_bf16_fill_k_cache_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bf16_fill_k_cache_unroll.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
// since IGC doesn't support some variants of IR for Joint Matrix currently
1818
// -ffp-model=precise is added to not depend on compiler defaults.
1919

20-
#include "../common.hpp"
20+
#include "common.hpp"
2121

2222
#define SG_SZ 32
2323

24-
#include "../joint_matrix_bf16_fill_k_cache_impl.hpp"
24+
#include "joint_matrix_bf16_fill_k_cache_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bf16_fill_k_cache_unroll_init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
// since IGC doesn't support some variants of IR for Joint Matrix currently
1818
// -ffp-model=precise is added to not depend on compiler defaults.
1919

20-
#include "../common.hpp"
20+
#include "common.hpp"
2121

2222
#define SG_SZ 32
2323

24-
#include "../joint_matrix_bf16_fill_k_cache_impl.hpp"
24+
#include "joint_matrix_bf16_fill_k_cache_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bf16_rowmajorB_load_store.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
// RUN: %{build} -o %t.out
1111
// RUN: %{run} %t.out
1212

13-
#include "../common.hpp"
13+
#include "common.hpp"
1414

1515
#define SG_SZ 32
1616

17-
#include "../joint_matrix_bf16_rowmajorB_load_store_impl.hpp"
17+
#include "joint_matrix_bf16_rowmajorB_load_store_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bf16_rowmajorB_pair_load_store.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
// RUN: %{build} -o %t.out
1111
// RUN: %{run} %t.out
1212

13-
#include "../common.hpp"
13+
#include "common.hpp"
1414

1515
#define SG_SZ 32
1616

17-
#include "../joint_matrix_bf16_rowmajorB_pair_load_store_impl.hpp"
17+
#include "joint_matrix_bf16_rowmajorB_pair_load_store_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bfloat16.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// RUN: %{build} -o %t.out
1414
// RUN: %{run} %t.out
1515

16-
#include "../common.hpp"
16+
#include "common.hpp"
1717

1818
#define SG_SZ 32
1919

20-
#include "../joint_matrix_bfloat16_impl.hpp"
20+
#include "joint_matrix_bfloat16_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bfloat16_array.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// RUN: %{build} -o %t.out
1414
// RUN: %{run} %t.out
1515

16-
#include "../common.hpp"
16+
#include "common.hpp"
1717

1818
#define SG_SZ 32
1919

20-
#include "../joint_matrix_bfloat16_array_impl.hpp"
20+
#include "joint_matrix_bfloat16_array_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bfloat16_colmajorA_colmajorB.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
// XFAIL: gpu
1818
// XFAIL-TRACKER: GSD-5768
1919

20-
#include "../common.hpp"
20+
#include "common.hpp"
2121
#define SG_SZ 32
22-
#include "../joint_matrix_bfloat16_colmajorA_colmajorB_impl.hpp"
22+
#include "joint_matrix_bfloat16_colmajorA_colmajorB_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_bfloat16_packedB.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// XFAIL: gpu
1818
// XFAIL-TRACKER: GSD-4181
1919

20-
#include "../common.hpp"
20+
#include "common.hpp"
2121

2222
#define SG_SZ 32
23-
#include "../joint_matrix_bfloat16_packedB_impl.hpp"
23+
#include "joint_matrix_bfloat16_packedB_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_colA_rowB_colC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
// XFAIL: gpu && run-mode
1515
// XFAIL-TRACKER: GSD-5768
1616

17-
#include "../common.hpp"
17+
#include "common.hpp"
1818
#define SG_SZ 32
19-
#include "../joint_matrix_colA_rowB_colC_impl.hpp"
19+
#include "joint_matrix_colA_rowB_colC_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_down_convert.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// RUN: %{build} -o %t.out
1515
// RUN: %{run} %t.out
1616

17-
#include "../common.hpp"
17+
#include "common.hpp"
1818

1919
#define SG_SZ 32
2020

21-
#include "../joint_matrix_down_convert_impl.hpp"
21+
#include "joint_matrix_down_convert_impl.hpp"

sycl/test-e2e/Matrix/SG32/joint_matrix_half.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// RUN: %{build} -o %t.out
1515
// RUN: %{run} %t.out
1616

17-
#include "../common.hpp"
17+
#include "common.hpp"
1818

1919
#define SG_SZ 32
2020

21-
#include "../joint_matrix_half_impl.hpp"
21+
#include "joint_matrix_half_impl.hpp"

0 commit comments

Comments
 (0)