Repository navigation
[HiCache] Resolve write_back to write_through under buffer_only host memory - #42754
Merged
Merged
Conversation
…memory With --hicache-host-memory-mode buffer_only the host pool is only a staging buffer and every cached page lives in the storage backend, so there is no retained host tier for --hicache-write-policy write_back to defer writes into. Argument resolution rejected the pair at startup, which turned a launch config that carries write_back as its general HiCache policy into a failed launch the moment it switched the host memory mode, even though the only policy buffer-only can run is already determined by the mode. Resolve write_back to write_through under buffer_only through declare_resolution, with an info log naming the rewrite, instead of raising. The rewrite is that narrow: an explicit write_through_selective stays as given, and the cache mode keeps whatever policy it was given. A server-args unit test pins the resolved policy for each write policy under buffer_only and for write_back under cache; the write_back case fails on the previous code with the old ValueError. Co-authored-by: xiezhq-hermann <xiezhq-hermann@users.noreply.github.com>
maocheng23
added a commit
to maocheng23/sglang
that referenced
this pull request
Oct 7, 2026
Picks up sgl-project#42754, whose server-args test the Intel CPU image (built from the PR head) otherwise runs against the pre-sgl-project#42754 HiCache hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cursor Bot
pushed a commit
to cipheraxat/sglang
that referenced
this pull request
Oct 9, 2026
…memory (sgl-project#42754) Co-authored-by: merrymercy <merrymercy@users.noreply.github.com> Co-authored-by: xiezhq-hermann <xiezhq-hermann@users.noreply.github.com>
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
With
--hicache-host-memory-mode buffer_onlythe host pool is only a staging buffer: every cached page lives in the storage backend, so there is no retained host tier for--hicache-write-policy write_backto defer writes into. Argument resolution rejected the pair at startup. That turns a launch config which carrieswrite_backas its general HiCache policy into a failed launch the moment it switches the host memory mode, even though the only policy buffer-only can run is already determined by the mode. The same file already resolves other incompatible HiCache pairs (layout vs. I/O backend, storage backend vs. layout) instead of rejecting them.Modifications
validate_hicache_host_memory_moderesolveswrite_backtowrite_throughunderbuffer_onlythroughdeclare_resolution, with an info log naming the rewrite, instead of raising. The rewrite is that narrow: an explicitwrite_through_selectivestays as given, and thecachemode keeps whatever policy it was given.TestHiCacheArgs.test_buffer_only_resolves_write_back_to_write_throughpins the resolved policy for each write policy underbuffer_onlyand forwrite_backundercache. Thewrite_backcase fails on the previous code with the oldValueError.The HiCache hook already runs before the optimistic-prefill gate in the resolution pipeline, so that gate reads the resolved
write_through. No documentation describes the rejection, so none changes.Ran locally:
test/registered/unit/server_args/test_server_args.py(TestHiCacheArgs),test/registered/unit/server_args/test_resolution_declarations.pyandtest/registered/unit/mem_cache/test_decode_retraction_backup.py, all passing; the pinned pre-commit linters on both files.Accuracy Tests
Not applicable: argument resolution only, no change to model forward or kernels.
Speed Tests and Profiling
Not applicable.
Checklist
CI States
Latest PR Test (Base): 🚫 Run #37452625943⚠️ Not enabled -- add
Latest PR Test (Extra):
run-ci-extralabel to opt in.Latest PR Test (AMD ROCm 10): ❌ Run #37452626037