[Feature]: Report the cross-attention KV cache pool in the Triton backend metrics and in the JSON iteration stats
I maintainer di solito rispondono entro 1 giorno
@Epsilon006 ci sta già lavorando.
Dal 13/11/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend-api-design, observability
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 15.2k
- Fork
- 3k
- Merge medio
- 2g 21h
- PR unite (30g)
- 477
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/TensorRT-LLM
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xForse già presa @NimaVaziri l’ha presa oggi. ApertaPytorch
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NVIDIA/TensorRT-LLM#23406 ·
I maintainer di solito rispondono entro 1 giorno
-
Inference runtime Windows
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
NVIDIA/TensorRT-LLM#23394 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: MMLU subsampling changes when evaluators are interleavedForse già presa @LeNeLeNeWo l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NVIDIA/TensorRT-LLM#23273 ·
I maintainer di solito rispondono entro 1 giorno
-
Trace-replay Pareto window includes the drain when sessions finish out of admission orderForse già presa @sbeierle l’ha presa 3 giorni fa. ApertaTesting
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
NVIDIA/TensorRT-LLM#23077 ·
I maintainer di solito rispondono entro 1 giorno
-
LongBench V2 blog command breaks on inline comments after continuationsForse già presa @ddlw l’ha presa 25 giorni fa. ApertaDoc
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
NVIDIA/TensorRT-LLM#21879 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di NVIDIA/TensorRT-LLM
Issue simili
-
[Resource]: SpaicelyApertaresource-submission validation-passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
hesreallyhim/awesome-claude-code#3875 · 1 commento ·
-
[Bug]: Ajax Pro login issueApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
bvis/aegis-hass#725 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
#1643 unrecoverable split: 1 digest with a 403 — two earlier captures of the same URL are real 200sAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Robin-IA/Congressional-Letters-Dev#1684 ·
I maintainer di solito rispondono entro 1 giorno