Skip to content

[core] Extract pool sizing logic to pool_configurator.py#22384

Merged
hnyls2002 merged 10 commits intomainfrom
lsyin/pool-configurator
Apr 8, 2026
Merged

[core] Extract pool sizing logic to pool_configurator.py#22384
hnyls2002 merged 10 commits intomainfrom
lsyin/pool-configurator

Conversation

@hnyls2002
Copy link
Copy Markdown
Collaborator

@hnyls2002 hnyls2002 commented Apr 8, 2026

Summary

  • Extract get_cell_size_per_token and resolve_hybrid_swa_tokens from model_runner_kv_cache_mixin.py to pool_configurator.py as standalone functions
  • Extract _profile_available_bytes from profile_max_num_token (returns bytes instead of tokens)
  • Rename _resolve_token_capacity_apply_token_constraints for clarity
  • Fix missing page alignment in _apply_token_constraints

Pure code movement, zero behavior change. Prepares for Configurator class hierarchy in follow-up PR.

Test plan

  • /rerun-stage stage-a-test-1
  • /rerun-stage stage-b-test-small-1-gpu

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@hnyls2002 hnyls2002 changed the title [core] Refactor model runner token capacity calculation Extract pool sizing logic to pool_configurator.py Apr 8, 2026
@hnyls2002 hnyls2002 changed the title Extract pool sizing logic to pool_configurator.py [core] Extract pool sizing logic to pool_configurator.py Apr 8, 2026
@hnyls2002 hnyls2002 merged commit 1e3f6eb into main Apr 8, 2026
69 of 97 checks passed
@hnyls2002 hnyls2002 deleted the lsyin/pool-configurator branch April 8, 2026 23:13
yhyang201 pushed a commit to yhyang201/sglang that referenced this pull request Apr 22, 2026
@hnyls2002 hnyls2002 mentioned this pull request Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant