Prometheus renderer reuses stale engine state after same-timestamp eviction

Đang mở
#2,003 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
73/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, prometheus
Lĩnh vực
backend, observability

Hướng nghiên cứu

Start with metricsText in sim/llmd/server.go and read the publication handling in sim/engine_metrics.go alongside NoteAbort and the post-abort step in sim/simulator.go. Run the focused sim/llmd test, then add a regression for a scrape followed by a same-timestamp post-abort publication. Done means the second scrape reports the corrected running, waiting, KV, and adapter state.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area/llm-d-parity area/metrics-invariants bug

Problem

The simulated model-server Prometheus renderer caches output using only the maximum EngineMetrics.PublishedAt timestamp as its identity:

Engine state can legitimately be published twice at the same simulated timestamp. In particular, a scrape at a step boundary can promote the state from the step ending at T; an eviction at T removes the request; then the already-scheduled empty post-abort step publishes the corrected state at T:

The second state has different values but the same cache key, so subsequent scrapes receive the first state.

Reproduction

A focused sim/llmd test reproduced this sequence:

  1. Drive one request through its first running engine step.
  2. At the next step timestamp T, call metricsText; it renders vllm:num_requests_running ... 1 and caches it under T.
  3. Evict the request at T and process the post-abort step.
  4. Confirm EngineMetricsAt(T).Running == 0.
  5. Call metricsText again.

The second call still returns:

vllm:num_requests_running{model_name="test-model"} 1
vllm:kv_cache_usage_perc{model_name="test-model"} 0.0005

even though the newly visible engine metrics report zero running requests and released KV.

Impact

The embedded router can continue treating an evicted/completed request as running and its KV as allocated until some later engine publication changes the timestamp. An idle engine may have no later publication, making the stale state persistent and affecting scoring or flow control.

This is especially reachable at step boundaries because cluster callbacks, including scrapes and eviction callbacks, run before the instance step at the same timestamp.

Acceptance criteria

  • Render-cache identity distinguishes different publications at the same simulated timestamp, or caching is removed where identity cannot be established safely.
  • A regression test covers a scrape followed by a same-timestamp post-abort publication.
  • The second scrape exposes the corrected running/waiting/KV/adapter state.
Ngôn ngữ chính
Go
Star
40
Fork
28
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
31

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của inference-sim/inference-sim

Tất cả issue của inference-sim/inference-sim

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.