Skip to content

Expose accumulated batched PD producer timings - #250

Closed
gspark-etri wants to merge 1 commit into
fix/246-pd-producer-readinessfrom
feat/249-pd-stage-metrics
Closed

gspark-etri wants to merge 1 commit into
fix/246-pd-producer-readinessfrom
feat/249-pd-stage-metrics

Conversation

@gspark-etri

Copy link
Copy Markdown
Collaborator

Background

Batched PD performs real KV handoffs but the single-stage transfer histogram remains unobserved. Existing producer duration totals were internal, preventing stage attribution in #248.

Changes

Export airm_pd_producer_seconds_total{stage="prefill"|"transfer"} from existing accumulated batcher stats. Missing keys are omitted; repeated scrapes do not add observations. No scheduler or transfer change.

Verification

A real tiny Torch producer/batcher regression fails before the fix at the absent metric. Controlled worker-reported durations verify totals0.5/0.25seconds after two handoffs, stable repeated scrapes and missing-key compatibility. Focused suite34passed, one existing flex-attention warning. Full CPU suite:467passed,17skipped,135subtests,1existing warning in145.94seconds; CUDA hidden. Ruff and diff check clean.

Compatibility and limits

Additive metrics. Totals cover admitted handoffs, excluding failed/cancelled work never admitted. Timing meanings depend on the worker: Torch prefill includes KV gathering and transfer excludes decoder KV installation. Default-zero reports from uninstrumented workers do not prove free physical transfers. Totals are not request latency, histograms or evidence of overlap.

Related Issue

Closes #249. Supports #248 and #47. Stacked on #247; maintainer review/merge required.

gspark-etri added a commit that referenced this pull request Oct 30, 2026
…#246, #249) (#282)

From feat/249-pd-stage-metrics (#239, #247, #250): SubprocessPrefillWorker
failure settling, producer readiness gating /ready and admission, producer
stage-duration metrics; only the /ready hunk of llmd.py.

Fixes on top:
- SubprocessPrefillWorker.close() closes stdin and waits for a clean exit
  before SIGTERM, then SIGKILL (prefill_server exits on stdin EOF; SIGTERM
  first skipped SDK cleanup that releases the device).
- ProcessPrefillWorker.ready: a dead child now fails readiness and admission
  is rejected with 503 instead of quarantining the batcher.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@gspark-etri

Copy link
Copy Markdown
Collaborator Author

Landed on optimus-rm via #282. Closing; the branch is archived locally (experiment records and evidence included).

@gspark-etri gspark-etri closed this Nov 3, 2026
@gspark-etri
gspark-etri deleted the feat/249-pd-stage-metrics branch November 3, 2026 17:05
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