BSA: fix the cute-dsl bulk-copy elect gate for 4.6.2 and 4.7 - #453
Merged
Anerudhan merged 1 commit intoJul 30, 2026
Merged
Conversation
The gate for whether cute.copy elects a lane internally for raw bulk-copy atoms compared only major.minor (>= 4.6), but the internal election shipped only in the 4.6.0 and 4.6.1 releases and was reverted afterwards. On 4.6.2 and 4.7.0a0 the old branch is still taken, so nothing elects: all 32 lanes issue the same cp.async.bulk...complete_tx::bytes for the LSE/dPsum stats copies, the mbarrier transaction is over-completed 32x, and the BSA blk128 backward pipeline wedges on SM100. Match the 4.6.0-4.6.1 release range instead, treating pre-releases (e.g. 4.6.0.dev0) as predating the internal election so they fall through to the "caller elects" path. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe bulk-copy utility now uses strict regex-based Cute DSL version detection, enabling self-election only for non-prerelease versions 4.6.0 and 4.6.1. Its election behavior documentation now describes the effects of selecting the wrong election mode. ChangesBulk-copy election detection
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Anerudhan
marked this pull request as ready for review
July 30, 2026 17:58
This was referenced Jul 31, 2026
Merged
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.
Authored by XiaoDong (@xiaoD, xiaod@nvidia.com) — ported from an internal change; the commit preserves the original authorship.
Fixes BSA blk128 backward hangs on SM100 with cute-dsl 4.6.2 and 4.7.0a0 (passes on 4.6.1).
Affected tests (all the same kernel —
supported_block_size(backward=True)is 128 on SM10x):test_bsa_attention_backward_fixed_blockstest_bsa_attention_backward_blk128_dk_zero_init_accumulate_transition[1]/[4]Under
pytest -n=4 --timeout=300the hang surfaces asworker 'gwN' crashed … node down.Cause
The
elect_one()guard was gated oncutlass.__version__[:2] >= (4, 6), matching a cute-dsl change that made the rawcp.async.bulk.*lowering elect a lane internally. That change has since been reverted on every cute-dsl line (shipped in 4.6.2 and 4.7.0a0), restoring the pre-4.6 contract that the caller elects — see NVIDIA/cutlass#3391.Because the gate only compares major.minor, 4.6.2 and 4.7 still take the "the DSL elects for me" branch. Nothing elects, so all 32 lanes issue the same
cp.async.bulk…complete_tx::bytesfor the LSE/dPsum stats copies.producer_acquiresizedexpect_txfor a single copy, so the barrier is over-completed 32x and the pipeline wedges.Fix
Only 4.6.0 and 4.6.1 ever shipped the internal election. Match that release range instead of
>= 4.6; pre-releases (e.g.4.6.0.dev0) and everything else fall through to "the caller elects".Why not just revert the original gate
On 4.6.0/4.6.1 a caller-side
elect_one()nests with the internal one and deadlocks — that is what the original gate fixed. Both are inside the declared support range (nvidia-cutlass-dsl>=4.5.0), so the gate has to stay; it just has to name the right versions. Measured on B200/SM100a with a full-warpcute.copy(CopyBulkG2SOp, mbar_ptr=…):elect.syncin PTXVerification
Fresh clone + real
pip installper leg, nothing patched in place:fe_api/bsa17 passedfe_api/bsa17 passedfe_api/bsa17 passedFull
fe_apiunder nightly settings: 80 failed / 2179 passed / 1668 skipped, zero hangs; residual failures match the baseline family-for-family (gemm_swiglu64,sdpa_bwd12,dsa4) with only the 3 BSA ones removed.🤖 Generated with Claude Code
Summary by CodeRabbit