Repository navigation
[Triton/Gluon] [GFX950] Keep unified-attention block-table stride runtime - #5772
Merged
cagrikymk merged 1 commit intoSep 22, 2026
Conversation
Chunked serving rebuilds padded block tables with changing strides, so storing the stride in `AttentionConfig` creates per-width Gluon binaries during live requests. Pass it as runtime `tl.int32` state through both KV loaders while retaining the cache-layout strides as compile-time constants.
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
block_table_stridefrom compile-timeAttentionConfig.tl.int32state through both gfx950 Gluon KV loaders.constexpr.Root cause
SGLang serving can produce padded block tables with different row strides across batches. The gfx950 Gluon kernel stored
block_table_strideinAttentionConfig, making every new stride part of the JIT compile key.A matched serving profile observed seven Gluon compilations inside the measured request, adding 5.75 seconds of gaps immediately before unified-attention launches even though the compiled Gluon kernels themselves were faster than the Triton kernels.
The stride is bounded by the per-request block-table width, so runtime
tl.int32is sufficient.AsyncKVLoaderandAsyncGatherKVLoadernow receive it as runtime state. The gather loader explicitly narrows its clamped block-table indices togl.int32, as required by the CDNA buffer-load interface.Validation
Changing-stride probe
The same logical page table was invoked with seven padded strides from 60000 through 60511.
tl.int32stride6.11e-5The initial variants are bounded; subsequent changing stride values no longer create a new binary.
Loader coverage
External focused validation exercised changing padded widths through:
AsyncGatherKVLoaderwith block size 1.AsyncKVLoaderwith block size 64.Both paths remained finite and produced identical outputs across the tested widths.
Matched serving profile
The same 60K-input, 128-output, concurrency-4 profile was run before and after the change.
tl.int32strideThis is a 20.4% input-throughput recovery and a 16.9% duration reduction, with no main-run compilation left in the trace.
Test plan
python3 -m py_compile aiter/ops/triton/_gluon_kernels/gfx950/attention/unified_attention.py