Repository navigation
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
# Conflicts: # python/sglang/srt/managers/scheduler.py
…estore arg validation; skip probes while the prefix cache is unchanged
# Conflicts: # python/sglang/srt/arg_groups/field_order.py
|
/rerun-test test_pp_chunk_by_pending.py test_unified_radix_cache_core.py registered/unit/server_args/test_server_args.py test_server_args_migration.py test_scheduler_held_row_admission.py test_scheduler_running_reqs.py test_prefill_adder.py test_schedule_policy.py |
|
🚀 🚀 |
Port of #48414
Takes the pipeline-parallel prefill chunk sizing from the Kimi-K3.1 Day-0 branch as a model-independent feature behind two new flags, both off by default, with its read-only prefix probe for the Python and the Rust tree cores.
Against the branch:
scheduler_components/pp_chunk_sizer.py(PPChunkSizer) instead ofSchedulermethods;PrefillAdder.grow_chunk_budgetowns the budget change.--chunked-prefill-sizefor any ratio of the two chunk sizes (the branch stopped at the largest power-of-two multiple of the small chunk), and neither rule exceeds the dynamic chunk size when--enable-dynamic-chunkingis on.peek_uncached_tokenslimits the key the way admission does, so it agrees with admission when the page size is above 1.prefix_cache_version, bumped on insert, eviction, load-back, prefetch, reset, and splits on multi-component caches).Summary
A pipeline-parallel prefill batch with few uncached tokens (for example many requests with long cached prefixes) makes too few chunks to keep every stage busy.
--pp-min-chunked-prefill-size N: such a batch uses chunks ofNtokens; the full--chunked-prefill-sizeis used when any pending request has at least that many uncached tokens.--pp-chunk-overhead-tokens T(requires the first flag): the chunk is sized from the total pending uncached tokensUinstead. Starting atN, it grows to the next sizeB(double, capped at the full chunk) whileU * T >= (pp_size - 1) * C * B, and holds through short dips in load.peek_prefix_len, which reads the prefix cache without changing it (no node splits, LRU, lock refs, or hit counts), on both the Python and the Rust tree cores.Changes to existing code
--pp-min-chunked-prefill-sizeis set and--pp-size> 1; a warning says so when the flags are set but the feature cannot act (--pp-size 1, chunked prefill off, or a cache without the probe).--pp-min-chunked-prefill-size< 1,--pp-chunk-overhead-tokens< 1, and the overhead flag without the min flag.Reqgainspp_uncached_hintandpp_uncached_hint_version, reset on retraction.BasePrefixCache.peek_prefix_lenandUnifiedTreeCoreInterface.peek_prefix_lendefault to None (no probe);BasePrefixCache.prefix_cache_versiondefaults to None (untracked).UnifiedRadixCacheimplements both.UnifiedRadixCachebumpsprefix_cache_versionat its existing insert, eviction, load-back, prefetch, reset, and multi-component match funnels; nothing else in the cache changes.Verification
registered/unit/managers/test_pp_chunk_by_pending.py(8), the probe and version tests inregistered/unit/mem_cache/unified_radix_cache/test_unified_radix_cache_core.py;cargo testinrust/sglang-radix-tree(967 passed, incl. 2 probe tests).registered/unit/managers/,registered/unit/mem_cache/unified_radix_cache/, andregistered/unit/server_args/fails no test that passes on main (local macOS, CPU).CI States
Latest PR Test (Base): ❌ Run #42935552444
Latest PR Test (Extra): ❌ Run #42935552332
Latest PR Test (AMD ROCm 10): ❌ Run #42935552364
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: