Skip to content

[TRTLLMINF-40][fix] Throw typed InfraFailure when SLURM submission yields no job ID - #17255

Merged
brnguyen2 merged 3 commits into
NVIDIA:mainfrom
brnguyen2:user/brnguyen/slurm-null-jobid-typed-infrafailure
Aug 4, 2026
Merged

[TRTLLMINF-40][fix] Throw typed InfraFailure when SLURM submission yields no job ID#17255
brnguyen2 merged 3 commits into
NVIDIA:mainfrom
brnguyen2:user/brnguyen/slurm-null-jobid-typed-infrafailure

Conversation

@brnguyen2

@brnguyen2 brnguyen2 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Description

When sbatch submission fails (or the job ID is never captured), the stage dies later with a generic script returned exit code N that FailureClassifier cannot act on, so the stage-level infra retry (TRTLLMINF-43/-54 machinery) never fires — even though the job never entered the SLURM queue and nothing ran on any node. A week-long sweep of all L0_MergeRequest_PR failures (2026-07-28..08-04; 978 failed builds, 1124 infra-classified stage failures) found 179 stage failures in this family, and its cleanup side-effect (scontrol show job nullInvalid job id specified) was the single most common bogus "infra signature" in failure analysis.

Changes:

  • runLLMTestlistWithSbatch / Run Pytest: validate the captured job ID and throw InfraFailure(TRANSIENT, SLURM, <typed:slurm-submit-no-jobid>) when it is missing or non-numeric, so the existing retry loop in the SLURM stage wrapper retries the stage. The slurm_job_id.txt read now tolerates a missing file (|| true) so the typed throw is reached instead of a bare cat failure.
  • runLLMTestlistWithAgent / Request Node Via Slurm: same typed throw when the agent-mode submission yields no numeric job ID, instead of echoing and entering the node-wait loop (up to 15h) with a bogus ID.
  • Shared isValidSlurmJobId() digit-only validator (review follow-up): used at every guard site; String.isNumber() is a BigDecimal-style parse that accepts values like 1.5. captureSlurmWorkspaceMetadata drops non-numeric slurm_job_id.txt values instead of recording them, and captureSlurmJobNodeList revalidates before its sacct/scontrol node-list fallback.
  • cleanUpNodeResources: skip the scancel/sacct/scontrol dump when no numeric job ID exists, mirroring the existing guard in cleanUpSlurmResources. This stops scancel null / scontrol show job null noise from polluting per-stage logs and downstream failure analysis.

Test Coverage

Jenkins pipeline code — validated by Groovy parse-check and this PR's own L0 run. The typed-throw form matches the existing <typed:slurm-job-still-running> producer in the same file.

PR Checklist

  • PR title follows the required format
  • PR description addresses the problem and solution
  • Test coverage addressed (pipeline code; validated by this PR's CI run)

Dev Engineer Review

  • Added shared digit-only SLURM job ID validation in jenkins/L0_Test.groovy.
  • Applied validation to submission, state queries, placement recording, metadata recovery, cleanup, and diagnostics.
  • Agent and batch submission paths now throw typed transient InfraFailure exceptions when no usable job ID is captured.
  • Missing slurm_job_id.txt files are tolerated so the typed failure path executes.
  • Cleanup and diagnostic commands skip invalid or missing job IDs. This prevents misleading Invalid job id specified errors.
  • Changes support existing stage-level infrastructure retries.
  • Groovy parsing and the PR's L0 CI run provide validation.

QA Engineer Review

No test changes.

…elds no job ID

When sbatch submission fails (or the job ID is never captured), the
stage currently dies later with a generic 'script returned exit code
N' that FailureClassifier cannot act on, so the stage-level infra
retry never fires even though nothing ever ran on a node. A week-long
sweep of L0_MergeRequest_PR failures (2026-07-28..08-04) found 179
stage failures in this family.

- Run Pytest (sbatch path): validate the captured job ID and throw
  InfraFailure(TRANSIENT, SLURM, <typed:slurm-submit-no-jobid>) when
  it is missing or non-numeric, so runLLMTestlistOnSlurm retries the
  stage. The slurm_job_id.txt read tolerates a missing file so the
  typed throw is reached instead of a bare cat failure.
- cleanUpNodeResources: skip the scancel/sacct/scontrol dump when no
  numeric job ID exists (mirrors the existing guard in
  cleanUpSlurmResources). Running it with a null ID emits
  'scontrol_print_job error: Invalid job id specified', which then
  pollutes failure analysis as a bogus infra signature - it was the
  single most common unmatched 'error' in the sweep.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
@brnguyen2
brnguyen2 requested a review from a team as a code owner August 4, 2026 13:33
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

SLURM job IDs now use shared digit-only validation across cleanup, state queries, submission, placement recording, and metadata recovery. Invalid IDs skip diagnostics and placement queries. Missing or invalid submission IDs raise typed transient InfraFailure exceptions.

Changes

SLURM job ID handling

Layer / File(s) Summary
SLURM validation and cleanup
jenkins/L0_Test.groovy
A shared validator accepts only nonempty digit-only IDs. Cleanup and state queries skip SLURM commands for invalid IDs.
SLURM submission and metadata recovery
jenkins/L0_Test.groovy
Agent submission and batch metadata recovery raise typed transient SLURM InfraFailure exceptions when no usable job ID exists.
SLURM placement and node capture
jenkins/L0_Test.groovy
Placement metadata and final node-list capture discard invalid IDs before propagation or sacct and scontrol queries.

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

Suggested reviewers: niukuo

🚥 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 clearly identifies the primary change: typed InfraFailure handling for SLURM submissions without a job ID.
Description check ✅ Passed The description explains the problem, solution, affected paths, test coverage, and relevant checklist items.
✨ 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: 1

🤖 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 `@jenkins/L0_Test.groovy`:
- Around line 739-755: Replace every SLURM job-ID guard using
isNumber()—including the guards near the cleanup dump and the typed InfraFailure
path—with a digit-only check equivalent to jobId.toString() ==~ /\d+/. Apply
this consistently at all four locations, and update associated messages to
report missing or invalid non-integer IDs while preserving the existing command
and exception behavior.
🪄 Autofix

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: 2884a5f3-7014-41ae-a9d6-7ad9fd2a2ded

📥 Commits

Reviewing files that changed from the base of the PR and between fd0b4bb and e3974ef.

📒 Files selected for processing (1)
  • jenkins/L0_Test.groovy

Comment thread jenkins/L0_Test.groovy
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63767 [ run ] triggered by Bot. Commit: e3974ef Link to invocation

Groovy's String.isNumber() is an alias for isBigDecimal(), so a decimal
like '1.5' passes the guard and still produces invalid scancel/sacct/
scontrol invocations. Use a digit-only match (==~ /\d+/) at all five
job-ID guard sites and mention the non-numeric case in the typed
InfraFailure message. Addresses CodeRabbit review on PR NVIDIA#17255.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>

@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)
jenkins/L0_Test.groovy (1)

1979-1987: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Preserve the typed failure for submission errors.

Because set -eEeuo pipefail makes the submission script exit when sbatch fails or returns no job ID, Utils.exec raises before the typed InfraFailure check. Capture the submission status without aborting, record an empty ID, and continue to that validation block.

🤖 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 `@jenkins/L0_Test.groovy` around lines 1979 - 1987, Update the submission flow
surrounding slurmJobId and its typed validation so sbatch failures or missing
job IDs do not cause Utils.exec to throw before the InfraFailure check. Capture
the submission command’s failure status without aborting, ensure slurmJobId is
empty when submission produces no ID, and continue into the existing typed
failure validation.
🤖 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 `@jenkins/L0_Test.groovy`:
- Around line 1990-1998: Introduce and reuse a shared digit-only SLURM job ID
validator in the finalizer diagnostics path, immediately before the sacct and
scontrol calls in captureSlurmJobNodeList. Ensure captureSlurmWorkspaceMetadata
does not retain nonempty but invalid IDs in placementContext, and preserve the
existing rejection of unusable IDs in the submission flow.
- Around line 1990-1998: Validate slurmJobId before passing it to
recordSlurmPlacementContext or storing it in placementContext, so rejected
values cannot reach the finally block. Ensure captureSlurmJobNodeList also
accepts only a non-empty numeric job ID before constructing the sacct shell
command, preserving the existing no-job-ID failure behavior and preventing
untrusted payloads from reaching shell sinks.
- Around line 1007-1009: Replace the echo statement in the slurmJobID validation
guard with a throw statement that raises an InfraFailure with InfraFailure.SLURM
to fail fast before reaching the SlurmConfig.checkJobStatus call at Line 1028
and the downstream sacct and scontrol command construction. The condition
checking !slurmJobID or the regex mismatch on slurmJobID.toString() should
remain unchanged, but instead of logging the failure, throw the typed exception
to prevent the wait loop from executing with an invalid job ID.

---

Outside diff comments:
In `@jenkins/L0_Test.groovy`:
- Around line 1979-1987: Update the submission flow surrounding slurmJobId and
its typed validation so sbatch failures or missing job IDs do not cause
Utils.exec to throw before the InfraFailure check. Capture the submission
command’s failure status without aborting, ensure slurmJobId is empty when
submission produces no ID, and continue into the existing typed failure
validation.
🪄 Autofix

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: 63759a66-b14c-4060-a806-ee068e304aa8

📥 Commits

Reviewing files that changed from the base of the PR and between e3974ef and 5f24cb3.

📒 Files selected for processing (1)
  • jenkins/L0_Test.groovy

Comment thread jenkins/L0_Test.groovy Outdated
Comment thread jenkins/L0_Test.groovy Outdated
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63767 [ run ] completed with state SUCCESS. Commit: e3974ef
/LLM/main/L0_MergeRequest_PR pipeline #51718 completed with status: 'FAILURE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Ask a member of NVIDIA/trt-llm-ci-approvers to add the label, then re-trigger CI with the same bot command (no rebase needed).

⚠️ 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

@dpitman-nvda dpitman-nvda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM but please take a look at and resolve the CodeRabbit comments before approval.

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63797 [ run ] triggered by Bot. Commit: 5f24cb3 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63797 [ run ] completed with state SUCCESS. Commit: 5f24cb3
/LLM/main/L0_MergeRequest_PR pipeline #51743 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

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63820 [ run ] triggered by Bot. Commit: 5f24cb3 Link to invocation

…igit-only job-ID validator

- runLLMTestlistWithAgent: throw the typed InfraFailure(TRANSIENT, SLURM,
  <typed:slurm-submit-no-jobid>) instead of only echoing, so the stage
  retries immediately rather than polling a bogus job ID in the node-wait
  loop (up to 15h).
- Extract isValidSlurmJobId() and use it at all guard sites.
- captureSlurmWorkspaceMetadata: drop non-numeric slurm_job_id.txt values
  instead of recording them in placementContext.
- captureSlurmJobNodeList: revalidate the job ID before the sacct/scontrol
  node-list fallback, so rejected IDs cannot re-enter finalizer diagnostics.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63822 [ run ] triggered by Bot. Commit: efab03c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63820 [ run ] completed with state ABORTED. Commit: 5f24cb3

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63822 [ run ] completed with state SUCCESS. Commit: efab03c
/LLM/main/L0_MergeRequest_PR pipeline #51763 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

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63831 [ run ] triggered by Bot. Commit: efab03c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63831 [ run ] completed with state FAILURE. Commit: efab03c
/LLM/main/L0_MergeRequest_PR pipeline #51771 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Ask a member of NVIDIA/trt-llm-ci-approvers to add the label, then re-trigger CI with the same bot command (no rebase needed).

⚠️ 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

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot skip --comment "This only affects potential infra failure paths; failure seen in latest job is test-only"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63864 [ skip ] triggered by Bot. Commit: efab03c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63864 [ skip ] completed with state SUCCESS. Commit: efab03c
Skipping testing for commit efab03c

Link to invocation

@brnguyen2
brnguyen2 merged commit 1982523 into NVIDIA:main Aug 4, 2026
13 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.

3 participants