[Feature]: Report the cross-attention KV cache pool in the Triton backend metrics and in the JSON iteration stats
メンテナーはふだん 1 日以内に返信
@Epsilon006 がすでに取り組んでいます。
2026年11月13日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
Start with the stats loop in triton_backend/inflight_batcher_llm/src/model_instance_state.cc, the metric definitions in custom_metrics_reporter.{h,cc}, and the IterationStats serializer in cpp/tensorrt_llm/executor/jsonSerialization.cpp. Read the existing kvCacheStats handling and check related tests for both output paths. Done means cross-attention stats are reported separately when present and omitted for decoder-only engines.
索引モデルが issue の本文から書いたものです。
説明
The feature, motivation and pitch
For an encoder-decoder engine the executor creates two paged KV cache pools, one for self-attention and one for cross-attention (trtGptModelInflightBatching.cpp, the useCrossAttention() branch of the constructor). For those engines getCurrentIterationStats fills the optional IterationStats::crossKvCacheStats next to kvCacheStats. For a decoder-only engine there is no cross-attention pool and the field stays empty.
The Python bindings expose the field (cross_kv_cache_stats). The two paths that leave the process do not:
- Triton backend. The stats loop in
triton_backend/inflight_batcher_llm/src/model_instance_state.ccreadsstat.kvCacheStatsonly. Sonv_trt_llm_kv_cache_block_metricsdescribes the self-attention pool alone, and nothing describes the cross-attention pool. - JSON iteration stats. The
IterationStatsserializer incpp/tensorrt_llm/executor/jsonSerialization.cpplistskvCacheStatsand notcrossKvCacheStats. Soto_json_str()and the/metricsroute oftrtllm-servedo not carry it.
Why it matters for an encoder-decoder engine:
- A request holds its encoder output in the cross-attention pool for its whole life. That pool can be the one that runs out first. When it does, the only exported cache metric describes the other pool and can read nearly empty.
- Each pool is sized as the smaller of
max_tokens_in_paged_kv_cacheand its share of free GPU memory at load. The cross-attention pool can come out smaller than configured, and its capacity is not reported anywhere.
Request: when crossKvCacheStats has a value, report it on both paths.
A sketch, not compiled:
- In
model_instance_state.cc, next to the existingkvCacheStatsblock, append the same fields fromstat.crossKvCacheStatsunder distinct keys. - In
custom_metrics_reporter.{h,cc}, add a metric family for them with the samekv_cache_block_typelabel values. A separate family leaves the existing one unchanged, and it is simply absent for decoder-only engines. - In
jsonSerialization.cpp, addcrossKvCacheStatsto theIterationStatsserializer.
Alternatives
- Reading
cross_kv_cache_statsthrough the Python bindings. That works only for code inside the process that owns the executor, so not for a Triton deployment. - Inferring a full cross-attention pool from the request metrics (
activeagainstscheduled). That shows a symptom and not which pool caused it. - Adding the cross-attention values as extra
kv_cache_block_typelabel values on the existing family. That changes what the existing family means for anyone who aggregates it.
Additional context
- Code references are to v1.2.1. The backend's stats loop is the same in v1.3.0rc1.
- 主要言語
- Python
- スター
- 15.2k
- フォーク
- 3k
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 477
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/TensorRT-LLM のほかの issue
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.x対応中かも @NimaVaziri が今日担当しました。 オープンPytorch
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA/TensorRT-LLM#23406 ·
メンテナーはふだん 1 日以内に返信
-
Inference runtime Windows
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
NVIDIA/TensorRT-LLM#23394 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: MMLU subsampling changes when evaluators are interleaved対応中かも @LeNeLeNeWo が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NVIDIA/TensorRT-LLM#23273 ·
メンテナーはふだん 1 日以内に返信
-
Trace-replay Pareto window includes the drain when sessions finish out of admission order対応中かも @sbeierle が 3 日前に担当しました。 オープンTesting
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
NVIDIA/TensorRT-LLM#23077 ·
メンテナーはふだん 1 日以内に返信
-
LongBench V2 blog command breaks on inline comments after continuations対応中かも @ddlw が 25 日前に担当しました。 オープンDoc
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
NVIDIA/TensorRT-LLM#21879 ·
メンテナーはふだん 1 日以内に返信
NVIDIA/TensorRT-LLM の issue をすべて見る
似ている issue
-
[Resource]: Spaicelyオープンresource-submission validation-passed
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
hesreallyhim/awesome-claude-code#3875 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
bvis/aegis-hass#725 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
#1643 unrecoverable split: 1 digest with a 403 — two earlier captures of the same URL are real 200sオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
Robin-IA/Congressional-Letters-Dev#1684 ·
メンテナーはふだん 1 日以内に返信