You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Synchronize bulk-async reductions before sC reuse in Rubin fused MoE finalize #18335
Add bulk-async group synchronization after the fused MoE finalize block reductions in the Rubin SM107 contiguous grouped GEMM kernel.
Rationale
blk_reduce_bf16, blk_reduce_fp32, and blk_reduce_fp16 issue cp.reduce.async.bulk...bulk_group operations. The current epilogue synchronization does not wait for completion of that bulk-async group. A later reuse of the single-stage sC buffer can overwrite data while a reduction is still reading it.
This follow-up is intentionally separate from the merge-back because the current implementation matches the validated source branch.
Tested on SM107. The race does not reproduce: with fp32 output the kernel passes its reference check deterministically across repeated runs, and inserting cp_async_bulk_commit_group + cp_async_bulk_wait_group(0, read=True) before the epilogue barrier changes nothing. The bf16 mismatches seen in the harness are nondeterministic scatter-add rounding order vs an fp32 reference with atol 0.1 (max diff equals one bf16 ulp at the output magnitude), not corruption. Downgrading this to defensive hardening; no code change planned for the merge-back.
Raising priority: this is very likely the root cause of an order-dependent illegal memory access seen on 4x SM107 against main. Repro: run tests/unittest/_torch/moe/test_moe_backend.py as one process with CUDA_LAUNCH_BLOCKING=1; the fault is raised in test_moe_backend[locality_domain=enabled-e7_k2_h256_i512-seq=1-bf16-CUTEDSL-quant=None] (cute_dsl_bf16_grouped_gemm_finalize_inplace_rubin via launch_partition), then the sticky context error fails everything after it. The same test passes alone. The NVFP4 sibling kernel already got a cp_async_bulk_commit_group/wait_group(0, read=True) pair before its epilogue sync; the BF16 finalize kernel here did not. Reassigning to @peaceh-nv.
Activity
farazkh80 commentedon Aug 28, 2026
Tested on SM107. The race does not reproduce: with fp32 output the kernel passes its reference check deterministically across repeated runs, and inserting cp_async_bulk_commit_group + cp_async_bulk_wait_group(0, read=True) before the epilogue barrier changes nothing. The bf16 mismatches seen in the harness are nondeterministic scatter-add rounding order vs an fp32 reference with atol 0.1 (max diff equals one bf16 ulp at the output magnitude), not corruption. Downgrading this to defensive hardening; no code change planned for the merge-back.
farazkh80 commentedon Sep 17, 2026
Raising priority: this is very likely the root cause of an order-dependent illegal memory access seen on 4x SM107 against
main. Repro: runtests/unittest/_torch/moe/test_moe_backend.pyas one process withCUDA_LAUNCH_BLOCKING=1; the fault is raised intest_moe_backend[locality_domain=enabled-e7_k2_h256_i512-seq=1-bf16-CUTEDSL-quant=None](cute_dsl_bf16_grouped_gemm_finalize_inplace_rubinvialaunch_partition), then the sticky context error fails everything after it. The same test passes alone. The NVFP4 sibling kernel already got acp_async_bulk_commit_group/wait_group(0, read=True)pair before its epilogue sync; the BF16 finalize kernel here did not. Reassigning to @peaceh-nv.