-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[TRTLLM-6055][infra] Slurm Test refactor #7176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TRTLLM-6055][infra] Slurm Test refactor #7176
Conversation
📝 WalkthroughWalkthroughRefactors 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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
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 unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this 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
testCmdLineis referenced but never defined in the visible scope. This appears to be a bug from the refactoring.The
testCmdLinevariable is undefined. It should likely bepytestCommandor 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_commandfunction returns 1 on error but doesn't handle the case where the substitution might fail. Consider usingset -eor 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
runLLMTestlistDistributedor 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.
📒 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
getPytestBaseCommandfunction 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.createTempLocationandUtils.copyScriptToRemoteHostimproves code maintainability and reduces duplication.Also applies to: 389-395
|
/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 |
0e04a90 to
c19f3c7
Compare
|
/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 |
|
/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 |
|
PR_Github #16213 [ run ] triggered by Bot |
|
PR_Github #16213 [ run ] completed with state |
c19f3c7 to
b6ca29a
Compare
|
/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 |
|
PR_Github #16217 [ run ] triggered by Bot |
02d90ff to
35151b8
Compare
|
/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 |
|
PR_Github #16219 [ run ] triggered by Bot |
|
PR_Github #16217 [ run ] completed with state |
|
/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 |
|
PR_Github #16220 [ run ] triggered by Bot |
|
PR_Github #16220 [ run ] completed with state |
|
/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 |
|
PR_Github #16232 [ run ] triggered by Bot |
|
PR_Github #16232 [ run ] completed with state |
cd3e061 to
82d51b9
Compare
|
/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 |
|
PR_Github #21818 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #21844 [ run ] triggered by Bot. Commit: |
|
PR_Github #21844 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #21863 [ run ] triggered by Bot. Commit: |
Signed-off-by: Yuanjing Xue <[email protected]>
4d6040e to
095ddbe
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #21865 [ run ] triggered by Bot. Commit: |
|
PR_Github #21863 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #21865 [ run ] completed with state |
|
PR_Github #21888 [ run ] triggered by Bot. Commit: |
|
PR_Github #21888 [ run ] completed with state |
Signed-off-by: Yanchao Lu <[email protected]>
|
/bot skip --comment "Known irrelevant failure (CPP isolated testing)" |
|
PR_Github #21923 [ skip ] triggered by Bot. Commit: |
|
PR_Github #21923 [ skip ] completed with state |
Signed-off-by: Yuanjing Xue <[email protected]> Signed-off-by: Yanchao Lu <[email protected]> Co-authored-by: Yanchao Lu <[email protected]>
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]>
Signed-off-by: Yuanjing Xue <[email protected]> Signed-off-by: Yanchao Lu <[email protected]> Co-authored-by: Yanchao Lu <[email protected]>
Signed-off-by: Yuanjing Xue <[email protected]> Signed-off-by: Yanchao Lu <[email protected]> Co-authored-by: Yanchao Lu <[email protected]>
Signed-off-by: Yuanjing Xue <[email protected]> Signed-off-by: Yanchao Lu <[email protected]> Co-authored-by: Yanchao Lu <[email protected]>
Signed-off-by: Yuanjing Xue <[email protected]> Signed-off-by: Yanchao Lu <[email protected]> Co-authored-by: Yanchao Lu <[email protected]>
Description
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 thestage-listparameter 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.mdand the
scripts/test_to_stage_mapping.pyhelper.kill
killKill all running builds associated with pull request.
skip
skip --comment COMMENTSkip 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-pipelineReuse 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