Skip to content

feat(metrics): expose Mooncake KV transfer outcomes - #5197

Draft
qescccczmr wants to merge 1 commit into
InternLM:mainfrom
qescccczmr:feat/external-kv-transfer-metrics
Draft

qescccczmr wants to merge 1 commit into
InternLM:mainfrom
qescccczmr:feat/external-kv-transfer-metrics

Conversation

@qescccczmr

Copy link
Copy Markdown
Collaborator

Motivation

The external prefix cache hit rate counts matches at admission. A matched prefix can still fail to load, and Store writes can fail under capacity pressure. Operators currently need to correlate worker logs to see transfer outcomes.

Changes

  • Count loaded tokens after all TP workers complete and paging publishes the prefix.
  • Count load operations that failed and fell back to local computation.
  • Count failed save operations once their worker completions are terminal.
  • Expose the three cumulative counters in the throughput log and Prometheus alongside the existing hit rate.

The counters cover transfer outcomes including retries and block overlap. Save failures are aggregated across workers and can have several causes. The patch leaves admission, fallback, and save policies unchanged.

Validation

340 CPU tests passed across the metrics logger, hybrid KV loading, scheduler KV transfer, and Mooncake Store scheduler and worker suites. Tests exercise early rank failures, cancelled loads, stale completions, and repeated metric snapshots. Ruff, Markdown formatting, docstring formatting, and git diff --check passed for the changed files.

This branch has not been deployed

No deployments
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.

1 participant