Skip to content

Commit

Permalink
[SYCL][Matrix] Change packed to ext_intel_packed
Browse files Browse the repository at this point in the history
  • Loading branch information
yubingex007-a11y committed May 31, 2023
1 parent 40ac9cc commit fed879f
Show file tree
Hide file tree
Showing 25 changed files with 42 additions and 41 deletions.
7 changes: 4 additions & 3 deletions sycl/include/sycl/ext/oneapi/matrix/matrix-intel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace sycl {
__SYCL_INLINE_VER_NAMESPACE(_V1) {
namespace ext {
namespace intel::experimental::matrix::layout {
constexpr sycl::ext::oneapi::experimental::matrix::layout packed =
constexpr sycl::ext::oneapi::experimental::matrix::layout ext_intel_packed =
static_cast<sycl::ext::oneapi::experimental::matrix::layout>(2);
}
namespace oneapi {
Expand All @@ -36,8 +36,9 @@ template <layout Layout> struct spv_matrix_layout_traits {

SPV_MATRIX_LAYOUT_TRAITS(layout::row_major, __spv::MatrixLayout::RowMajor)
SPV_MATRIX_LAYOUT_TRAITS(layout::col_major, __spv::MatrixLayout::ColumnMajor)
SPV_MATRIX_LAYOUT_TRAITS(sycl::ext::intel::experimental::matrix::layout::packed,
__spv::MatrixLayout::Packed)
SPV_MATRIX_LAYOUT_TRAITS(
sycl::ext::intel::experimental::matrix::layout::ext_intel_packed,
__spv::MatrixLayout::Packed)
SPV_MATRIX_LAYOUT_TRAITS(layout::dynamic, __spv::MatrixLayout::Dynamic)

template <use Use> struct spv_matrix_use_traits {
Expand Down
4 changes: 2 additions & 2 deletions sycl/include/sycl/ext/oneapi/matrix/matrix-unified.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ inline __SYCL_ALWAYS_INLINE void joint_matrix_load(
Ptr, stride, __spv::MatrixLayout::ColumnMajor,
spv_scope_traits<Group>::value);
break;
case sycl::ext::intel::experimental::matrix::layout::packed:
case sycl::ext::intel::experimental::matrix::layout::ext_intel_packed:
res.spvm = __spirv_JointMatrixLoadINTEL<
DecorT, S, NumRows, NumCols,
spv_matrix_use_traits<use::accumulator>::value,
Expand Down Expand Up @@ -327,7 +327,7 @@ inline __SYCL_ALWAYS_INLINE void joint_matrix_store(
Ptr, src.spvm, stride, __spv::MatrixLayout::ColumnMajor,
spv_scope_traits<Group>::value);
break;
case sycl::ext::intel::experimental::matrix::layout::packed:
case sycl::ext::intel::experimental::matrix::layout::ext_intel_packed:
__spirv_JointMatrixStoreINTEL<
DecorT, T, NumRows, NumCols,
spv_matrix_use_traits<use::accumulator>::value,
Expand Down
10 changes: 5 additions & 5 deletions sycl/test-e2e/Matrix/element_wise_all_ops_int8_packed_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void matrix_verify_add(queue q, big_matrix<T, M, N> &A, nd_range<2> &r,

sub_group sg = spmd_item.get_sub_group();
joint_matrix<sub_group, int8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;

joint_matrix_fill(sg, sub_b, 5);
Expand Down Expand Up @@ -75,7 +75,7 @@ void matrix_verify_sub(queue q, big_matrix<T, M, N> &A, nd_range<2> &r,

sub_group sg = spmd_item.get_sub_group();
joint_matrix<sub_group, int8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;

joint_matrix_fill(sg, sub_b, 5);
Expand Down Expand Up @@ -112,7 +112,7 @@ void matrix_verify_mul(queue q, big_matrix<T, M, N> &A, nd_range<2> &r,

sub_group sg = spmd_item.get_sub_group();
joint_matrix<sub_group, int8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;

joint_matrix_fill(sg, sub_b, 5);
Expand Down Expand Up @@ -149,7 +149,7 @@ void matrix_verify_div(queue q, big_matrix<T, M, N> &A, nd_range<2> &r,

sub_group sg = spmd_item.get_sub_group();
joint_matrix<sub_group, int8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;

joint_matrix_fill(sg, sub_b, 4);
Expand Down Expand Up @@ -186,7 +186,7 @@ void matrix_verify_logic(queue q, big_matrix<T, M, N> &A, nd_range<2> &r,

sub_group sg = spmd_item.get_sub_group();
joint_matrix<sub_group, int8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;

joint_matrix_fill(sg, sub_b, 5);
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/element_wise_irreg_sum_rows_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void matrix_sum_rows(queue q, big_matrix<T, M, N> &B, nd_range<2> &r) {
ext::oneapi::sub_group sg = spmd_item.get_sub_group();

joint_matrix<sub_group, T, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;

joint_matrix_load(
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/element_wise_ops_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,
sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, int8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, int32_t, use::accumulator, TM, TN> sub_c;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/elemwise_irreg_size_ops_bf16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,
sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, bfloat16, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, float, use::accumulator, TM, TN> sub_c;
joint_matrix_load(
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/get_coord_bf16_gemm_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void matrix_multiply(big_matrix<T1, M, N> &C, big_matrix<T2, M, K> &A,
sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, bfloat16, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, float, use::accumulator, TM, TN> sub_c;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/get_coord_bf16_matB_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void matrix_sum_cols(queue q, big_matrix<T, M, N> &B, nd_range<2> &r) {

// TK = 32, TN = 16
joint_matrix<sub_group, int8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;

joint_matrix_load(
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/joint_matrix_all_sizes_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void matrix_multiply(big_matrix<T1, M, N> &C, big_matrix<T2, M, K> &A,
joint_matrix<sub_group, T2, use::a, TM, TK, layout::row_major> sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, T2, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, T1, use::accumulator, TM, TN> sub_c;

Expand Down
18 changes: 9 additions & 9 deletions sycl/test-e2e/Matrix/joint_matrix_bf16_fill_k_cache_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,35 +153,35 @@ double joint_matmul(TOperand *A, TOperand *B, TResult *C, queue &q, int i) {
;

joint_matrix<sub_group, TOperand, use::b, tK, tN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
tB[NCACHE1 / tN][KCACHE2 / KCACHE1]
#ifdef INIT_LIST
=
{
joint_matrix<
sub_group, TOperand, use::b, tK, tN,
ext::intel::experimental::matrix::layout::packed>(),
ext::intel::experimental::matrix::layout::ext_intel_packed>(),
joint_matrix<
sub_group, TOperand, use::b, tK, tN,
ext::intel::experimental::matrix::layout::packed>(),
ext::intel::experimental::matrix::layout::ext_intel_packed>(),
joint_matrix<
sub_group, TOperand, use::b, tK, tN,
ext::intel::experimental::matrix::layout::packed>(),
ext::intel::experimental::matrix::layout::ext_intel_packed>(),
joint_matrix<
sub_group, TOperand, use::b, tK, tN,
ext::intel::experimental::matrix::layout::packed>(),
ext::intel::experimental::matrix::layout::ext_intel_packed>(),
joint_matrix<
sub_group, TOperand, use::b, tK, tN,
ext::intel::experimental::matrix::layout::packed>(),
ext::intel::experimental::matrix::layout::ext_intel_packed>(),
joint_matrix<
sub_group, TOperand, use::b, tK, tN,
ext::intel::experimental::matrix::layout::packed>(),
ext::intel::experimental::matrix::layout::ext_intel_packed>(),
joint_matrix<
sub_group, TOperand, use::b, tK, tN,
ext::intel::experimental::matrix::layout::packed>(),
ext::intel::experimental::matrix::layout::ext_intel_packed>(),
joint_matrix<
sub_group, TOperand, use::b, tK, tN,
ext::intel::experimental::matrix::layout::packed>(),
ext::intel::experimental::matrix::layout::ext_intel_packed>(),
}
#endif
;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/joint_matrix_bfloat16_32x64_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void matrix_multiply(big_matrix<T1, M, N> &C, big_matrix<T2, M, K> &A,
sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, bfloat16, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, float, use::accumulator, TM, TN> sub_c;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/joint_matrix_bfloat16_array_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void matrix_multiply(big_matrix<T1, M, N> &C, big_matrix<T2, M, K> &A,

// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, bfloat16, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, float, use::accumulator, TM, TN>
sub_c[JM_ARRAY_SZ];
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/joint_matrix_bfloat16_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void matrix_multiply(big_matrix<T1, M, N> &C, big_matrix<T2, M, K> &A,
sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, bfloat16, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, float, use::accumulator, TM, TN> sub_c;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/joint_matrix_half_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,
sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, half, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, float, use::accumulator, TM, TN> sub_c;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/joint_matrix_query_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,

myparams2::joint_matrix_a<sub_group, layout::row_major> sub_a;
myparams2::joint_matrix_b<
sub_group, ext::intel::experimental::matrix::layout::packed>
sub_group, ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
myparams2::joint_matrix_accumulator<sub_group> sub_c;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/joint_matrix_ss_int8_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,
sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, int8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, int32_t, use::accumulator, TM, TN> sub_c;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/joint_matrix_su_int8_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,
sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, uint8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, int32_t, use::accumulator, TM, TN> sub_c;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/joint_matrix_us_int8_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,
sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, int8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, int32_t, use::accumulator, TM, TN> sub_c;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Matrix/joint_matrix_uu_int8_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,
sub_a;
// For B, we assume B has been already VNNIed.
joint_matrix<sub_group, uint8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sub_group, int32_t, use::accumulator, TM, TN> sub_c;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int main(void) {
layout::row_major>
tA;
joint_matrix<sub_group, unsigned short, use::b, 16, 16,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
tB;
joint_matrix<sub_group, float, use::accumulator, 8, 16> tC;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test/matrix/matrix-bfloat16-test-coord-basicB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void matrix_sum_cols(queue q, big_matrix<T, M, N> &B, nd_range<2> &r) {

// TK = 32, TN = 16
joint_matrix<sub_group, int8_t, use::b, TK, TN,
ext::intel::experimental::matrix::layout::packed>
ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;

joint_matrix_load(
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/matrix/matrix-bfloat16-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,
// the packed_b layout. By default, the layout is row_major and size
// is (TK, TN).
joint_matrix<sycl::sub_group, bfloat16, use::b, TK, TN,
sycl::ext::intel::experimental::matrix::layout::packed>
sycl::ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sycl::sub_group, float, use::accumulator, TM, TN> sub_c;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test/matrix/matrix-elemwise-ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,
// the packed_b layout. By default, the layout is row_major and size
// is (TK, TN).
joint_matrix<sycl::sub_group, int8_t, use::b, TK, TN,
sycl::ext::intel::experimental::matrix::layout::packed>
sycl::ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sycl::sub_group, int32_t, use::accumulator, TM, TN>
sub_c;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/matrix/matrix-int8-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void matrix_multiply(big_matrix<T1, NUM_ROWS_C, NUM_COLS_C> &C,
// the packed_b layout. By default, the layout is row_major and size
// is (TK, TN).
joint_matrix<sycl::sub_group, int8_t, use::b, TK, TN,
sycl::ext::intel::experimental::matrix::layout::packed>
sycl::ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b;
joint_matrix<sycl::sub_group, int32_t, use::accumulator, TM, TN>
sub_c;
Expand Down
4 changes: 2 additions & 2 deletions sycl/test/matrix/query-use.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void query_amx() {
sub_group sg = spmd_item.get_sub_group();
myparams2::joint_matrix_a<sub_group, layout::row_major> sub_a1;
myparams2::joint_matrix_b<
sub_group, sycl::ext::intel::experimental::matrix::layout::packed>
sub_group, sycl::ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b1;
myparams2::joint_matrix_accumulator<sub_group> sub_c1;

Expand Down Expand Up @@ -144,7 +144,7 @@ void query_xmx8() {
sub_group sg = spmd_item.get_sub_group();
myparams2::joint_matrix_a<sub_group, layout::row_major> sub_a1;
myparams2::joint_matrix_b<
sub_group, sycl::ext::intel::experimental::matrix::layout::packed>
sub_group, sycl::ext::intel::experimental::matrix::layout::ext_intel_packed>
sub_b1;
myparams2::joint_matrix_accumulator<sub_group> sub_c1;

Expand Down

0 comments on commit fed879f

Please sign in to comment.