Repository navigation
fix(cutedsl): close synchronization races - #132
Conversation
Signed-off-by: shuyan.ycf <shuyan.ycf@antgroup.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Intra kernel and synchronization cula/ops/kda/sm100/intra_fused.py, cula/ops/kda/sm100/delta_h.py |
The intra kernel now uses 10 MMA warps, a dedicated TMA producer, and four store/inverse warps. It loads FP32 cumulative gates and beta, applies varlen bounds, and initializes persistent scheduling barriers with one elected lane. |
Exact-gate host and port wiring cula/ops/kda/sm100/intra_fused.py, cula/ops/kda/sm100/full_port.py |
The exact-gate path passes beta and Akk outputs directly and removes dummy K1 and gate-fusion arguments. The kernel and wrapper cache is renamed _INTRA_CACHE. |
Legacy path removal and validation benchmarks/bench_kda_sm100_intra_fused.py, benchmarks/stress_kda_sm100_varlen_determinism.py, docs/kda_sm100_cutedsl_fwd_status.md, tests/test_kda_sm100_intra_fused_cutedsl.py, tests/test_cutedsl_mbarrier_init.py |
The raw-gate wrappers and benchmark scripts are removed. Documentation and tests no longer cover the removed entry points or packed-varlen comparison. |
Lightning persistent varlen scheduler
| Layer / File(s) | Summary |
|---|---|
Completion barrier and checks cula/ops/lightning/prefill_sm100.py, tests/test_cutedsl_mbarrier_init.py |
Persistent varlen work-unit boundaries use sched_done_mbar arrivals and a phase-based wait instead of the CTA-wide named barrier. Tests check single-threaded barrier initialization and the absence of the named barrier call. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant TMALoadWarp
participant InputReadyBarrier
participant MMAWarps
participant StoreWarps
TMALoadWarp->>InputReadyBarrier: Signal staged beta and input readiness
InputReadyBarrier->>MMAWarps: Release after TMA data and beta are ready
MMAWarps->>StoreWarps: Provide intra accumulator results
StoreWarps->>StoreWarps: Apply masks and write output rows
sequenceDiagram
participant LoadWarp
participant SchedDoneMbar
participant MMAWarp
participant CUDACoreWarps
participant EpilogueWarp
LoadWarp->>SchedDoneMbar: Wait for work-unit completion
MMAWarp->>SchedDoneMbar: Arrive at work-unit boundary
CUDACoreWarps->>SchedDoneMbar: Arrive at work-unit boundary
EpilogueWarp->>SchedDoneMbar: Arrive at work-unit boundary
SchedDoneMbar->>LoadWarp: Release Load warp to publish next work index
Possibly related PRs
- inclusionAI/cuLA#131: Introduced the SM100 CuTeDSL intra path and raw-gate entry points that this change revises.
Suggested reviewers: cherhh, kevinzeng08
Merge Risk: 
Minimal · up to 043eb
-
This change removes unused raw-gate intra entry points and fixes synchronization races in the SM100 kernels. The review found no concrete defect, and the author reports clean sanitizer and test runs, so it looks ready to merge.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title "fix(cutedsl): close synchronization races" is a short, specific conventional-commit style title. The PR does center on synchronization fixes: single-threaded mbarrier initialization, a Lightning completion mbarrier replacing a CTA-wide barrier, and matching arrival counts. It does not mention the main removal of the raw-gate SM100 intra entry points, which is the largest change by line count. The title is therefore partially related to the changeset: it names a real aspect but not the largest part.
Full details: Description check
-
Explanation
The description follows the template's main sections: Summary, Validation, and a synchronization audit. It gives concrete validation results: GPU test counts, compute-sanitizer racecheck and synccheck results, and pre-commit status. It does not fill the template's 'Related Issues' section, and the pre-commit and test checklist boxes are not ticked. The 'Performance' section is optional and is omitted, which is acceptable. The description is mostly complete. The missing related-issue link is a non-critical gap.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Summary
The removed raw-gate APIs were experimental internal entry points and were not used by the public dispatch.
Validation
Synchronization audit
Summary by CodeRabbit