[cute] Omit redundant persistent shared loop - #3294
Draft
yushangdi wants to merge 1 commit into
Draft
Conversation
yushangdi
added a commit
that referenced
this pull request
Aug 6, 2026
Remove the redundant CTA-wide persistent shared loop from validated, fully role-local `tcgen05` kernels with `cluster_m=1`. In these kernels, the TMA-load, MMA-execute, and epilogue roles already own independent persistent scheduler loops. The residual shared loop only repeated tile-coordinate setup, placeholder assignments, scheduler advancement, and CTA barriers; it performed no useful computation or stores. The existing omission condition now also recognizes `use_validated_cluster_m1_role_local_body`. Omission remains limited to a single-root kernel with all three role-local bodies. Codegen fails closed if the residual shared body contains observable work or defines a value consumed by post-loop cleanup. stack-info: PR: #3294, branch: yushangdi/stack/88
yushangdi
force-pushed
the
yushangdi/stack/88
branch
from
August 6, 2026 01:17
737301a to
f065531
Compare
Contributor
Author
|
Largest affected gains:
Before: After: |
yushangdi
added a commit
that referenced
this pull request
Aug 6, 2026
Remove the redundant CTA-wide persistent scheduler loop from eligible, fully role-local tcgen05 kernels. The TMA-load, MMA-execute, and epilogue roles already own independent persistent schedulers. After role partitioning, codegen now inspects the actual residual shared body and omits its loop only when it contains no meaningful work: dependency-only or dead coordinate setup, placeholders, and obsolete CTA barriers. The decision is fail-closed. A single-root kernel must have all three role-local bodies, and any unrecognized or observable shared statement keeps the loop. Definitions consumed by post-loop cleanup also keep it. Grouped-static kernels retain their specialized replacement-aware classification. This removes the redundant loop for the pretuned FP8 scale_mm_cute M=64, K=5120, N=5120 configuration while preserving it for the rank-3 RHS group-selection path, whose residual shared body still performs scalar loads and comparisons. Add focused codegen coverage for both cases, residual-work and post-loop dependency tests, and runtime numerical coverage for the affected persistent role-local kernels. stack-info: PR: #3294, branch: yushangdi/stack/88
yushangdi
force-pushed
the
yushangdi/stack/88
branch
from
August 6, 2026 02:08
f065531 to
d94fbae
Compare
Remove the redundant CTA-wide persistent scheduler loop from eligible, fully role-local tcgen05 kernels. The TMA-load, MMA-execute, and epilogue roles already own independent persistent schedulers. After role partitioning, codegen now inspects the actual residual shared body and omits its loop only when it contains no meaningful work: dependency-only or dead coordinate setup, placeholders, and obsolete CTA barriers. The decision is fail-closed. A single-root kernel must have all three role-local bodies, and any unrecognized or observable shared statement keeps the loop. Definitions consumed by post-loop cleanup also keep it. Grouped-static kernels retain their specialized replacement-aware classification. This removes the redundant loop for the pretuned FP8 scale_mm_cute M=64, K=5120, N=5120 configuration while preserving it for the rank-3 RHS group-selection path, whose residual shared body still performs scalar loads and comparisons. Add focused codegen coverage for both cases, residual-work and post-loop dependency tests, and runtime numerical coverage for the affected persistent role-local kernels. stack-info: PR: #3294, branch: yushangdi/stack/88
yushangdi
force-pushed
the
yushangdi/stack/88
branch
from
August 6, 2026 02:12
d94fbae to
8097553
Compare
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.
Remove the redundant CTA-wide persistent scheduler loop from eligible, fully role-local tcgen05 kernels.
The TMA-load, MMA-execute, and epilogue roles already own independent persistent schedulers. After role partitioning, codegen now inspects the actual residual shared body and omits its loop only when it contains no meaningful work: dependency-only or dead coordinate setup, placeholders, and obsolete CTA barriers.
The decision is fail-closed. A single-root kernel must have all three role-local bodies, and any unrecognized or observable shared statement keeps the loop. Definitions consumed by post-loop cleanup also keep it. Grouped-static kernels retain their specialized replacement-aware classification.
This removes the redundant loop for the pretuned FP8 scale_mm_cute M=64, K=5120, N=5120 configuration while preserving it for the rank-3 RHS group-selection path, whose residual shared body still performs scalar loads and comparisons.
Add focused codegen coverage for both cases, residual-work and post-loop dependency tests, and runtime numerical coverage for the affected persistent role-local kernels.