Skip to content

[WIP] feat(router): add engine-pressure-aware scheduling - #32535

Open
yangbodong22011 wants to merge 2 commits into
sgl-project:mainfrom
yangbodong22011:feature-load-pressure-model
Open

yangbodong22011 wants to merge 2 commits into
sgl-project:mainfrom
yangbodong22011:feature-load-pressure-model

Conversation

@yangbodong22011

@yangbodong22011 yangbodong22011 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Motivation

Define Engine pressure-aware scheduling independently so it can be reviewed while the LoadMonitor dependency remains in #32510.

This is a stacked WIP that depends on #32510. No #32510 implementation is included in this PR.

Modifications

  • derive normalized pressure from request saturation, queued uncached tokens, prefill/decode throughput, and hottest-rank KV usage
  • route load_based candidates using inverse-pressure weights
  • assign zero routing weight to fully pressured engines
  • preserve least-active routing when Engine metrics are unavailable
  • add deterministic scorer and weighted-routing tests

Accuracy Tests

Not applicable. This change affects Router backend selection, not model execution or output accuracy.

Speed Tests and Profiling

Pressure scoring is O(1) per candidate and weighted selection is O(n). No request body buffering or model-path synchronization is added.

Tests

Validated after applying this patch to the exact #32510 head (5528529ab3):

  • cargo fmt --all -- --check
  • 4 pressure scorer tests passed
  • 4 load-based scheduling tests passed
  • cargo clippy --all-targets -- -D warnings

The standalone WIP intentionally does not compile until #32510 provides AggregateLoad and PolicyCandidate.

Checklist

  • Format code
  • Add unit tests
  • Follow SGLang code style guidance
  • Update documentation if the final user-facing configuration changes
  • Run full benchmarks after the dependency is integrated

CI States

Latest PR Test (Base): ✅ Run #30912391345
Latest PR Test (Extra): ❌ Run #30912390880

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file npu labels Aug 4, 2026
@yangbodong22011 yangbodong22011 changed the title [WIP] feat(router): add engine load scorer feat(router): add load-pressure routing and admission Aug 4, 2026
@yangbodong22011
yangbodong22011 force-pushed the feature-load-pressure-model branch from 07002d4 to e4deef8 Compare August 4, 2026 09:50
@yangbodong22011 yangbodong22011 changed the title feat(router): add load-pressure routing and admission [WIP] feat(router): add engine load scorer Aug 4, 2026
@yangbodong22011 yangbodong22011 changed the title [WIP] feat(router): add engine load scorer [WIP] feat(router): add engine-pressure-aware scheduling Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation npu

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant