Skip to content

Commit 022992f

Browse files
EvadLeeGarlGuo
andauthored
fix: thread dim calculation in prefetch gather index (#27)
Co-authored-by: Wentao Guo <47335620+GarlGuo@users.noreply.github.com>
1 parent 63c2218 commit 022992f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sonicmoe/functional/grouped_gemm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,10 @@ def prefetch_gather_idx_for_A_when_vary_M(
470470
threads_per_stride_1_dim = const_expr(stride_1_tile // copy_elems_per_thr_load)
471471
num_other_dim_per_load = const_expr(self.num_load_A_threads // threads_per_stride_1_dim)
472472

473+
num_other_dim_per_thread = const_expr(other_tile // num_other_dim_per_load)
473474
tmAIdx = cute.make_rmem_tensor((num_other_dim_per_load,), dtype=mAIdx.element_type)
474475

475-
for i in cutlass.range_constexpr(num_other_dim_per_load):
476+
for i in cutlass.range_constexpr(num_other_dim_per_thread):
476477
other_dim_offset = const_expr(i * num_other_dim_per_load) + tidx // threads_per_stride_1_dim
477478

478479
if other_dim_offset < M_boundary:

0 commit comments

Comments
 (0)