TensorRT-LLM icon indicating copy to clipboard operation
TensorRT-LLM copied to clipboard

Shutdown and control sentinel items crash queued-request stats collection

Open StephenLReed opened this issue 3 months ago • 1 comments

System Info

  • TensorRT-LLM: 1.3.0rc23 (built from f20ea652); behaviour re-checked against main @ fbda11f5
  • GPU: NVIDIA GeForce RTX 5090 (sm_120), driver 595.71.05
  • PyTorch 2.11.0+cu130, CUDA 13.0, Python 3.12.13
  • Ubuntu 25.10, kernel 6.17.0-41-generic
  • Backend: PyTorch; single GPU, no TP/PP
  • Model where observed: Qwen3.6-35B-A3B-NVFP4 with FP8 KV cache (where model-specific)

Who can help?

No response

Reproduction

When enable_iter_req_stats and enable_iter_perf_stats are both enabled, the queued-request stats path treats every item on the request queue as a normal request. Shutdown and control sentinels are not normal requests and do not carry the fields that path reads, so collection raises.

Stats collection is a prototype feature (both options default to False), so the blast radius is limited to deployments that turn it on — but for those, the failure occurs on the executor's own stats path rather than in a request, which makes it disproportionately disruptive relative to the feature's value.

Expected behavior

Sentinel items on the request queue are skipped when populating queued-request stats.

actual behavior

They are treated as normal requests, so stats collection raises on fields they do not carry.

additional notes

Skip sentinel items when populating queued-request stats, using the existing predicate that already distinguishes them. No API change; for normal requests, allocation and reporting are unchanged apart from evaluating that predicate.

We have the patch and unit tests, and are raising this Issue Request first per CONTRIBUTING.md.

StephenLReed avatar Aug 18 '26 16:08 StephenLReed

Thank you for reporting this. This is already fixed on main, and along the lines you proposed. The queued-request stats loop at tensorrt_llm/_torch/pyexecutor/py_executor.py:2214-2218 now skips items where is_normal_request is false before anything dereferences item.request, using the existing predicate rather than a new one, and adds a None-payload guard immediately after. The surrounding code also handles the unusual case where a normal request carries no readable input_token_ids by excluding it from the counters and logging, so a stats collection pass no longer raises on queue contents that are not ordinary requests. There is a test covering the sentinel case at tests/unittest/_torch/executor/test_iter_stats_populate.py:380.

karljang avatar Sep 05 '26 23:09 karljang