[AMD] [GLM-5.3-Flash Day 0] Enable zero-RoPE TileLang DSA on gfx950 - #37653
Closed
Raiden-Makoto wants to merge 1 commit into
Closed
Raiden-Makoto wants to merge 1 commit into
Raiden-Makoto wants to merge 1 commit into
Conversation
Raiden-Makoto
requested review from
BBuf,
DarkSharpness,
HaiShaw,
HydraQYH,
Ying1123,
alphabetc1,
celve,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann,
yizhang2077 and
yuan-luo
as code owners
September 2, 2026 20:30
Compile out zero-width tail work and generalize FP8 TileLang/cache layouts so GLM's 256+0 geometry is covered without changing the existing 512+64 path.
Raiden-Makoto
force-pushed
the
RM/glm53-rocm-tilelang-zero-rope
branch
from
September 4, 2026 18:08
98f81b4 to
a437ca4
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.
Summary
GLM-5.3-Flash sparse DSA uses a 256-wide NoPE latent with a zero-width RoPE tail. The HIP TileLang BF16 partial kernel still emits zero-extent tail allocation/copy/gather/GEMM work, while the HIP FP8 kernel and scaled cache helpers are specialized for the existing DeepSeek-style 512+64 layout.
This PR enables GLM's 256+0 geometry without changing the established 512+64 behavior.
d_v=512)d_v=256and retains four ford_v=512512 FP8 + 16 scale + 128 RoPE)256 FP8 + 8 scale + 0 RoPE)Scope
Four production files:
tilelang_kernel.py: compile out HIP BF16 zero-tail work and specialize the HIP FP8 kernel for either 256+0 or 512+64.quant_k_cache.py: infer or accept the NoPE width, derive the number of 128-element scale tiles, and permit an empty RoPE tensor.dequant_k_cache.py: recognize 264-byte and 656-byte packed rows and use their derived dimensions in direct, paged, and gather/dequant/requant paths.memory_pool.py: document the dimension-derived scaled layout and optional RoPE payload at the existing write sites.One MI35x test file directly covers the TileLang kernels and scaled cache helpers. No model loading, server launch, accuracy benchmark, scheduler/backend policy, dense MHA path, mHC path, MoE path, or CUDA TileLang FP8 behavior is changed.
The FP8 kernel keeps the existing 512+64 allocation, GEMM, accumulation, normalization, and store order. The 256+0 specialization emits only the first two 128-wide tiles and no tail operations.
Test plan
Docker:
rocm/sgl-dev:v0.5.18-rocm720-mi35x-20260830.Hardware: one MI350X (
gfx950).Base:
xinyuan/glm-5.3-flash-support@545bd6f839.The same new test file was run in both arms; the four production files are the only variables.
Direct GLM geometry coverage:
[tokens, 64, 256], KV[slots, 1, 256], output BF16[tokens, 64, 256];-1to 2112;256+0) and 656-byte (512+64) scaled-cache round trips and repeated-page gathers;register_amd_ci(suite="stage-b-test-1-gpu-small-amd-mi35x")python/sglang/jit_kernel/tests/test_triton_store_cache_local.py.CI States
Latest PR Test (Base): 🚫 Run #33904283151
Latest PR Test (Extra): ❌ Run #33904282808
Latest PR Test (AMD ROCm 7.2): ❌ Run #33904283075