Skip to content

Commit 865a62f

Browse files
committed
save code
1 parent 91afd70 commit 865a62f

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

csrc/xpu_cutlass_fusion.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class gemm_4bit_cutlass_kernel {
252252
const int k_start_idx = crd2idx((*k_tile_iter), make_shape(params.k));
253253
int prefetch_k = k_start_idx;
254254

255-
auto dequant = [&] (int start_lut_id, int k_tile, int k_s){
255+
auto copy_and_dequant = [&] (int start_lut_id, int k_tile, int k_s){
256256
copy(params.tiled_copy_b, tBgB(_,_,_,k_tile), frag_copy_B);
257257
copy(params.tiled_copy_scale, tSgS(_, _, _, (k_start_idx + k_s) * BLK_K/params.group_size), frag_copy_Scale);
258258
copy(params.tiled_copy_a, tAgA(_,_,_,k_tile), frag_copy_A);
@@ -296,6 +296,11 @@ class gemm_4bit_cutlass_kernel {
296296
reinterpret_cast<sycl::vec<dst_compress_type, dst_vec_size>*>(cute::raw_pointer_cast(mma_B.data()))[n * dst_loop_num + l] = reinterpret_cast<sycl::vec<dst_compress_type, dst_vec_size>*>(dst)[l];
297297
}
298298
}
299+
300+
if (prefetch_k < k_tile_count) {
301+
prefetch(tiled_prefetch_a, pAgA(_,_,_,prefetch_k));
302+
prefetch(tiled_prefetch_b, pBgB(_,_,_,prefetch_k));
303+
}
299304
};
300305

301306
CUTLASS_PRAGMA_UNROLL
@@ -311,12 +316,12 @@ class gemm_4bit_cutlass_kernel {
311316
//copy(params.tiled_copy_scale, tSgS(_, _, _, (k_start_idx + k_s) * BLK_K/params.group_size), frag_copy_Scale);
312317
//copy(params.tiled_copy_a, tAgA(_,_,_,k_tile), frag_copy_A);
313318

314-
dequant(start_lut_id, k_tile, k_s);
319+
copy_and_dequant(start_lut_id, k_tile, k_s);
315320

316-
if (prefetch_k < k_tile_count) {
317-
prefetch(tiled_prefetch_a, pAgA(_,_,_,prefetch_k));
318-
prefetch(tiled_prefetch_b, pBgB(_,_,_,prefetch_k));
319-
}
321+
//if (prefetch_k < k_tile_count) {
322+
// prefetch(tiled_prefetch_a, pAgA(_,_,_,prefetch_k));
323+
// prefetch(tiled_prefetch_b, pBgB(_,_,_,prefetch_k));
324+
//}
320325

321326
cute::gemm(tiled_mma, mma_A, mma_B, accumulators);
322327
barrier_wait(3);

0 commit comments

Comments
 (0)