_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>