Add SGLang scheduler to SimAI Vidur: chunked prefill + RadixAttention prefix caching#223
Draft
Add SGLang scheduler to SimAI Vidur: chunked prefill + RadixAttention prefix caching#223
Conversation
|
|
Co-authored-by: tianhao909 <48342395+tianhao909@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Integrate sglang for seamless simulation
Add SGLang scheduler to SimAI Vidur: chunked prefill + RadixAttention prefix caching
Feb 28, 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.
SimAI had no way to simulate SGLang's runtime scheduling behavior. This adds a first-class
sglangreplica scheduler to the Vidur inference simulator that models SGLang's two core performance features.Changes
New:
SglangReplicaSchedulerchunk_size-token chunks interleaved with decode iterationsprefix_cache_hit_rate(0.0–1.0):ceil((1 − r) × prefill_tokens / block_size)fresh blocks are allocated per requestnum_processed_tokenspast the cached portion in the first iteration, reducing the number of prefill chunks proportionallyConfig:
SglangSchedulerConfigNew dataclass registered under
ReplicaSchedulerType.SGLANG = 7:chunk_sizeenable_prefix_cachingTrueprefix_cache_hit_rate0.0max_tokens_in_batchExample
Choosing
prefix_cache_hit_rate:0.0for random prompts,0.3–0.5for few-shot workloads,0.7–0.95for workloads with long shared system prompts. SeeREADME-vidur.mdfor the full guidance table.Notes
README.mdandREADME-vidur.mdupdated with CLI reference and usage guidance.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.