feat(trtllm): keep enable_iter_perf_stats off by default in every engine config - #446
Merged
Merged
Conversation
…ine config srtctl passes --publish-metrics to Dynamo TRT-LLM workers by default (NVIDIA#421), and dynamo.trtllm turns that flag into enable_iter_perf_stats: true in the engine arguments, so every worker paid TensorRT-LLM's per-iteration statistics cost (KV-cache stats and CUDA-event step timing on every executor loop) for gauges no srt-slurm benchmark reads. The engine YAML is merged over the derived arguments and wins on conflicts, so an explicit false is what turns the statistics off while keeping the request-level trtllm_* series, which only need the per-request perf metrics. - New expand_trtllm_engine_defaults() bakes enable_iter_perf_stats: false into every trtllm_config section a recipe uses (prefill/decode or aggregated, created when absent), for both frontend.type: dynamo and trtllm_serve. setdefault semantics: an explicit true in the recipe wins. - expand_observability() now creates the sections for the modes in use instead of only touching existing ones, so its true still wins for a recipe with no engine yaml; it warns when it meets an explicit false, which is also what a saved or locked recipe carries. - expand_engine_config_defaults() runs the three engine-config expansions in order; load_config, SrtConfig.from_yaml and the override submit path all use it, so srtctl dry-run and the in-job loader agree. - expand_trtllm_serve_defaults() shares the new _setdefault_trtllm_engine_keys helper; a non-mapping trtllm_config is left for schema validation instead of being replaced. - srtctl dry-run shows a "TRT-LLM Engine Statistics" panel with the per-role enable_iter_perf_stats / return_perf_metrics values for every TRT-LLM backend. - Docs: config-reference "Iteration statistics default" and the trtllm_serve worker-metrics note; regenerated schema-reference row for publish_metrics. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Yuewei Na <nv-yna@users.noreply.github.com>
nv-yna
requested review from
alec-flowers,
csahithi,
ishandhanani and
nlevin-ui
as code owners
September 14, 2026 22:35
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #446 +/- ##
=======================================
Coverage ? 79.85%
=======================================
Files ? 117
Lines ? 17395
Branches ? 0
=======================================
Hits ? 13890
Misses ? 3505
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bake
enable_iter_perf_stats: falseinto every TRT-LLM engine section a recipe uses (prefill and decode, or aggregated; created when the recipe has none), under bothfrontend.type: dynamoandtrtllm_serve, unless the recipe or observability sets the key.Why an explicit
falsewhen TensorRT-LLM's own default is alreadyfalse: srtctl passes--publish-metricsto Dynamo TRT-LLM workers by default (#421), anddynamo.trtllmturns that flag intoenable_iter_perf_stats: truein the engine arguments (components/src/dynamo/trtllm/workers/llm_worker.py), so every worker collected TensorRT-LLM's per-iteration statistics (KV-cache stats and CUDA-event step timing on every executor loop) for gauges no benchmark client reads. The engine YAML is merged over the derived arguments and wins on conflicts (TensorRT-LLMupdate_llm_args_with_extra_dict), so the explicit key is what turns the statistics off. The request-leveltrtllm_*Prometheus series (request latency, TTFT, TPOT, queue/prefill/decode time, token counters) come from the per-request perf metrics, which--publish-metricssets on the Dynamo path andreturn_perf_metrics: truesets for trtllm-serve, and are unaffected.expand_trtllm_engine_defaults()appliesTRTLLM_ENGINE_DEFAULTSwith setdefault semantics: an explicitenable_iter_perf_stats: truein the recipe wins.expand_observability()now creates the engine sections for the modes in use instead of only touching existing ones, so itstruestill wins for a recipe with no engine yaml. It warns when it meets an explicitfalse, which is also what a saved or locked recipe carries after a load/dump round trip.expand_engine_config_defaults()runs observability, trtllm-serve and engine defaults in order.load_config,SrtConfig.from_yamland the override submit path all use it; the override path previously loaded the schema with no expansion step, sosrtctl dry-runand the in-job loader disagreed.expand_trtllm_serve_defaults()shares the new_setdefault_trtllm_engine_keyshelper. A non-mappingtrtllm_config(or role section) is left alone so schema validation reports it instead of being replaced.backendis the legacytensorrt/trtengine are skipped:enable_iter_perf_statsis aTorchLlmArgs-only field, so containers older than TensorRT-LLM v1.3.0rc21 reject it, and that backend always collected the statistics anyway.srtctl dry-runshows a "TRT-LLM Engine Statistics" panel with the per-roleenable_iter_perf_stats/return_perf_metricsvalues for every TRT-LLM backend.config-reference.md, the trtllm-serve worker-metrics note, and the regeneratedschema-reference.mdrow forpublish_metrics.Default behavior
enable_iter_perf_statsin the engine YAMLfalse(section created when missing)observability.enabled: truetrue(observability expands first)trueon a roletruefor that rolefalseon a role withobservability.enabled: truefalse, with a load-time warningbackend: tensorrt/trtWhat changes on a default run
The iteration-level
trtllm_*gauges (trtllm_kv_cache_*, running/waiting requests, iteration latency) are no longer produced, and on Dynamo thedynamo_component_kvstats_*gauges, the router worker-load sample and the Planner's forward-pass metrics stay at their seeded zero. No benchmark client reads them. The component dashboard's engine-tab KV-cache utilisation and hit-rate panels show no data, and the Dynamo bench dashboard's KV-utilisation series sits at the seeded 0 %; a follow-up could teach the dashboard to render an all-zero component gauge as "not captured". Opt back in per role withroles.<role>.args.enable_iter_perf_stats: true, or withobservability.enabled: true.Compatibility
Recipes that already set the key are unchanged. Observability runs are unchanged where the recipe has engine sections, and gain the iteration-level gauges where it has none. The trtllm-serve
/prometheus/metricsroute depends onreturn_perf_metricsonly and is unchanged. The override submit path now applies the same expansions asload_config, which also means observability flags reach its dry-run output for the first time.Validation
make check: ruff passed,schema-docs-checkup to date, 2431 passed, 2 skipped, 6 deselected (30 new tests intest_observability.py,test_dry_run.py,test_override.py, covering both frontends, section creation, explicit true/false precedence, observability ordering, load/dump/reload, the v2roles:layout, the override dry-run path, non-mapping values and the legacy-backend skip).ty check src/srtctl/: 34 diagnostics, down from 36 onmain; none in changed lines.ai-dynamo/dynamomain(llm_worker.py:enable_iter_perf_statsderived frompublish_metrics, thenupdate_llm_args_with_extra_options(arg_map, config.extra_engine_args)with no explicit CLI keys) and TensorRT-LLMllm_args.py(llm_args = llm_args | llm_args_dict).🤖 Generated with Claude Code