[Feature]: Report the cross-attention KV cache pool in the Triton backend metrics and in the JSON iteration stats
Los mantenedores suelen responder en 1 día
@Epsilon006 ya está trabajando en esto.
Desde el 13/11/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 15.2k
- Forks
- 3k
- Merge medio
- 2 d 21 h
- PR fusionados (30 d)
- 477
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/TensorRT-LLM
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xPosiblemente ocupada @NimaVaziri la tomó hoy. AbiertoPytorch
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA/TensorRT-LLM#23406 ·
Los mantenedores suelen responder en 1 día
-
Inference runtime Windows
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
NVIDIA/TensorRT-LLM#23394 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: MMLU subsampling changes when evaluators are interleavedPosiblemente ocupada @LeNeLeNeWo la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NVIDIA/TensorRT-LLM#23273 ·
Los mantenedores suelen responder en 1 día
-
Trace-replay Pareto window includes the drain when sessions finish out of admission orderPosiblemente ocupada @sbeierle la tomó hace 3 días. AbiertoTesting
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
NVIDIA/TensorRT-LLM#23077 ·
Los mantenedores suelen responder en 1 día
-
LongBench V2 blog command breaks on inline comments after continuationsPosiblemente ocupada @ddlw la tomó hace 25 días. AbiertoDoc
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
NVIDIA/TensorRT-LLM#21879 ·
Los mantenedores suelen responder en 1 día
Todos los issues de NVIDIA/TensorRT-LLM
Issues similares
-
[Resource]: SpaicelyAbiertoresource-submission validation-passed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
hesreallyhim/awesome-claude-code#3875 · 1 comentario ·
-
[Bug]: Ajax Pro login issueAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
bvis/aegis-hass#725 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
#1643 unrecoverable split: 1 digest with a 403 — two earlier captures of the same URL are real 200sAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Robin-IA/Congressional-Letters-Dev#1684 ·
Los mantenedores suelen responder en 1 día