fix: missing PDL wait on main_sf_load in sm103 blockscaled GEMM#3279
Open
tianyuxbear wants to merge 1 commit into
Open
fix: missing PDL wait on main_sf_load in sm103 blockscaled GEMM#3279tianyuxbear wants to merge 1 commit into
tianyuxbear wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
main_sf_loadwas the only load-capable warp branch insm103_blockscaled_gemm_tma_warpspecialized.hppwithout a precedingcutlass::arch::wait_on_dependent_grids(). With PDL enabled,collective_mainloop.load_sf(...)issues TMA reads of scale-factor (SF) data before the producer kernel's writes are guaranteed flushed to global memory.wait_on_dependent_grids()above the warp specialization region so it covers all warp branches (includingmain_sf_load), and remove the now-redundant inner waits inmain_ab_load/sched/epi_load. This matches the cleaned-up pattern already insm90_gemm_array_tma_warpspecialized_{pingpong,cooperative}.hpp(1 outer wait, 0 inner).wait_on_dependent_grids()#2962, but in a kernel that wasn't covered by that fix.Why this matters
Observed in TensorRT-LLM on GB300 + DeepSeek-R1 NVFP4 forward (kernel:
DeviceGemmFp4GemmSm103_..._KernelTmaWarpSpecializedBlockScaledSm103). With a diagnostic probe (ld.global.cv.u8reads of the SF buffer inmain_sf_load):main_sf_loadwaitTwo independent runs, 0 poison events across 6.4M probe samples — the race is fully eliminated on the CUTLASS side without any modification to the producer kernel.
Related
wait_on_dependent_grids()#2962 — same class of bug fixed for sm90/sm100 array variants; this PR addresses the sm103 non-array blockscaled variant not covered by that fix.sm100_*_array_tma_warpspecialized*.hppandsm103_blockscaled_gemm_array_tma_warpspecialized.hpp(which still retain redundant inner waits compared to the cleaned sm90 array variants).