Conversation
Re-adds the HiCache observability that was reverted in feat/umbp-pr (001e9ce) and never carried forward, now adapted to the current async write/load pipeline: - sglang:evicted_backuped_tokens_total / evicted_regular_tokens_total: split of evicted_tokens_total by whether the node had already been backed up to host (cheap detach) vs dropped with no host copy. - sglang:gpu_kv_cache_occupancy: alias gauge of token_usage, kept for HiCache dashboards that query it under the old name. - sglang:eviction_bandwidth_gb_s / load_back_bandwidth_gb_s: real per-batch PCIe bandwidth. HiCacheAck already carried CUDA start/finish events bracketing the D2H/H2D copy in cache_controller.py's start_writing()/start_loading(); they just weren't created with enable_timing=True and had no token count attached. Restored both (LayerLoadingEvent too, since load-back reuses its start/finish pair) and added a num_tokens field to HiCacheAck so writing_check()/ loading_check() can derive GB/s from start_event.elapsed_time(finish_event) and mem_pool_host.get_size_per_token() at ack-drain time. - sglang:backuped_bytes_total / prefetched_bytes_total: byte-scaled counterparts of the existing backuped_tokens_total/prefetched_tokens_total. HiCacheAck gaining a 4th field required widening the ack-queue unpacking in unified_radix_cache.py, hi_mamba_radix_cache.py, and decode_kvcache_offload_manager.py, which share the same queue but don't need the new metrics. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Visualizes the metrics from the previous commit plus existing host-capacity/storage-rate counters: GPU KV Cache Utilization, HiCache Host Utilization, HiCache Host Used/Total Capacity, L1<->L2 Eviction/Load-back Rate, L1->L2 and L2->L1 PCIe bandwidth, L3 Prefetch/Writeback Rate, and L3 Storage Read/Write Bandwidth. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
TianDi101
requested review from
Ying1123,
alphabetc1,
fzyzcjy,
hanming-lu,
hnyls2002,
hzh0425,
ispobock,
merrymercy,
sufeng-buaa,
xiezhq-hermann and
yizhang2077
as code owners
July 21, 2026 04:21
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
21 tasks
5 tasks
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.
Summary
Split out of #31879 (general HiCache L1<->L2 eviction/load-back metrics only, no UMBP-specific or per-tier-hit changes).
Re-adds the HiCache observability that was reverted in
feat/umbp-pr(001e9ce) and never carried forward, now adapted to the current async write/load pipeline:sglang:evicted_backuped_tokens_total/evicted_regular_tokens_total: split of evicted tokens by whether the node had already been backed up to host (cheap detach) vs dropped with no host copy.sglang:gpu_kv_cache_occupancy: alias gauge oftoken_usage, kept for HiCache dashboards that query it under the old name.sglang:eviction_bandwidth_gb_s/load_back_bandwidth_gb_s: real per-batch PCIe bandwidth for the L1<->L2 (device<->host) write-back/load-back path, derived fromHiCacheAck.num_tokens+ CUDA/HIP event timing.sglang:backuped_bytes_total/prefetched_bytes_total: byte-scaled counterparts of the existingbackuped_tokens_total/prefetched_tokens_totalcounters.This is all L1<->L2 (GPU<->host) traffic inside
HiCacheController's write-back/load-back path — it has no dependency on which (if any) L3 storage backend is attached.Reconciled with the
timing_enabled/make_timing_event_pair()guard main already has (for backends without CUDA/HIP event-timing support): extended the write/eviction path incache_controller.pyandhybrid_cache_controller.pyto also usemake_timing_event_pair()instead of unguardedenable_timing=True(matching the load path's existing handling), and to carrytiming_enabledthroughHiCacheAckso the new bandwidth metrics degrade gracefully where event timing isn't available.Also restores the corresponding Grafana panels: GPU KV Cache Utilization, HiCache Host Utilization, HiCache Host Used/Total Capacity, L1<->L2 Eviction/Load-back Rate, L1->L2 and L2->L1 PCIe bandwidth, L3 Prefetch/Writeback Rate, and L3 Storage Read/Write Bandwidth (the last two use pre-existing/new general token-and-byte counters, not any UMBP-specific metric). Uses
"datasource": {"default": true}rather than a hardcoded UID so it works on any fresh Grafana instance.Test plan
--enable-metrics --enable-hierarchical-cacheon a backend without CUDA-event-timing support and confirm eviction/load-back still functions (bandwidth metrics simply don't populate, no crash)sglang:eviction_bandwidth_gb_s/load_back_bandwidth_gb_spopulate with plausible values, and the Grafana panels renderCI States
Latest PR Test (Base): ❌ Run #29801027316
Latest PR Test (Extra): ❌ Run #29801027262