fix: searchsorted right=True for correct expert assignment
This commit is contained in:
@@ -186,7 +186,7 @@ class CuTeDSLMoERunner:
|
||||
total_rows = x_sf.shape[0]
|
||||
row_indices = torch.arange(total_rows, device=x_sf.device)
|
||||
expert_assign = torch.searchsorted(
|
||||
expert_offsets[1:], row_indices, right=False
|
||||
expert_offsets[1:], row_indices, right=True
|
||||
).clamp(max=num_experts - 1)
|
||||
local_row = row_indices - expert_offsets[expert_assign]
|
||||
dst_rows = padded_expert_offsets[expert_assign] + local_row
|
||||
|
||||
Reference in New Issue
Block a user