Skip to content

Conversation

@yuanjingx87
Copy link
Collaborator

@yuanjingx87 yuanjingx87 commented Aug 22, 2025

Description

  1. previously multi node testing on slurm is using srun directly, and single node are installing jenkins agent on the node and launch docker container on the node to run the tests. With this PR, both single node and multi node tests are running directly with srun / sbatch
  2. Have a shared method to generate pytest command for both slurm job and blossom job.

Test Coverage

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

Summary by CodeRabbit

  • New Features
    • Unified single- and multi-node test runs with a single launch flow.
    • Automatic coverage config generation and injection into test runs.
    • Enhanced performance reporting with post-run sanity checks and comparison reports.
  • Refactor
    • Centralized test command construction and remote launcher execution.
    • Clearer stage names in the pipeline.
    • Default node count changed to 1 for test runs.
  • Chores
    • Improved environment setup (library paths, UCX settings) and host reporting.
    • Simplified resource cleanup and orchestration logic.

@yuanjingx87 yuanjingx87 requested review from a team as code owners August 22, 2025 17:07
@yuanjingx87 yuanjingx87 requested review from ruodil and xinhe-nv August 22, 2025 17:07
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 22, 2025

📝 Walkthrough

Walkthrough

Refactors Jenkins Slurm test orchestration to unify single- and multi-node flows under runLLMTestlistOnSlurm with a default nodeCount of 1, centralizes PyTest command construction, and shifts to a remote launcher script. The launcher script is overhauled to use placeholder substitution, dynamic coverage config, TRT-LLM wheel discovery, and optional perf post-processing.

Changes

Cohort / File(s) Summary
Jenkins Slurm orchestration refactor
jenkins/L0_Test.groovy
Switch shared library branch; unify cleanup: cleanUpNodeResourcesMultiNodescleanUpNodeResources; consolidate multi-/single-node: runLLMTestlistOnSlurm_MultiNodesrunLLMTestlistOnSlurm (default nodeCount=1); add getPytestBaseCommand; change getNodeArgs to return array and propagate array-based args; generate remote slurm_launch.sh and copy via Utils.copyScriptToRemoteHost; stages renamed; launchTestJobs updated to new entry point.
Slurm launcher script overhaul
jenkins/scripts/slurm_run.sh
Add set_value_in_command for placeholder substitution; build dynamic .coveragerc; detect TRT-LLM wheel path and inject into command; rework to execute pytestCommand; adjust LD_LIBRARY_PATH for tensorrt_llm; export UCX_TLS=^gdr_copy; remove some exports; update hostname reporting; add perf-mode post steps and reporting.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Jenkins Pipeline
  participant JL0 as L0_Test.groovy
  participant RH as Remote Host
  participant Slurm as Slurm (sbatch/srun)
  participant C as Container
  participant PT as PyTest
  participant Cov as Coverage
  participant Perf as Perf Tools

  Dev->>JL0: launchTestJobs(...)
  JL0->>JL0: getPytestBaseCommand(...)=pytestCommand
  JL0->>RH: copy slurm_launch.sh (Utils.copyScriptToRemoteHost)
  Dev->>RH: bash slurm_launch.sh

  Note over RH: Build .coveragerc, discover TRT-LLM wheel,<br/>substitute placeholders in pytestCommand

  alt nodeCount == 1
    RH->>Slurm: sbatch job (wrap pytestCommand)
  else nodeCount > 1
    RH->>Slurm: srun job (wrap pytestCommand)
  end

  Slurm->>C: start container with mounts/env
  C->>PT: execute pytestCommand
  PT-->>Cov: write coverage data
  alt perfMode
    C->>Perf: sanity_perf_check.py
    C->>Perf: create_perf_comparison_report.py
  end
  Slurm-->>RH: job status/exit code
  RH-->>JL0: result
  JL0-->>Dev: stage result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • pcastonguay
  • qiaoxj07
  • zeroepoch
  • litaotju

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

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)

1454-1454: Fix undefined variable reference.

The variable testCmdLine is referenced but never defined in the visible scope. This appears to be a bug from the refactoring.

The testCmdLine variable is undefined. It should likely be pytestCommand or the command components should be properly defined.

🧹 Nitpick comments (2)
jenkins/scripts/slurm_run.sh (1)

5-25: Consider adding error handling for command execution failures.

The set_value_in_command function returns 1 on error but doesn't handle the case where the substitution might fail. Consider using set -e or explicitly checking the return value when calling this function.

 set_value_in_command() {
     # Parameters
     local key="$1"
     local value="$2"
     local command="$3"
 
     # Transform the key
     local placeholder="__PLACEHOLDER_${key}__"
 
     # Check if placeholder exists
     if [[ "$command" != *"$placeholder"* ]]; then
         echo "Error: placeholder '$placeholder' not found in the command" >&2
         return 1
     fi
 
     # Replace all occurrences
     local result="${command//${placeholder}/${value}}"
+    
+    # Verify substitution was successful
+    if [[ "$result" == "$command" ]]; then
+        echo "Error: substitution failed for placeholder '$placeholder'" >&2
+        return 1
+    fi
 
     # Return the result
     echo "$result"
 }
jenkins/L0_Test.groovy (1)

231-231: Consider renaming function to reflect unified behavior.

The function name still contains "OnSlurm" but now handles both single and multi-node cases with different execution mechanisms (sbatch vs srun). Consider a more descriptive name like runLLMTestlistDistributed or documenting the dual behavior clearly.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b36460d and 0e04a90.

📒 Files selected for processing (2)
  • jenkins/L0_Test.groovy (9 hunks)
  • jenkins/scripts/slurm_run.sh (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
PR: NVIDIA/TensorRT-LLM#6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

Applied to files:

  • jenkins/scripts/slurm_run.sh
🪛 Shellcheck (0.10.0)
jenkins/scripts/slurm_run.sh

[warning] 40-40: hostname is referenced but not assigned.

(SC2154)


[warning] 40-40: stageName is referenced but not assigned.

(SC2154)


[warning] 49-49: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)


[warning] 51-51: nodeCount is referenced but not assigned.

(SC2154)


[warning] 91-91: perfMode is referenced but not assigned.

(SC2154)


[warning] 92-92: The arguments to this comparison can never be equal. Make sure your syntax is correct.

(SC2193)

🔇 Additional comments (2)
jenkins/L0_Test.groovy (2)

171-229: LGTM! Well-structured PyTest command builder.

The new getPytestBaseCommand function properly centralizes the PyTest command construction with clear parameter handling and appropriate configuration options.


265-266: Good use of utility functions for script management.

The refactoring to use Utils.createTempLocation and Utils.copyScriptToRemoteHost improves code maintainability and reduces duplication.

Also applies to: 389-395

@yuanjingx87
Copy link
Collaborator Author

/bot run --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1, A10-TensorRT-3, DGX_B200-4_GPUs-PyTorch-Post-Merge-1" --disable-fail-fast

@yuanjingx87 yuanjingx87 force-pushed the user/yuanjingx/slurm_test_refactor branch from 0e04a90 to c19f3c7 Compare August 22, 2025 17:40
@yuanjingx87
Copy link
Collaborator Author

/bot run --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1, A10-TensorRT-3, DGX_B200-4_GPUs-PyTorch-Post-Merge-1" --disable-fail-fast

@yuanjingx87 yuanjingx87 changed the title [TRTLLM-6055, TRTLLM-6052][Infrea] Slurm Test refactor [TRTLLM-6055][Infrea] Slurm Test refactor Aug 22, 2025
@yuanjingx87 yuanjingx87 changed the title [TRTLLM-6055][Infrea] Slurm Test refactor [TRTLLM-6055][infra] Slurm Test refactor Aug 22, 2025
@yuanjingx87
Copy link
Collaborator Author

/bot run --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1, A10-TensorRT-3, DGX_B200-4_GPUs-PyTorch-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16213 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16213 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #12191 (Partly Tested) completed with status: 'FAILURE'

@yuanjingx87 yuanjingx87 force-pushed the user/yuanjingx/slurm_test_refactor branch from c19f3c7 to b6ca29a Compare August 22, 2025 20:08
@yuanjingx87
Copy link
Collaborator Author

/bot run --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1, A10-TensorRT-3, DGX_B200-4_GPUs-PyTorch-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16217 [ run ] triggered by Bot

@yuanjingx87 yuanjingx87 force-pushed the user/yuanjingx/slurm_test_refactor branch 2 times, most recently from 02d90ff to 35151b8 Compare August 22, 2025 20:25
@yuanjingx87
Copy link
Collaborator Author

/bot run --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1, A10-TensorRT-3, DGX_B200-4_GPUs-PyTorch-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16219 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16217 [ run ] completed with state ABORTED

@yuanjingx87
Copy link
Collaborator Author

/bot run --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1, A10-TensorRT-3, DGX_B200-4_GPUs-PyTorch-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16220 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16220 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #12195 (Partly Tested) completed with status: 'FAILURE'

@yuanjingx87
Copy link
Collaborator Author

/bot run --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1, A10-TensorRT-3, DGX_B200-4_GPUs-PyTorch-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16232 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16232 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #12201 (Partly Tested) completed with status: 'FAILURE'

@yuanjingx87 yuanjingx87 force-pushed the user/yuanjingx/slurm_test_refactor branch from cd3e061 to 82d51b9 Compare August 23, 2025 02:38
@yuanjingx87
Copy link
Collaborator Author

/bot run --stage-list "GB200-8_GPUs-2_Nodes-PyTorch-Post-Merge-1, A10-TensorRT-3, DGX_B200-4_GPUs-PyTorch-Post-Merge-1" --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21818 [ run ] completed with state SUCCESS. Commit: 2a41b86
/LLM/main/L0_MergeRequest_PR pipeline #16445 completed with status: 'FAILURE'

@yuanjingx87
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21844 [ run ] triggered by Bot. Commit: 2a41b86

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21844 [ run ] completed with state SUCCESS. Commit: 2a41b86
/LLM/main/L0_MergeRequest_PR pipeline #16466 completed with status: 'FAILURE'

@yuanjingx87
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21863 [ run ] triggered by Bot. Commit: 4d6040e

@yuanjingx87 yuanjingx87 force-pushed the user/yuanjingx/slurm_test_refactor branch from 4d6040e to 095ddbe Compare October 20, 2025 06:12
@yuanjingx87
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21865 [ run ] triggered by Bot. Commit: 095ddbe

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21863 [ run ] completed with state ABORTED. Commit: 4d6040e
LLM/main/L0_MergeRequest_PR #16481 (Blue Ocean) completed with status: ABORTED

@yuanjingx87
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21865 [ run ] completed with state SUCCESS. Commit: 095ddbe
/LLM/main/L0_MergeRequest_PR pipeline #16483 completed with status: 'FAILURE'

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21888 [ run ] triggered by Bot. Commit: 095ddbe

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21888 [ run ] completed with state SUCCESS. Commit: 095ddbe
/LLM/main/L0_MergeRequest_PR pipeline #16501 completed with status: 'FAILURE'

@chzblych
Copy link
Collaborator

/bot skip --comment "Known irrelevant failure (CPP isolated testing)"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21923 [ skip ] triggered by Bot. Commit: 02a1ae1

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21923 [ skip ] completed with state SUCCESS. Commit: 02a1ae1
Skipping testing for commit 02a1ae1

@yuanjingx87 yuanjingx87 merged commit 1e3e147 into NVIDIA:main Oct 20, 2025
5 checks passed
govind-ramnarayan pushed a commit to nv-auto-deploy/TensorRT-LLM that referenced this pull request Oct 21, 2025
Signed-off-by: Yuanjing Xue <[email protected]>
Signed-off-by: Yanchao Lu <[email protected]>
Co-authored-by: Yanchao Lu <[email protected]>
yufeiwu-nv pushed a commit to yufeiwu-nv/TensorRT-LLM that referenced this pull request Oct 24, 2025
Signed-off-by: Yuanjing Xue <[email protected]>
Signed-off-by: Yanchao Lu <[email protected]>
Co-authored-by: Yanchao Lu <[email protected]>
Signed-off-by: yufeiwu-nv <[email protected]>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Nov 1, 2025
Signed-off-by: Yuanjing Xue <[email protected]>
Signed-off-by: Yanchao Lu <[email protected]>
Co-authored-by: Yanchao Lu <[email protected]>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Nov 3, 2025
Signed-off-by: Yuanjing Xue <[email protected]>
Signed-off-by: Yanchao Lu <[email protected]>
Co-authored-by: Yanchao Lu <[email protected]>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Nov 3, 2025
Signed-off-by: Yuanjing Xue <[email protected]>
Signed-off-by: Yanchao Lu <[email protected]>
Co-authored-by: Yanchao Lu <[email protected]>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Nov 3, 2025
Signed-off-by: Yuanjing Xue <[email protected]>
Signed-off-by: Yanchao Lu <[email protected]>
Co-authored-by: Yanchao Lu <[email protected]>
@yuanjingx87 yuanjingx87 deleted the user/yuanjingx/slurm_test_refactor branch November 17, 2025 23:45
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.

7 participants