@@ -30,14 +30,14 @@ constexpr size_t UNDEFINED_DATA_SIZE = 1024;
3030class test_col_major_1 {
3131 public:
3232 // Extract the parameters required by different test cases
33- static constexpr size_t mat_m = 1 ;
33+ static constexpr size_t mat_m = 4096 ;
3434 static constexpr size_t mat_n = 4096 ;
3535 static constexpr size_t mat_k = 4096 ;
36- static constexpr size_t wg_m = 1 ;
37- static constexpr size_t wg_n = 1 ;
38- static constexpr size_t sg_m = 1 ;
39- static constexpr size_t sg_n = 1 ;
40- static constexpr size_t sg_k = 512 / sg_m ;
36+ static constexpr size_t wg_m = 64 ;
37+ static constexpr size_t wg_n = 32 ;
38+ static constexpr size_t sg_m = 16 ;
39+ static constexpr size_t sg_n = 8 ;
40+ static constexpr size_t sg_k = 32 ;
4141 static constexpr size_t dequant_s = 128 ;
4242 // static constexpr quant_mode quant_mode = quant_mode::S4_ASYM;
4343 static constexpr quant_mode quant_mode = quant_mode::S4_FULLRANGE_NO_ZP ;
@@ -46,8 +46,8 @@ class test_col_major_1 {
4646 static constexpr size_t global_kslicing = 1 ;
4747 static constexpr mem_layout layout_a = mem_layout::row_major;
4848 static constexpr mem_layout layout_b = mem_layout::col_major;
49- static constexpr mma_engine mma_eng = mma_engine::fpu ;
50- static constexpr gpu_arch arch = gpu_arch::XeLpg ;
49+ static constexpr mma_engine mma_eng = mma_engine::xmx ;
50+ static constexpr gpu_arch arch = gpu_arch::XeHpg ;
5151 using data_type_a = fp16;
5252 using data_type_b = int4x8;
5353 using data_type_c = fp16;
@@ -108,14 +108,17 @@ int gemm_result_validate(
108108 bool result = buff_cmp::xetla_buff_cmp (data, other, " gemv validation" );
109109
110110#ifdef UT_DEBUG
111- // for (uint32_t i = 0; i < m; i++) {
112- // for (uint32_t j = 0; j < n; j++) {
113- // std::cout << float(sycl::half(C[i * n + j])) << " ";
114- // }
115- // std::cout << std::endl;
116- // }
111+ if (m * n <= 4096 ) {
112+ std::cout << " result:\n " ;
113+ for (uint32_t i = 0 ; i < m; i++) {
114+ for (uint32_t j = 0 ; j < n; j++) {
115+ std::cout << float (sycl::half (C[i * n + j])) << " " ;
116+ }
117+ std::cout << " \n " ;
118+ }
119+ }
117120#endif
118- std::cout << (!result ? " FAILED\n " : " PASSED\n " ) ;
121+ std::cout << (!result ? " FAILED" : " PASSED" ) << std::endl ;
119122 return result ? 0 : 1 ;
120123}
121124
@@ -185,12 +188,15 @@ std::vector<data_type_acc_in> dequantize_weight(
185188 }
186189 }
187190#ifdef UT_DEBUG
188- // for (uint32_t i = 0; i < matrix_n; i++) {
189- // for (uint32_t j = 0; j < matrix_k; j++) {
190- // std::cout << float(sycl::half(b_out[i * matrix_k + j])) << " ";
191- // }
192- // std::cout << std::endl;
193- // }
191+ if (matrix_n * matrix_k <= 4096 ) {
192+ std::cout << " dequantize_weight:\n " ;
193+ for (uint32_t i = 0 ; i < matrix_n; i++) {
194+ for (uint32_t j = 0 ; j < matrix_k; j++) {
195+ std::cout << float (sycl::half (b_out[i * matrix_k + j])) << " " ;
196+ }
197+ std::cout << std::endl;
198+ }
199+ }
194200#endif
195201 return b_out;
196202}
@@ -385,12 +391,14 @@ void dequantize_gemv_run(int iter) {
385391 if constexpr (std::is_same_v<int4x2, data_type_b>) {
386392 B_h[i] = random_uint8 ();
387393#ifdef UT_DEBUG
388- B_h[i] = 0x77 ;
394+ B_h[i] = ((7 + i) % 15 + 1 ) * 0x11 ;
395+ if (i >= size_b)
396+ B_h[i] = -1 ;
389397#endif
390398 } else if constexpr (std::is_same_v<int4x8, data_type_b>) {
391399 B_h[i] = random_uint32 ();
392400#ifdef UT_DEBUG
393- B_h[i] = 0x77777777 ;
401+ B_h[i] = (( 7 + i) % 15 + 1 ) * 0x11111111 ;
394402#endif
395403 }
396404 }
@@ -473,43 +481,43 @@ void dequantize_gemv_run(int iter) {
473481 {// epilogue_args init list
474482 // It accepts the base pointer to matrix D, and its dimensions
475483 {bias_d, bias_add_shape}});
476- typename gemm_op_t ::template arguments_t <compute_policy::quant_mode> gemm_arg;
484+ using gemm_arg_t =
485+ typename gemm_op_t ::template arguments_t <compute_policy::quant_mode>;
486+ gemm_arg_t gemm_arg;
477487 if constexpr (compute_policy::quant_mode == quant_mode::S4_FULLRANGE_NO_ZP ) {
478- gemm_arg =
479- typename gemm_op_t ::template arguments_t <compute_policy::quant_mode>(
480- matrix_m,
481- matrix_k,
482- matrix_n,
483- A_d,
484- lda,
485- B_d,
486- ldb,
487- C_d,
488- ldc,
489- scale_d,
490- ld_scale,
491- Acc_d,
492- Cnt_d,
493- epilogue_args);
488+ gemm_arg = gemm_arg_t (
489+ matrix_m,
490+ matrix_k,
491+ matrix_n,
492+ A_d,
493+ lda,
494+ B_d,
495+ ldb,
496+ C_d,
497+ ldc,
498+ scale_d,
499+ ld_scale,
500+ Acc_d,
501+ Cnt_d,
502+ epilogue_args);
494503 } else if constexpr (compute_policy::quant_mode == quant_mode::S4_ASYM ) {
495- gemm_arg =
496- typename gemm_op_t ::template arguments_t <compute_policy::quant_mode>(
497- matrix_m,
498- matrix_k,
499- matrix_n,
500- A_d,
501- lda,
502- B_d,
503- ldb,
504- C_d,
505- ldc,
506- scale_d,
507- ld_scale,
508- zero_pt_d,
509- ld_zero_pt,
510- Acc_d,
511- Cnt_d,
512- epilogue_args);
504+ gemm_arg = gemm_arg_t (
505+ matrix_m,
506+ matrix_k,
507+ matrix_n,
508+ A_d,
509+ lda,
510+ B_d,
511+ ldb,
512+ C_d,
513+ ldc,
514+ scale_d,
515+ ld_scale,
516+ zero_pt_d,
517+ ld_zero_pt,
518+ Acc_d,
519+ Cnt_d,
520+ epilogue_args);
513521 }
514522 cl::sycl::nd_range<3 > nd_range = gemm_op_t::get_nd_range (gemm_arg);
515523 // if (!gemm_op_t::can_implement(gemm_arg)) {
0 commit comments