Skip to content

Implements the kv_save_blocks_total counter metric (tpu_raiden_kv_save_blocks_total{dp_rank, tier, outcome}) to track block save outcomes across KV cache offload tiers: - #1371

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_999559866
Nov 2, 2026

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Implements the kv_save_blocks_total counter metric (tpu_raiden_kv_save_blocks_total{dp_rank, tier, outcome}) to track block save outcomes across KV cache offload tiers:

  • Declares kKvSaveBlocksTotal (MetricType::kCounter) along with outcome label values kOutcomeRejected ("rejected") and kOutcomeFailed ("failed") in metrics_backend.h.
  • Instruments KVCacheStore::Insert (tier="local_dram", outcome="rejected" for the whole batch when InsertOption::kInsertAndPin fails, either for lack of unpinned space or because an existing hash could not be pinned), KVCacheStore::SaveLocal (tier="local_dram"; host block allocation failure counts outcome="rejected" on RESOURCE_EXHAUSTED and "failed" on any other error; storage write-through counts "ok" / "failed" when the offload settles), HostOffloadBackend::Save (tier="local_dram", outcome="ok" / "failed"), and HostOffloadBackend::BeginWriteRemote (tier="remote_dram", outcome="ok", "rejected", and "failed" across peer RPC and transfer settle paths).
  • Adds unit tests verifying kv_save_blocks_total across local_dram (including storage write-through) and remote_dram tiers.

@copybara-service copybara-service Bot changed the title [tpu_raiden] Add kv_save_blocks_total metric for multi-tier KV cache offload Implements the kv_save_blocks_total counter metric (tpu_raiden_kv_save_blocks_total{host_ip, dp_rank, tier, outcome}) to track block save outcomes across KV cache offload tiers: Oct 27, 2026
@copybara-service
copybara-service Bot force-pushed the test_999559866 branch 2 times, most recently from d3cd5b1 to dd4c5b0 Compare October 29, 2026 08:06
@copybara-service copybara-service Bot changed the title Implements the kv_save_blocks_total counter metric (tpu_raiden_kv_save_blocks_total{host_ip, dp_rank, tier, outcome}) to track block save outcomes across KV cache offload tiers: Implements the kv_save_blocks_total counter metric (tpu_raiden_kv_save_blocks_total{dp_rank, tier, outcome}) to track block save outcomes across KV cache offload tiers: Oct 29, 2026
@copybara-service
copybara-service Bot force-pushed the test_999559866 branch 3 times, most recently from 96dbbd5 to 19bcb68 Compare November 2, 2026 18:11
…save_blocks_total{dp_rank, tier, outcome}`) to track block save outcomes across KV cache offload tiers:

- Declares `kKvSaveBlocksTotal` (`MetricType::kCounter`) along with `outcome` label values `kOutcomeRejected` (`"rejected"`) and `kOutcomeFailed` (`"failed"`) in `metrics_backend.h`.
- Instruments `KVCacheStore::Insert` (`tier="local_dram"`, `outcome="rejected"` for the whole batch when `InsertOption::kInsertAndPin` fails, either for lack of unpinned space or because an existing hash could not be pinned), `KVCacheStore::SaveLocal` (`tier="local_dram"`; host block allocation failure counts `outcome="rejected"` on `RESOURCE_EXHAUSTED` and `"failed"` on any other error; storage write-through counts `"ok"` / `"failed"` when the offload settles), `HostOffloadBackend::Save` (`tier="local_dram"`, `outcome="ok"` / `"failed"`), and `HostOffloadBackend::BeginWriteRemote` (`tier="remote_dram"`, `outcome="ok"`, `"rejected"`, and `"failed"` across peer RPC and transfer settle paths).
- Adds unit tests verifying `kv_save_blocks_total` across `local_dram` (including storage write-through) and `remote_dram` tiers.

PiperOrigin-RevId: 1012317747
@copybara-service
copybara-service Bot merged commit f9a6112 into main Nov 2, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_999559866 branch November 2, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants