Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions csrc/kernels/mla/reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ __launch_bounds__(Traits::kNumThreads, Traits::kOccupancy) __global__
MLA_REDUCE_CASE_EF(NUM_HEAD, 64, HEAD_DIM, 64, NUM_WG_PER_BH, NAME, __VA_ARGS__) \
MLA_REDUCE_CASE_EF(NUM_HEAD, 64, HEAD_DIM, 128, NUM_WG_PER_BH, NAME, __VA_ARGS__) \
MLA_REDUCE_CASE_EF(NUM_HEAD, 64, HEAD_DIM, 512, NUM_WG_PER_BH, NAME, __VA_ARGS__) \
MLA_REDUCE_CASE_EF(NUM_HEAD, 96, HEAD_DIM, 128, NUM_WG_PER_BH, NAME, __VA_ARGS__) \
MLA_REDUCE_CASE_EF(NUM_HEAD, 128, HEAD_DIM, 128, NUM_WG_PER_BH, NAME, __VA_ARGS__) \
MLA_REDUCE_CASE_EF(NUM_HEAD, 128, HEAD_DIM, 512, NUM_WG_PER_BH, NAME, __VA_ARGS__) \
MLA_REDUCE_CASE_EF(NUM_HEAD, 8, HEAD_DIM, 512, NUM_WG_PER_BH, NAME, __VA_ARGS__) \
Expand Down
10 changes: 8 additions & 2 deletions op_tests/test_mla_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,12 @@ def run_case(splits_per_tile, num_heads, head_dim, out_dtype, qo_len=1):
atol=2e-2,
msg=f"[{tag}] lse ",
)
ok = (err_out == 0) and (err_lse == 0)
finite = (
torch.isfinite(gpu_out).all().item() and torch.isfinite(gpu_lse).all().item()
)
if not finite:
print(f"FAIL [{tag}] non-finite kernel output")
ok = finite and (err_out == 0) and (err_lse == 0)
print(f"{'PASS' if ok else 'FAIL'} {tag} {us:>8.2f} us")

# Bytes moved by the reduce: read all partial outputs + partial lses +
Expand Down Expand Up @@ -331,7 +336,8 @@ def main():

# (head_dim -> supported head counts from MLA_REDUCE_ROUTER in reduce.cu)
heads_for_dim = {
128: [1, 16, 128],
# Kimi K3 PP8 uses the 96-head, 128-dimension reducer.
128: [1, 16, 96, 128],
512: [8, 16, 128],
}

Expand Down
Loading