[CuTe] Route forward through typed configs - #2733
Draft
drisspg wants to merge 1 commit into
Draft
Conversation
drisspg
force-pushed
the
drisspg/stack/50
branch
from
July 25, 2026 21:24
b9e2fd0 to
e8ecee8
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 25, 2026 21:24
df17518 to
da31d79
Compare
This was referenced Jul 25, 2026
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 27, 2026 20:05
da31d79 to
c11764a
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 29, 2026 02:40
c11764a to
3d8e4f4
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 29, 2026 03:30
3d8e4f4 to
c01eaba
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 29, 2026 06:37
c01eaba to
ef634f1
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 30, 2026 00:55
104b02e to
ee720f0
Compare
drisspg
force-pushed
the
drisspg/stack/50
branch
2 times, most recently
from
July 30, 2026 00:58
8925826 to
f8f262c
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
2 times, most recently
from
July 30, 2026 01:16
e6a8be0 to
a8bface
Compare
drisspg
force-pushed
the
drisspg/stack/50
branch
from
July 30, 2026 01:16
f8f262c to
5cba024
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 30, 2026 01:37
a8bface to
fcfadd9
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 30, 2026 01:52
fcfadd9 to
615ac6c
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 30, 2026 02:04
615ac6c to
6509ac9
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 30, 2026 02:48
6509ac9 to
7e75b57
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 30, 2026 03:48
7e75b57 to
8893cca
Compare
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 30, 2026 05:16
8893cca to
8acd085
Compare
Make _flash_attn_fwd the single selection, validation, and execution boundary. Explicit FwdConfig values are forced exactly; config=None uses the analytical selector. Replace the inline scheduling policy with host metadata extraction and one resolved config, then key main and SplitKV-combine compilation independently. Make generic SM100 and dedicated HD256 kernels consume the resolved register allocation directly instead of applying hidden kernel-side tables. Also accept validated reusable float32 SplitKV partial-output and LSE storage so callers can keep allocation outside replayed execution. stack-info: PR: #2733, branch: drisspg/stack/51
drisspg
force-pushed
the
drisspg/stack/51
branch
from
July 30, 2026 16:01
8acd085 to
86af3e1
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.
Stacked PRs:
Human Note
Agent Note
Summary
This wires the typed config model into the real forward path without changing the public wrappers.
_flash_attn_fwdbecomes the one place that extracts host metadata, selects or validates one config, and launches it.config=Nonepreserves normal policy selection. Passing an explicitFwdConfigmeans use exactly that config or raise. Generic SM100 and dedicated HD256 consume the resolved named register allocation directly, so kernel code cannot silently replace an explicit choice. SplitKV callers may also provide reusable partial O/LSE workspaces for allocation-free replay.Host-path cost
The SM-count query is now lazy. Only automatic SplitKV needs the target SM count; fixed and explicit split requests store
num_sms=0and skip the environment/device query. The fixed path measured 1.341→0.030 us, while automatic SplitKV still resolves the matching local GPU or explicit cross-compilation target exactly as before.Together with the tuple-backed keys in #2732, constructing selector inputs plus a warm cache hit measured 5.734→1.378 us. This matters to eager and generated Flex runtime wrappers but is intentionally absent from the CUDA-graph kernel measurements in the policy PRs.
A complete warm host-dispatch check used real preallocated CUDA tensors, a hit-only compile cache, and a no-op compiled callable:
“Before” is exact stack head
69285d1c; “after” is60fe2c4c. The benchmark excludes GPU execution and compilation, so it isolates the wrapper work changed by #2732/#2733.Implementation and validation
FwdHeuristicInputsconstruction followed by selection or exact validation.FwdRegisterAllocation; the hidden kernel-side register tables are removed.out_partialandlse_partialbuffers are shape/device/dtype validated and accepted only for a resolved SplitKV config.has_lseis derived from preallocated LSE,return_lse, or autograd requirements, keeping output-only and LSE-producing policy separate.The fuzz-found alignment, static-layout, aux-ABI, fake-SM, and combine-operand corrections live in the base PR rather than obscuring this routing change. At this boundary,
interface.pyis 19 lines smaller than its parent. The standalone boundary passes 47 host config/cache tests, and focused GB300 runtime tests pass for register forcing, SplitKV specialization reuse, CLC, MLA cache identity, and selector metadata. Emitted PTX confirms the resolved register immediates are consumed.