Repository navigation
Reuse AITER GDN prefill metadata - #18
Merged
sammysun0711 merged 2 commits intoAug 13, 2026
Merged
Conversation
apinge
requested review from
apinge and
sammysun0711
and
a lite review from Copilot
August 12, 2026 00:25
There was a problem hiding this comment.
Pull request overview
This PR optimizes the HIP/AITER GDN prefill path by building reusable prefill scheduling metadata once per eligible forward pass and reusing it across all GDN layers, reducing repeated synchronization and metadata reconstruction overhead.
Changes:
- Add reusable AITER GDN prefill metadata construction in
GDNAttnBackendand thread it through the extend path. - Update
AiterGDNKernel.extend()to forwardseq_lens_cpu/prefill_metadatato AITER prefill entry points. - Add unit tests to validate metadata construction and propagation into the AITER prefill call.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/registered/attention/test_gdn_aiter_backend.py | Adds unit coverage for reusable prefill metadata construction and verifies propagation into the AITER prefill call. |
| python/sglang/srt/layers/attention/linear/kernels/gdn_aiter.py | Threads optional reusable prefill metadata through the high-level and low-level AITER prefill execution paths. |
| python/sglang/srt/layers/attention/linear/gdn_backend.py | Builds reusable AITER prefill metadata once per eligible extend forward and passes it (plus seq_lens_cpu) into kernel dispatch. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Owner
|
This PR is related to aiter ROCm/aiter#4694 |
Owner
sammysun0711
approved these changes
Aug 13, 2026
sammysun0711
merged commit Aug 13, 2026
d9d0d4d
into
apinge:qwen3_5_v0.5.15_dflash
12 of 17 checks passed
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.


Motivation
AITER GDN prefill supports reusable batch metadata, but SGLang previously rebuilt the same scheduling metadata inside every GDN layer.
This PR builds the metadata once per eligible prefill forward and reuses it across all GDN layers, eliminating repeated device-to-host synchronization and metadata copies.
Modifications
seq_lens_cpuand the metadata through the GDN backend and AITER kernel dispatcher.Accuracy Tests
Full GDN AITER backend unit suite:
28 passedAITER legacy and reusable-metadata paths produced matching output and final state:
rtol=1e-3atol=2e-3No model-level task accuracy regression is expected because this change only reuses scheduling metadata without changing kernel math.
Speed Tests and Profiling
Configuration:
Profiling results:
CatArrayBatchedCopy_contig:4 -> 04 -> 00.001 usacross all TP ranks with a warm allocator25,463 tokens/sChecklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci