Skip to content

[TRTLLM-13409][test] fail fast + surface server logs when a perf-sanity server dies or never becomes healthy - #16403

Merged
JunyiXu-nv merged 4 commits into
NVIDIA:mainfrom
JunyiXu-nv:dev-junyix-fix-perf-sanity-fail-fast
Jul 29, 2026
Merged

[TRTLLM-13409][test] fail fast + surface server logs when a perf-sanity server dies or never becomes healthy#16403
JunyiXu-nv merged 4 commits into
NVIDIA:mainfrom
JunyiXu-nv:dev-junyix-fix-perf-sanity-fail-fast

Conversation

@JunyiXu-nv

@JunyiXu-nv JunyiXu-nv commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Improved server readiness monitoring for aggregated and disaggregated benchmarks.
    • Detects unexpected server termination promptly instead of waiting for the full timeout.
    • Failure messages now include relevant server log details and recent log output.
    • Prevents benign warmup and autotuner messages from being reported as fatal errors.
    • Handles missing diagnostic log files without interrupting readiness checks.
  • Tests

    • Added automated coverage for fail-fast behavior, timeout diagnostics, log scanning, and benign error filtering.
    • Expanded the A10 pre-merge test list with HTTP utility coverage.

Description

Post-merge CI analysis of TRTLLM-13409 showed the dominant remaining hang-shaped burn is a disagg/perf-sanity server that dies or wedges during startup: the observed pattern is "trtllm-serve disaggregated launched, died before binding, and nobody noticed" -- the benchmark client polls /health (connection refused) until the 90-minute per-test pytest timeout, the CTX/GEN/DISAGG babysitter ranks wait only for the benchmark-done file without ever polling their server process, 8-36 GPUs are held, and nothing in the CI log shows the server-side story. Harness defects compound this:

  • wait_for_endpoint_ready was called with the whole-test timeout (DEFAULT_TIMEOUT=10800s), so the pytest kill always fired first and the harness never reached its own timeout/reporting path;
  • its error-file scan ran every 300 loop iterations (5-30 min of wall time) and silently skipped missing files;
  • no failure path dumped the server log tail, and report_error's keyword scan iterated an already-exhausted file handle, so it never matched.

Test Coverage

Adds CPU-only unit tests (registered in l0_a10) covering the fail-fast paths, the babysitter liveness helper, the benign-marker filter, the always-tail behavior, and the report_error regression; a NO_PROXY fixture keeps the dead-endpoint tests correct behind corporate HTTP proxies.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Server readiness utilities now detect exited processes, include server log tails in failures, ignore benign log markers, and support configurable readiness timeouts. Performance benchmark waits pass process and log context, with new unit coverage added to the A10 pre-merge list.

Changes

Server readiness diagnostics

Layer / File(s) Summary
Log filtering and failure reporting
tests/test_common/error_utils.py, tests/test_common/http_utils.py
Benign log markers are excluded from error detection, log tails remain available after keyword matches, and process failures include server log context.
Endpoint readiness fail-fast flow
tests/test_common/http_utils.py, tests/unittest/others/test_http_utils_fail_fast.py, tests/integration/test_lists/test-db/l0_a10.yml
Endpoint polling checks process liveness and log errors, handles missing check files, enriches timeout failures, and adds coverage to the A10 pre-merge list.
Performance benchmark orchestration
tests/integration/defs/perf/test_perf_sanity.py
Aggregate and disaggregated readiness waits use configurable limits, while benchmark completion waits monitor server processes and logs.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReadinessWait
  participant ServerProcess
  participant ServerLogs
  participant ErrorReporter
  ReadinessWait->>ServerProcess: poll liveness
  ReadinessWait->>ServerLogs: inspect readiness logs
  ServerLogs->>ErrorReporter: report error matches and tail
  ErrorReporter-->>ReadinessWait: raise enriched failure
  ServerProcess-->>ReadinessWait: report unexpected exit
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is specific, concise, and matches the main change: fail-fast perf-sanity server monitoring with log surfacing.
Description check ✅ Passed The description follows the template, explains the problem and solution, and includes test coverage plus checklist completion.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/test_common/error_utils.py (1)

61-76: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Catch only log-reading errors.

This block only performs file I/O, so catching Exception can misclassify unrelated programming failures as unreadable logs. Catch OSError instead.

Proposed fix
-        except Exception as e:
+        except OSError as e:

As per coding guidelines, catch the narrowest possible exceptions instead of broad exceptions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_common/error_utils.py` around lines 61 - 76, In the log-reading
try/except around opening and scanning log_file, replace the broad Exception
handler with an OSError handler. Preserve the existing fallback assignments and
failure message for actual file I/O errors, while allowing unrelated programming
exceptions to propagate.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/integration/defs/perf/test_perf_sanity.py`:
- Around line 109-123: Update server_ready_timeout so the parsed
TRTLLM_TEST_SERVER_READY_TIMEOUT value is accepted only when greater than zero;
return the provided default for zero or negative values, preserving the existing
fallback and invalid-value handling.

In `@tests/test_common/error_utils.py`:
- Around line 19-21: Narrow the autotuner exemption by replacing the broad
BENIGN_LINE_MARKERS check in tests/test_common/error_utils.py:19-21 with a
predicate requiring both the expected autotuner probe message and OOM text;
update check_error() at tests/test_common/error_utils.py:33-34 and
report_error() at tests/test_common/error_utils.py:67-68 to use it. Add coverage
in tests/unittest/others/test_http_utils_fail_fast.py:121-131 confirming both
scanners still detect an autotuner-prefixed non-OOM error.

In `@tests/unittest/others/test_http_utils_fail_fast.py`:
- Around line 121-131: The existing autotuner test does not verify that genuine
errors with the autotuner marker remain detectable. Add
test_autotuner_marker_does_not_hide_real_errors in the test_check_error
coverage, using a log containing an “[Autotuner] RuntimeError: …” entry and
asserting check_error reports it, while preserving the benign warmup OOM
filtering behavior.

---

Outside diff comments:
In `@tests/test_common/error_utils.py`:
- Around line 61-76: In the log-reading try/except around opening and scanning
log_file, replace the broad Exception handler with an OSError handler. Preserve
the existing fallback assignments and failure message for actual file I/O
errors, while allowing unrelated programming exceptions to propagate.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 635587bc-ae93-4e3d-ae48-479f3d96b030

📥 Commits

Reviewing files that changed from the base of the PR and between d3436a0 and a484be3.

📒 Files selected for processing (5)
  • tests/integration/defs/perf/test_perf_sanity.py
  • tests/integration/test_lists/test-db/l0_a10.yml
  • tests/test_common/error_utils.py
  • tests/test_common/http_utils.py
  • tests/unittest/others/test_http_utils_fail_fast.py

Comment thread tests/integration/defs/perf/test_perf_sanity.py Outdated
Comment thread tests/test_common/error_utils.py Outdated
Comment thread tests/unittest/others/test_http_utils_fail_fast.py
@JunyiXu-nv
JunyiXu-nv force-pushed the dev-junyix-fix-perf-sanity-fail-fast branch from a484be3 to 434ef30 Compare July 15, 2026 05:42
@mzweilz

mzweilz commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Approved to unblock this PR.

@JunyiXu-nv
JunyiXu-nv force-pushed the dev-junyix-fix-perf-sanity-fail-fast branch from 434ef30 to 6a4b3d0 Compare July 15, 2026 05:56
@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #59412 [ run ] triggered by Bot. Commit: 6a4b3d0 Link to invocation

@BowenFu BowenFu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — correctly fixes two real defects: the server-ready wait was passed DEFAULT_TIMEOUT=10800 (now bounded + env-overridable), and report_error scanned an already-exhausted handle after readlines() (now scans the buffered list). Masking risk is well-guarded — is_benign_line only suppresses [Autotuner]/OOM lines, the log tail is always appended even on a keyword hit, and there's a regression test covering it. Nice fail-fast improvement for the perf-sanity harness.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #59412 [ run ] completed with state SUCCESS. Commit: 6a4b3d0
/LLM/main/L0_MergeRequest_PR pipeline #47883 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@yufeiwu-nv
yufeiwu-nv removed the request for review from ruodil July 16, 2026 06:53
@JunyiXu-nv
JunyiXu-nv force-pushed the dev-junyix-fix-perf-sanity-fail-fast branch from c9e5b13 to 9c0e885 Compare July 16, 2026 14:16
@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #59722 [ run ] triggered by Bot. Commit: 9c0e885 Link to invocation

Comment thread tests/integration/defs/perf/test_perf_sanity.py
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #59722 [ run ] completed with state SUCCESS. Commit: 9c0e885
/LLM/main/L0_MergeRequest_PR pipeline #48149 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

JunyiXu-nv added a commit to JunyiXu-nv/TensorRT-LLM that referenced this pull request Jul 17, 2026
Agg and disagg servers have very different init times (disagg /health
answers only once every ctx/gen worker is up), so a single override var
could not extend one without the other. Add
TRTLLM_TEST_AGG_SERVER_READY_TIMEOUT and
TRTLLM_TEST_DISAGG_SERVER_READY_TIMEOUT, with the existing
TRTLLM_TEST_SERVER_READY_TIMEOUT as a shared fallback.

Addresses brnguyen2's review comment on PR NVIDIA#16403.

Signed-off-by: JunyiXu-nv <219237550+JunyiXu-nv@users.noreply.github.com>
JunyiXu-nv added a commit to JunyiXu-nv/TensorRT-LLM that referenced this pull request Jul 17, 2026
Agg and disagg servers have very different init times (disagg /health
answers only once every ctx/gen worker is up), so a single override var
could not extend one without the other. Add
TRTLLM_TEST_AGG_SERVER_READY_TIMEOUT and
TRTLLM_TEST_DISAGG_SERVER_READY_TIMEOUT, with the existing
TRTLLM_TEST_SERVER_READY_TIMEOUT as a shared fallback.

Addresses brnguyen2's review comment on PR NVIDIA#16403.

Signed-off-by: JunyiXu-nv <219237550+JunyiXu-nv@users.noreply.github.com>
@JunyiXu-nv
JunyiXu-nv force-pushed the dev-junyix-fix-perf-sanity-fail-fast branch from fa46df7 to 18ada87 Compare July 17, 2026 06:49
@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61780 [ run ] triggered by Bot. Commit: e7368ee Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61780 [ run ] completed with state SUCCESS. Commit: e7368ee
/LLM/main/L0_MergeRequest_PR pipeline #49980 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61861 [ run ] triggered by Bot. Commit: e7368ee Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61861 [ run ] completed with state SUCCESS. Commit: e7368ee
/LLM/main/L0_MergeRequest_PR pipeline #50055 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61932 [ run ] triggered by Bot. Commit: e7368ee Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #61932 [ run ] completed with state SUCCESS. Commit: e7368ee
/LLM/main/L0_MergeRequest_PR pipeline #50126 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62067 [ run ] triggered by Bot. Commit: e7368ee Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62067 [ run ] completed with state SUCCESS. Commit: e7368ee
/LLM/main/L0_MergeRequest_PR pipeline #50252 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

Pipeline #50252 failed on a single stage, A100X-PyTorch-1, in test_unittests_v2[unittest/llmapi/test_llm_pytorch.py -m "part0"]. This is a pre-existing ambient failure on main, not caused by this PR:

  • 153 failures in the last 7 days across 33+ distinct unrelated PRs (16561, 16753, 16645, 16402, 16745, 16673, 12733, 16749, 16594, 16300, 15780, 16674, 14047, 16002, …).
  • Failure rate is stage-local to A100X: 152 FAILED / 465 runs = 33% on A100X-PyTorch-1, versus 1 FAILED / 335 runs = 0% on H100_PCIe-PyTorch-Ray-1 over the same window.
  • This PR does not touch that path: it changes tests/test_common/{http_utils,error_utils}.py, perf/test_perf_sanity.py and two l0_cpu_* lists. tests/unittest/llmapi/test_llm_pytorch.py does not import the changed modules, and parts 1/2/3 of the same file passed in this run — an import-level break would have failed all four.
  • Corroborating timing: part0 ran 2981s while parts 1/2/3 ran 352/392/259s, consistent with the known hang-shaped signature of this flake rather than an assertion failure.

Re-running CI.

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62109 [ run ] triggered by Bot. Commit: e7368ee Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62109 [ run ] completed with state SUCCESS. Commit: e7368ee
/LLM/main/L0_MergeRequest_PR pipeline #50292 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

Pipeline #50292 failed on DGX_H100-PyTorch-6, and this one is a Jenkins agent failure rather than a test failure:

  • Every test in the stage PASSED — the last is test_t5_pytorch_generate_encoder_decoder_end_to_end[bf16-kv-v1-cuda-graph-on-greedy-overlap-t5-small] at 05:56:16, with no FAILED entry anywhere in the stage log.
  • The stage then reported There is no results.xml file, skip the rerun stepRegular tests failed after rerun attempt, and report generation died with:
Cannot run program "nohup" (in directory ".../L0_Test-x86_64-Single-GPU/...")
  - Spawn helper ran into JDK version mismatch
  - Spawn helper ran into unexpected internal error
  - Spawn helper was terminated by another process
  • The agent host is cw-dfw-cs-001-login-02.cw-dfw-cs-001.hpc.nvidia.com. The identical failure hit an unrelated PR at the same time on the same host[TRTLLM-13409][fix] hard-kill all ranks when one rank's executor loop crashes #16592's DGX_H100-2_GPUs-PyTorch-GptOss-1 in pipeline #50295, same nohup/JDK spawn-helper error at ~05:56Z. This is one infrastructure incident affecting multiple pipelines, not a property of either PR.

Note this is a different ambient failure from the previous run (#50252, the A100X test_llm_pytorch part0 flake). Re-running CI.

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62132 [ run ] triggered by Bot. Commit: e7368ee Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62132 [ run ] completed with state SUCCESS. Commit: e7368ee
/LLM/main/L0_MergeRequest_PR pipeline #50311 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

Pipeline #50311 failed on DGX_H100-PyTorch-3, in disaggregated/test_disaggregated_single_gpu.py::test_disaggregated_logprobs[False-TinyLlama-1.1B-Chat-v1.0], which "terminated unexpectedly" alongside UCX transport errors:

pml_ucx.c:870  Error: ucx send failed: Connection reset by remote peer
dpm_disconnect_init: error -1 in isend to process 0

Not caused by this PR, on two independent grounds:

  1. The failing test does not touch anything this PR changes. test_disaggregated_single_gpu.py imports mpi4py, mpi4py.futures and the LLM API directly — no test_common.http_utils, no test_common.error_utils, no wait_for_endpoint_ready, no fail_if_proc_died. This PR modifies only perf/test_perf_sanity.py, those two test_common helpers, and two l0_cpu_* lists. Zero occurrences of any of them in the stage log.
  2. It is a known low-rate ambient flake. Over the last 7 days: 1312 runs — 1273 PASSED, 32 SKIPPED, 7 FAILED (0.53%) — and those 7 failures are spread across 7 distinct PRs: 13055, 15833, 16403, 16505, 16680, 16681, 16685. This PR accounts for exactly one of them.

Re-running CI.

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62219 [ run ] triggered by Bot. Commit: e7368ee Link to invocation

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

Superseding pipeline #62219, which had been running ~11h with no verdict. #16978 has merged, so the unittest/scaffolding blocker is cleared and a fresh run should be informative.

@JunyiXu-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62398 [ run ] triggered by Bot. Commit: e7368ee Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62219 [ run ] completed with state ABORTED. Commit: e7368ee

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62398 [ run ] completed with state SUCCESS. Commit: e7368ee
/LLM/main/L0_MergeRequest_PR pipeline #50564 completed with status: 'SUCCESS'

CI Report

Link to invocation

@JunyiXu-nv
JunyiXu-nv merged commit ebd197f into NVIDIA:main Jul 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants