Files
sglang/python
leavelet 47c24fecf2 CP HiCache metrics: fix tp_rank AttributeError under CP + label by cp_rank
_cp_maybe_collect_metrics read cache_controller.tp_rank/dp_rank, but those were
resolved only inside _generate_storage_config -- which never runs under CP
shared-L2 (storage backends are forbidden there), so the first metrics emit
crashed the prefill scheduler with:
  AttributeError: 'HiCacheController' object has no attribute 'tp_rank'

- cache_controller.py: resolve tp_rank/tp_size/dp_rank once in __init__ (always
  available, not storage-gated); drop the now-redundant derivation in
  _generate_storage_config.
- hiradix_cache.py: label the CP HiCache metrics by cp_rank/cp_size -- the
  identity that actually distinguishes the per-rank L2 lanes / L3 slabs these
  metrics measure -- resolved from the CP layout (_cp_hicache_cp_*), alongside
  the now-reliable tp/dp/pp coordinates.
- metrics_collector.py: docstring -> per-rank via cp_rank.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 16:06:51 +00:00
..
2026-06-10 05:54:43 +08:00