[AMD] Remove ROCm page_first+kernel -> layer_first HiCache fallback (follow-up to #28534) - #30622
Merged
HaiShaw merged 3 commits intoJul 15, 2026
Conversation
sgl-project#28534 enabled the JIT staged HiCache write-back path on ROCm: can_use_jit / can_use_write_back_jit are now allowed on HIP, and hicache.cuh / staged_write_back.cuh build and run with hipcc. The ROCm layer_first fallback added by sgl-project#28473 in ServerArgs._resolve_layout_io_compatibility() is therefore no longer needed and is now actively harmful -- it rewrites page_first + kernel to layer_first on ROCm before the host pool is created, so ROCm can never reach the now-correct page_first + kernel JIT staged write-back path that sgl-project#28534 added. Remove the fallback so ROCm exercises the same page_first + kernel write-back path as CUDA.
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes the ROCm-specific fallback logic in _resolve_layout_io_compatibility that reverted the memory layout from page_first to layer_first when using the kernel IO backend. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
HaiShaw
approved these changes
Jul 13, 2026
Collaborator
|
/tag-and-rerun-ci |
Collaborator
|
AMD only change |
roopaksrivastav
pushed a commit
to roopaksrivastav/sglang
that referenced
this pull request
Jul 16, 2026
Chronostasys
pushed a commit
to MindLab-Research/sglang
that referenced
this pull request
Aug 24, 2026
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
#28534 enabled the JIT staged HiCache write-back path on ROCm:
can_use_jit/can_use_write_back_jitare now allowed on HIP (not only CUDA) in the MHA/MLA host pools;hicache.cuh/staged_write_back.cuhbuild and run with hipcc (PTX-only helpers guarded byUSE_ROCM, ROCm device-type matchers, vectorized non-temporal load/store).As called out in #28534's description, once that landed, the ROCm
layer_firstfallback added by #28473 inServerArgs._resolve_layout_io_compatibility()should be reverted.What this PR does
Removes the ROCm-only block that rewrites
page_first+kerneltolayer_first:Why it must be removed (not just cleanup)
The block runs at
ServerArgsresolution time, i.e. before the host KV pool is created. On ROCm it forces anypage_first+kernelrequest tolayer_first, so ROCm can never reach thepage_first+kernelJIT staged write-back path that #28534 just made correct. The two are directly contradictory: #28534 says "ROCm can use the JIT staged write-back", while this fallback says "ROCm always downgrades to layer_first". Leaving it in makes #28534's ROCm work dead code.After this change, ROCm exercises the same
page_first+kernelwrite-back path as CUDA (platform parity, retained staged write-back bandwidth), which is what #28534 validated on MI355X (gfx950, ROCm 7.2).Test plan
is_hipimport still used elsewhere inserver_args.py(no dead import); file byte-compiles.test/registered/jit/test_hicache.py,test_hicache_page_first_write_back.py) pass on MI355X (ROCm 7.2) with thepage_first+kernelJIT staged write-back path enabled (validated for [AMD] Enable JIT staged HiCache write-back and fix CPU-index crash #28534).jit-kernel-unit+ HiCache serving suites.--enable-hierarchical-cache --hicache-mem-layout page_first --hicache-io-backend kernellaunch on ROCm no longer silently downgrades tolayer_first.CI States
Latest PR Test (Base): ❌ Run #29231811696
Latest PR Test (Extra): ❌ Run #29231811508