Repository navigation
Conversation
YAMY1234
left a comment
There was a problem hiding this comment.
Thanks for putting this together. Rotating the owner per layer is a real improvement over the rank-0-only dedup: it spreads D2H/H2D traffic across ranks and still gives ~tp_size x unique host capacity. A few things I'd like to see addressed before this moves out of draft (inline comments below).
Tests. The multi-process simulations from the description aren't in the PR. Could you add unit cases for owner rotation, shard layer mapping and host capacity sizing to the existing test_mla_host_dedup_primitives.py, plus the end-to-end accuracy run (GSM8K with forced eviction/load-back) on the combined branch?
b9e28fd to
7e939a8
Compare
…oject#36800 primitives Every attention-TP rank holds the same MLA latent KV (and DSA index keys), so HiCache backs up, stores and loads back the same bytes on every rank. --enable-mla-hicache-host-dedup feeds the existing enabled= switch of maybe_create_mla_host_dedup_context, so the HiCache L2 tier uses the sgl-project#36800 primitives, with each layer's host copy owned by one rank in turn rather than all by one source rank: - Primitives: MLAHostDedupBroadcaster(rotate_owners=True) broadcasts layer slot s (each KV layer, then each layer holding index keys) from dedup rank s % size; _bcast_layer takes the per-layer owner as its group_src. Without rotate_owners every path keeps its single-source behavior, and build() forwards constructor arguments, so the Mooncake linker adapter is unchanged. Shared-top-k index layers (0-row placeholders) are skipped, and the index-key staging is sized in pages, its row unit. - Backup (D2H): the MLA host pool takes dedup_rank/dedup_size and reuses its layer-ownership hooks (_is_device_layer_owned, _host_layer_index) to store only its own layers; packed MTP draft layers stay on every rank. Token capacity is sized by the largest share, so every rank holds the same tokens and the radix tree stays replicated. The DSA indexer host pool keeps only its own index layers. - Load-back (H2D): a rank loads only its own layers. The forward broadcasts each layer from its owner through the HiCache layer-wait hook (LayerDoneCounter.on_layer_ready, as on the Mooncake linker's counter), on the forward stream right after its wait for that layer's H2D copy. Each layer is broadcast once, in layer order, at the same point of the forward on every rank, so later layers keep loading while earlier ones compute. The load's ack event is recorded again after the last broadcast, so the ack and the allocator's transfer fence cover the broadcasts. - DP attention: owners and the broadcast group follow the attention-TP group through the existing mla_dedup_rank_and_size and build(). handle_hicache rejects the flag unless the L2 tier is direct I/O with page_first_direct on one node and PP stage, without a storage backend, hisparse, attention CP/DCP or PD decode; a runtime storage attach is rejected too. Off by default: no context or group is created and every path is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7e939a8 to
0f57381
Compare
|
Current code LGTM! Could you add accuracy and performance comparison data in the PR description? Thanks @nbommi19 |
|
/tag-and-rerun-ci |
nvpohanh
left a comment
There was a problem hiding this comment.
[by Claude Code] Severity: style | Confidence: High
Issue
The Accuracy and Performance sections give results and describe the setup in prose, but someone else cannot rerun them. The description does not include:
- the GPU type (it says only "one 8-GPU node");
- the full server launch commands for the control and dedup arms, including the
--hicache-size/--hicache-ratiovalues and the EAGLE flags; - the benchmark command, the source of the agentic-coding trace, and how the fixed synthetic acceptance length was set;
- the GSM8K command, and the flag that capped the device KV pool at 131,072 tokens.
Fix
Please add these commands and the GPU type to the description.
| ], | ||
| ), | ||
| ] = "page_first" | ||
| enable_mla_hicache_host_dedup: A[ |
There was a problem hiding this comment.
[by Claude Code] Severity: functional | Confidence: High
Issue
This adds --enable-mla-hicache-host-dedup, but docs/docs/advanced_features/server_arguments.mdx has no row for it, and the flag is not in server_arguments_undocumented.txt. So test_server_args_docs_coverage.py::test_no_new_undocumented_flags fails at the head commit. It fails locally, and it fails in CI job base-a-test-cpu (4) (https://github.com/sgl-project/sglang/actions/runs/38349327312/job/115620190596), which blocks the later CI stages.
Fix
Add a row for the flag to server_arguments.mdx, next to --hicache-mem-layout, and reuse this help text. Do not add it to the allow list, because that list may only shrink.
There was a problem hiding this comment.
Added the row next to --hicache-mem-layout, reusing the help text, in cf4301d. test_server_args_docs_coverage.py passes locally (4/4).
| torch.distributed.destroy_process_group() | ||
|
|
||
|
|
||
| class TestMLAHostDedupRotatingOwners(unittest.TestCase): |
There was a problem hiding this comment.
[by Claude Code] Severity: style | Confidence: Medium
Issue
The new tests run on CPU with mocks or gloo. No test launches a server with --enable-mla-hicache-host-dedup, so CI never runs the real path: HiCacheController.start_loading calling start_load, the LayerDoneCounter.wait_until hook, the NCCL group_src broadcasts, and the owned-layer page_first_direct copies. If a later change reads KV without calling wait_until, each rank reads stale KV for every layer it does not own, and no test fails.
Fix
Add a TP2 MLA case like TestHiCacheStoragePageFirstDirectIO in test/registered/hicache/test_hicache_storage_file_backend.py, but without a storage backend. Use a small device pool so prompts are evicted and loaded back, then check GSM8K accuracy on a second pass.
There was a problem hiding this comment.
Added test/registered/hicache/test_hicache_mla_host_dedup.py in cf4301d.
- Server: a TP2 MLA server (
DEFAULT_MLA_MODEL_NAME_FOR_TEST) with direct I/O,page_first_direct,write_backand--max-total-tokens 16384, so GSM8K prompts are evicted to host and loaded back. - Checks: it runs GSM8K twice and asserts that
sglang:load_back_tokens_totalgrew during the second pass, so the owner broadcast really ran. Both passes must stay above 0.6 and within 0.05 of each other. - CI: registered for 2-GPU CI (
base-b,2-gpu-large). There are no GPUs where I prepared it, so CI is its first run.
…to-end test Add the flag's row to server_arguments.mdx, next to --hicache-mem-layout, as test_server_args_docs_coverage requires. Add test_hicache_mla_host_dedup.py: a TP2 MLA server with direct I/O, page_first_direct, write-back and a small device pool, so GSM8K prompts are evicted to the host tier and the second pass loads them back through the owner broadcast. It checks that load-back happened (sglang:load_back_tokens_total) and that accuracy holds across both passes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
/rerun-failed-ci |
1 similar comment
|
/rerun-failed-ci |
* feat(hicache): keep one MLA KV host copy per node MLA latent KV is identical on every TP rank, but each rank kept its own HiCache host copy and read it from L3 on its own, so a 4-GPU node held and fetched 4 copies of the same data. With --enable-mla-hicache-per-node, only the first rank on each node (leader) keeps a real MLA host pool and loads from L3; the other local ranks use the allocator-only host pool from sgl-project#36800. During the forward, the per-layer HiCache wait hook (as in sgl-project#42009) broadcasts each loaded MLA layer from the leader to the local GPUs over NCCL/NVLink, so the broadcast overlaps with compute. KDA/Mamba state, L3 keys and L3 layout are unchanged, so existing L3 data stays valid. The leader's host pool and budget are sized for the whole node; all ranks size the allocator the same so the radix tree stays consistent. PD decode, DCP, FP4 MLA and single-rank nodes fall back to per-rank copies with a warning. The flag is off by default. Co-Authored-By: Claude <[email protected]> * fix(hicache): fix three node-leader MLA dedup bugs Three bugs in the --enable-mla-hicache-per-node path. 1. Chunked-prefix prefill read prefix KV before the leader's broadcast A follower's device KV comes only from the leader's broadcast, and that broadcast is sent from the layer-wait hook (LayerDoneCounter.wait_until). The trtllm_mla eager prefill takes MHA_CHUNKED_KV and reads prefix KV through HybridLinearKVPool.get_mla_kv_buffer, which, unlike the other reads on that pool, did not wait. The inner MLA pool does not wait either: the hybrid pool clears its counter to None. So a follower read stale rows for that layer and gave wrong output with no error. get_mla_kv_buffer now waits on the model layer id before swapping in the compact id, as get_key_buffer does. This also fixes the same missing wait on H2D for the non-dedup path. 2. Explicit --hicache-ratio/--hicache-size could pin past host memory Followers build an allocator-only MLA pool with no memory check and go straight on to the Mamba host pool, whose check reads live free memory while the leader is still pinning. With an explicit size there is no budget snapshot, so an oversized config could fail while pinning (or be killed) instead of with "Not enough host memory available". Every rank now waits on a gloo barrier over the TP CPU group before the Mamba pool is built. Followers block until all leaders have pinned, so the check sees real free memory. Gloo, not NCCL, since pinning can outlast the NCCL watchdog. No new process group. 3. GB200/GB300: the leader's pool was sized for two Graces A tray has two Graces, each its own NUMA node, and the scheduler is membind-ed to its GPU's node. The leader's budget is the whole tray's free memory, but it can only pin from one Grace, so the default auto-sized pool asked for about twice what that node can give. auto_size_hicache halves the per-rank budget when the flag is on and is_mnnvl_fabric_device() is true; the MIN all-reduce keeps every rank's ratio equal. Limits: Mamba host capacity is halved too, and an explicit ratio/size is not covered. Not run: no GPU available, only checked with py_compile. Co-Authored-By: Claude <[email protected]> * fix(hicache): interleave the MLA leader's host pool over its NUMA nodes The previous commit fixed GB200/GB300 by halving the auto-size budget. That was wrong in two ways: - auto_size_hicache overrides the global hicache_ratio, and the Mamba host pool reads the same value (MambaPoolHost in build_hybrid_mamba_stack), so Mamba host capacity was halved too. - An explicit --hicache-ratio/--hicache-size never reaches auto_size_hicache, so the leader still pinned the whole tray's share on one Grace. The real constraint is per NUMA node, not per host. With the same ratio, the tray's total is unchanged by this feature; what changed is that the leader, membind-ed to its GPU's node, pins every follower's share there. A GB300 tray has two Graces, each its own node, so the leader's node took twice its share. Spread the leader's MLA host pool over the nodes its ranks are bound to instead: - build_for_node all-gathers each rank's NUMA node and cpuset-allowed nodes over the TP CPU group. The node comes from get_numa_node_if_available, the same query the launcher binds with. - leader_host_shares derives the multiplier from that layout, not a constant. If the group spans several nodes, every rank is bound and the leader may allocate on all of them, the pool is interleaved over them and the multiplier is (fewest ranks on a node) x (node count): 2 x 2 = 4 on a GB300 tray. Even interleave puts the same amount on every node, so this keeps each node at or below its own ranks' share. A group on one node, or with NUMA binding off, keeps the group size and is not interleaved. If the leader cannot reach every node, or binding is mixed, it falls back to the ranks on its own node. The minimum over all groups is used so every rank sizes its allocator the same. - numa_utils.interleave_memory sets MPOL_INTERLEAVE on the calling thread for the leader's pool build only, then restores the previous policy, mode flags included. It must wrap the allocation: the HiCache mmap is pre-faulted, so mbind afterwards would not move the pages. It raises if the policy cannot be set, since the pool was sized for it. - leader_budget_scope uses the same multiplier and enters the interleave scope. With the same ratio, no NUMA node holds more host memory than without the flag. Mamba is unchanged, explicit ratio/size and auto-sizing are both covered, and KV cache capacity stays 4x on GB300. L3 reads stay at one per tray. Trade-off: the leader's H2D now reads half its pages from the other node (Grace-Grace link on GB300, the socket link on dual-socket x86). Dual-socket x86 hosts with binding on are interleaved too, with the multiplier going from 4 to 8. Neither link's bandwidth was measured. Not checked: whether the Mooncake/UMBP host allocators fault pages in this process, which the policy needs. The halving in hicache_auto_size.py is reverted. Not run: no GPU available, only checked with py_compile; the multiplier and nodemask logic were checked on GB300, single-NUMA, dual-socket, uneven and restricted-cpuset layouts in isolation. Co-Authored-By: Claude <[email protected]> * feat(hicache): add shm mode for per-node MLA host copy --enable-mla-hicache-per-node keeps one MLA KV HiCache host copy per node. SGLANG_MLA_HICACHE_PER_NODE_MODE now selects how followers get the KV: - broadcast (default): unchanged #72 behaviour. Followers keep an allocator-only host pool and the leader broadcasts each loaded layer over NCCL from the layer-wait hook. - shm: the leader allocates the MLA host pool in a memfd (interleaved over the node's NUMA nodes by the existing leader_budget_scope) and sends the fd to same-host followers over an abstract Unix socket (SCM_RIGHTS). Every rank maps and pins the same pages and does its own H2D, so the forward path is the same as without the flag. In both modes only the leader writes the shared copy: followers skip the anchor D2H, use a page-get stub for L3 prefetch (the leader's count wins through the existing all_reduce(MIN)), and do not register the buffer with Mooncake. shm rejects --hicache-write-policy write_back at startup and on attach-storage: write-back eviction syncs locally, so a follower could load shared pages before the leader's D2H into them lands. Also adds benchmark/hicache/bench_h2d_numa.py, which compares HiCache-style page-gather H2D from one interleaved shared buffer against per-GPU private local buffers, one process per GPU. Not run: no GPU here; checked with py_compile, ruff and isort only. * fix(hicache): tighten per-node MLA host sharing Reject pipeline parallelism for per-node MLA HiCache and check mode agreement on the WORLD CPU group before entering mode-specific collectives. Close shared-buffer descriptors and bootstrap sockets on success and failure. Derive the controller's follower role from the MLA host pool, skip unused follower D2H staging, and avoid follower MLA existence queries while retaining rank-sharded Mamba checks. Add focused regression coverage, including cold/preloaded module identity handling in the Mooncake fixtures. Validation: Python compilation, formatting/import-order checks, no new Ruff diagnostics, and isolated before/after source probes. Registered tests could not collect because torch/msgspec are unavailable; GPU/distributed/Mooncake integration remains untested. * fix(hicache): bound the shm fd wait and guard one-shot setup Three gaps in the per-node MLA HiCache startup path: - A follower waited for the leader's shared host buffer with no timeout, so a stuck leader hung it forever. The wait now uses --dist-timeout, or 120 minutes (the gloo group default) when it is unset, and raises a RuntimeError that points at the leader's log. - NodeSharedHostTensorAllocator closes its sockets after the first exchange, so a second allocate() raised IndexError on a follower and returned an unshared buffer on the leader. It now rejects a second call explicitly. - In broadcast mode, the one-rank-per-node early return leaked the NCCL group it had just created. Every rank takes that return together, so each now destroys its own handle before returning. Adds unit tests for all three. Not run: torch is unavailable locally; checked with py_compile only. Co-Authored-By: Claude <[email protected]> * refactor(hicache): rework per-node MLA host sharing setup Share one initialization path between broadcast and shm, replace the socket handoff, fix L3 configuration at startup, and trim the feature to its contracts. - Both modes: the leader sizes a memfd without prefaulting it, followers reopen it via /proc/<pid>/fd/<fd>, each rank prefaults a contiguous page-aligned share with MADV_POPULATE_WRITE, and no rank registers before every share is populated. Broadcast followers then drop the mapping and keep dummy slot metadata. The leader's FD stays open until that fence; open and mapped-size failures abort every rank. - Leave NUMA placement to deployment: remove the leader interleave, the NUMA benchmark and their helpers. - With the flag on, reject runtime L3 attach/detach and policy updates. Reject at startup Mooncake standalone_storage, PD decode, DCP, stacks other than hybrid MLA + Mamba/KDA, and non-CUDA or FP4 MLA pools. - Replace SGLANG_MLA_HICACHE_PER_NODE_MODE with --mla-hicache-per-node-mode {broadcast,shm}; drop the WORLD mode agreement. - NodeSharedHostTensorAllocator takes this node's ranks and the cache group and derives its index, size and leader. - Make host-pool parameters explicit and keep allocation fences in the assembler. - Cover the hybrid MLA read waiting on its layer load. - Trim tests to contract-level guards and comments to unstated contracts. --------- Co-authored-by: yifei she <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Nozom1ff <[email protected]> Co-authored-by: Zhengbo Wang <[email protected]>
Re-apply MLA host dedup onto the buffer-info MLA host pool (sgl-project#40917): the pool keeps the owned target layers by filtering its MLABufferInfo, so the existing per-layer slot maps, owned-layer load skip and all-layer backup carry the rotation. Append the flag's positional slot after main's fields (sgl-project#44991), and keep the dedup storage-attach guard next to the DCP L3 checks (sgl-project#41187). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
[by Claude Code] I've started babysitting the NVIDIA CI of this PR. I'll check it every 30 minutes until all NV pipelines pass. If a relevant job fails, I may rerun it, merge the latest Anyone can stop me at any time: just post a comment asking me to stop (for example, |
|
[by Claude Code] @nbommi19, the relevant CI failure appears to be caused by this PR: https://github.com/sgl-project/sglang/actions/runs/40470954044/job/122082501569. Four |
…llers Unit tests that build HiCacheController without __init__ (test_hicache_file_lru_unit, test_hicache_storage_registration_hook, test_hicache_dcp_host_pool) failed with AttributeError on the new mla_dedup checks in attach_storage_backend and start_loading. Add a class-level None default, and give the SimpleNamespace stub in test_sharded_dsa_hicache the same attribute. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
[by Claude Code] @nbommi19, following up on my comment above: I pushed 79ebb5a to fix that CI failure. It adds a class-level |
|
[by Claude Code] I've started babysitting the NVIDIA CI of this PR. I'll check it every 30 minutes until all NV pipelines pass. If a relevant job fails, I may rerun it, merge the latest Anyone can stop me at any time: just post a comment asking me to stop (for example, |
|
/rerun-failed-ci |
test_hicache_nixl_storage.py::TestNixlUnified::test_dsa_indexer_bounce_round_trip_preserves_every_byte builds DSAIndexerPoolHost with a SimpleNamespace anchor host. This PR makes DSAIndexerPoolHost read anchor_host.dedup_size (MLATokenToKVPoolHost defaults it to 1), so the stub now needs the same field to take the non-dedup path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
[by Claude Code] @nbommi19, I pushed 689829d to fix the relevant CI failure https://github.com/sgl-project/sglang/actions/runs/40478066424/job/122115983374 with a small test-only change: |
|
/rerun-failed-ci |
|
[by Claude Code] @nbommi19, the relevant CI failure appears to be caused by this PR: https://github.com/sgl-project/sglang/actions/runs/40487266050/job/122238057509. The PR's new e2e test |
MLA latent KV is identical on every TP rank, but each rank kept its own HiCache host copy and read it from L3 on its own, so a 4-GPU node held and fetched 4 copies of the same data. With --enable-mla-hicache-per-node, only the first rank on each node (leader) keeps a real MLA host pool and loads from L3; the other local ranks use the allocator-only host pool from sgl-project#36800. During the forward, the per-layer HiCache wait hook (as in sgl-project#42009) broadcasts each loaded MLA layer from the leader to the local GPUs over NCCL/NVLink, so the broadcast overlaps with compute. KDA/Mamba state, L3 keys and L3 layout are unchanged, so existing L3 data stays valid. The leader's host pool and budget are sized for the whole node; all ranks size the allocator the same so the radix tree stays consistent. PD decode, DCP, FP4 MLA and single-rank nodes fall back to per-rank copies with a warning. The flag is off by default. Co-Authored-By: Claude <[email protected]>
MLA latent KV is identical on every TP rank, but each rank kept its own HiCache host copy and read it from L3 on its own, so a 4-GPU node held and fetched 4 copies of the same data. With --enable-mla-hicache-per-node, only the first rank on each node (leader) keeps a real MLA host pool and loads from L3; the other local ranks use the allocator-only host pool from sgl-project#36800. During the forward, the per-layer HiCache wait hook (as in sgl-project#42009) broadcasts each loaded MLA layer from the leader to the local GPUs over NCCL/NVLink, so the broadcast overlaps with compute. KDA/Mamba state, L3 keys and L3 layout are unchanged, so existing L3 data stays valid. The leader's host pool and budget are sized for the whole node; all ranks size the allocator the same so the radix tree stays consistent. PD decode, DCP, FP4 MLA and single-rank nodes fall back to per-rank copies with a warning. The flag is off by default. Co-Authored-By: Claude <[email protected]>
Resolve conflicts in: - python/sglang/srt/arg_groups/field_order.py - python/sglang/srt/managers/cache_controller.py - python/sglang/srt/mem_cache/hybrid_cache/hybrid_cache_controller.py - python/sglang/srt/mem_cache/hybrid_cache/hybrid_pool_assembler.py - python/sglang/srt/mem_cache/pool_host/dsa.py - python/sglang/srt/mem_cache/pool_host/mla.py - test/registered/unit/mem_cache/test_hybrid_pool_assembler.py - test/registered/unit/mem_cache/test_mla_host_dedup_primitives.py - test/registered/unit/server_args/test_server_args.py Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve conflicts in: - python/sglang/srt/arg_groups/field_order.py Keep main parameter order and append the opt-in MLA host dedup field. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Motivation
Every attention-TP rank holds the same MLA latent KV and DSA index keys. As a result, HiCache backs up, stores and loads back the same bytes on every rank, and stores each token once per rank. #36800 landed the dedup primitives, but nothing in HiCache uses them yet; today only the Mooncake linker does. #26691 (closed) used a single source rank, which then carried every host copy and every broadcast.
What is reused
maybe_create_mla_host_dedup_context(..., enabled=),MLAHostDedupContextmla_host_dedup_eligible,mla_dedup_rank_and_sizeMLAHostDedupBroadcaster.build(group fromattn_tp_group; warm-up unchanged)_bcast_layer,broadcast_loaded_layer,prepare_broadcastlayer % size == rank); the DSA indexer pool's compact_live_target_layersLayerDoneCountergets the sameon_layer_readycallback as the Mooncake linker's counterhandle_hicache, next to the--enable-linker-mla-dedupcheckWhat is new
MLAHostDedupBroadcaster(rotate_owners=True)broadcasts layer slots(each KV layer, then each layer that holds index keys) from dedup ranks % size, usinggroup_src.build()forwards constructor arguments, and the Mooncake linker passes none, so its behavior is unchanged.mainraises inindex_select. The index-key staging buffer is sized in pages, its row unit.MLATokenToKVPoolHost(dedup_rank=, dedup_size=)stores KV layersrank,rank + size, and so on. Token capacity is sized by the largest share, so every rank holds the same tokens. Packed MTP draft layers stay on every rank. The DSA indexer pool keeps its share of the index layers.--enable-mla-hicache-host-dedup.handle_hicacherejects it unless the L2 tier uses direct I/O withpage_first_direct, on one node and one PP stage, with no storage backend, hisparse, attention CP/DCP or PD decode. Attaching a storage backend at runtime is rejected too.Off by default: with the flag unset, no context or group is created and every path is unchanged.
Accuracy and performance
All GPU numbers below were measured on this PR's head (
0f5738164e), applied to the SGLang nightly at7224fce1. Every arm uses the same build; the control simply leaves the flag off.Setup
write_back, direct I/O,page_first_direct.mem-fraction-static0.92; max running requests = 2 × concurrency.Performance
Reading the table:
mainkeeps index keys for all 78 layers on host, although only 21 have their own; that is 13.6% of broadcast bytes. Index-K elision under HiCache ([Perf] Elide redundant DSA index-K storage with HiCache L2 #41057) would remove it.Accuracy (GSM8K 5-shot, stress)
The device KV pool was capped at 131,072 tokens. Pass 1 runs at concurrency 32. Pass 2 runs at concurrency 64 and reloads 96.5% of prompt tokens from host: 1,287,488 tokens loaded back on every rank with dedup on.
Per-document McNemar, off vs on: p ≥ 0.61 for every pass and filter.
Engagement
Unit tests in
test_mla_host_dedup_primitives.py:With the flag off, the existing host-pool, assembler, write-back and server-args suites give the same results as
main.Reproduction
Hardware and image
lmsysorg/sglang:nightly-dev-cu13-20261013-7224fce1(sha256:20d36eeb32df0418a165641b51399fd4dc5239dad57f9b8d1f9974c4c9263ca6), with this PR applied.Server. Dedup-on arm at concurrency 32; the control arm drops
--enable-mla-hicache-host-dedup.Other arms
--hicache-size 38.--max-running-requests 32 --cuda-graph-max-bs-decode 32.The three
SGLANG_SIMULATE_ACC_*variables fix the speculative acceptance length for the throughput runs, following the AgentX synthetic-acceptance rule. GSM8K runs leave them unset and use real verification.Benchmark. InferenceX AgentX replay,
benchmarks/srt_agentic.shfrom SemiAnalysisAI/InferenceX at1570a54f, with its agentic-coding trace set:AIPERF_EXPERIMENTAL_FAST=1is the shortened replay, which gives the 20-minute window.GSM8K stress. Same server, without the
SGLANG_SIMULATE_ACC_*variables and with--max-total-tokens 131072to cap the device KV pool. Then run InferenceX's eval path, lm-eval GSM8K 5-shot, at concurrency 32 and then 64:MODEL=zai-org/GLM-5.2-FP8 RUN_EVAL=true EVAL_ONLY=true EVAL_CONC="32 64" \ bash benchmarks/srt_agentic.shRelated: #36800, #26691 (closed).
Checklist
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ⊘ Skipped in Run #46985371439 -- its commit has no run-ci approval, or the run predates the labels; a maintainer's⚠️ Run #46985375564
/approve-ciapproves this commit and reruns it, or/rerun-failed-cireruns an approved one.Latest PR Test (Extra): ⊘ Skipped -- add the
run-ci-nv-extralabel to opt in.Latest PR Test (AMD ROCm 10):
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: