File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
lightllm/common/fused_moe Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -343,13 +343,13 @@ def grouped_matmul_kernel(
343343 group_id = pid // num_pid_in_group
344344 first_pid_m = group_id * GROUP_SIZE_M
345345 group_size_m = min (num_pid_m - first_pid_m , GROUP_SIZE_M )
346- pid_m = first_pid_m + pid % num_pid_in_group % group_size_m
347- pid_n = (pid % num_pid_in_group ) // group_size_m
348- # in_group_index = pid % num_pid_in_group
349- # back_mark = (in_group_index // group_size_m) % 2
350- # back_mark1 = -1 * (2 * back_mark - 1)
351- # pid_m = first_pid_m + back_mark * (group_size_m - 1) + back_mark1 * (in_group_index % group_size_m)
346+ # pid_m = first_pid_m + pid % num_pid_in_group % group_size_m
352347 # pid_n = (pid % num_pid_in_group) // group_size_m
348+ in_group_index = pid % num_pid_in_group
349+ back_mark = (in_group_index // group_size_m ) % 2
350+ back_mark1 = - 1 * (2 * back_mark - 1 )
351+ pid_m = first_pid_m + back_mark * (group_size_m - 1 ) + back_mark1 * (in_group_index % group_size_m )
352+ pid_n = (pid % num_pid_in_group ) // group_size_m
353353
354354 expert_id = tl .load (mblocks_to_expert_id + pid_m )
355355
You can’t perform that action at this time.
0 commit comments