[None][fix] Add ray stage with 4 h100 gpus to CI and fix sampled logprobs in TRTLLM sampler#9970
[None][fix] Add ray stage with 4 h100 gpus to CI and fix sampled logprobs in TRTLLM sampler#9970shuyixiong wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
|
/bot run --stage-list "DGX_H100-4_GPUs-PyTorch-Ray-1" |
|
PR_Github #28100 [ run ] triggered by Bot. Commit: |
|
PR_Github #28100 [ run ] completed with state |
|
/bot run --disable-fail-fast |
623d88c to
23378a6
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #28187 [ run ] triggered by Bot. Commit: |
📝 WalkthroughWalkthroughChanges expand multi-GPU test detection in merge request pipelines, add a new DGX H100 test configuration to the test matrix, and refactor logprob assignment logic in the PyTorch executor sampler to use zip() for correct seq_slot pairing. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
jenkins/L0_MergeRequest.groovy (1)
660-770: Multi-GPU detection: new Ray orchestrator path is correct; consider safer matching thancontains()on a joined string.
Addingtests/unittest/_torch/ray_orchestrator/multi_gpu/correctly makes Ray multi-GPU test edits trigger multi-GPU CI. However,changedFileListStr.contains(prefix)can false-positive and is harder to reason about than per-path checks.Suggested refactor (behavior-preserving for typical prefixes, avoids substring edge cases):
- def changedFileListStr = "," def relatedFileChanged = false try { - changedFileListStr = changedFileList.join(", ") - relatedFileChanged = relatedFileList.any { it -> - if (changedFileListStr.contains(it)) { - return true - } - } + relatedFileChanged = changedFileList.any { file -> + relatedFileList.any { rel -> file?.startsWith(rel) || file == rel } + } }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
jenkins/L0_MergeRequest.groovy(1 hunks)jenkins/L0_Test.groovy(1 hunks)tensorrt_llm/_torch/pyexecutor/sampler.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.py: The code developed for TensorRT-LLM should conform to Python 3.8+
Indent Python code with 4 spaces; do not use tabs
Always maintain the namespace when importing in Python, even if only one class or function from a module is used (e.g., usefrom package.subpackage import fooand thenfoo.SomeClass()instead offrom package.subpackage.foo import SomeClass)
Python filenames should use snake_case (e.g.,some_file.py)
Python class names should use PascalCase (e.g.,class SomeClass)
Python function and method names should use snake_case (e.g.,def my_awesome_function():)
Python local variable names should use snake_case, with prefixkfor variable names that start with a number (e.g.,k_99th_percentile = ...)
Python global variables should use upper snake_case with prefixG(e.g.,G_MY_GLOBAL = ...)
Python constants should use upper snake_case (e.g.,MY_CONSTANT = ...)
Avoid shadowing variables declared in an outer scope in Python
Initialize all externally visible members of a Python class in the constructor
For Python interfaces that may be used outside a file, prefer docstrings over comments
Python comments should be reserved for code within a function, or interfaces that are local to a file
Use Google style docstrings for Python classes and functions, which can be parsed by Sphinx
Python attributes and variables can be documented inline with type and description (e.g.,self.x = 5followed by"""<type>: Description of 'x'""")
Avoid using reflection in Python when functionality can be easily achieved without reflection
When using try-except blocks in Python, limit the except clause to the smallest set of specific errors possible instead of catching all exceptions
When using try-except blocks in Python to handle multiple possible variable types (duck-typing), keep the body of the try as small as possible and use the else block to implement the logic
Files:
tensorrt_llm/_torch/pyexecutor/sampler.py
**/*.{cpp,h,cu,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
All TensorRT-LLM Open Source Software code files should contain an NVIDIA copyright header that includes the current year at the top
Files:
tensorrt_llm/_torch/pyexecutor/sampler.py
🧠 Learnings (6)
📓 Common learnings
Learnt from: pengbowang-nv
Repo: NVIDIA/TensorRT-LLM PR: 7192
File: tests/integration/test_lists/test-db/l0_dgx_b200.yml:56-72
Timestamp: 2025-08-26T09:49:04.956Z
Learning: In TensorRT-LLM test configuration files, the test scheduling system handles wildcard matching with special rules that prevent duplicate test execution even when the same tests appear in multiple yaml files with overlapping GPU wildcards (e.g., "*b200*" and "*gb200*").
📚 Learning: 2025-12-12T03:27:18.859Z
Learnt from: tongyuantongyu
Repo: NVIDIA/TensorRT-LLM PR: 9655
File: tensorrt_llm/_torch/pyexecutor/sampler.py:3031-3031
Timestamp: 2025-12-12T03:27:18.859Z
Learning: In tensorrt_llm/_torch/pyexecutor/sampler.py, when reviewing code that iterates through requests, ensure it does not convert excessive data into Python lists. Instead, the code should use torch.gather or indexing to gather only the data that will be used in the for loop before converting to Python lists. This minimizes data movement and improves performance.
Applied to files:
tensorrt_llm/_torch/pyexecutor/sampler.py
📚 Learning: 2025-12-12T03:27:08.565Z
Learnt from: tongyuantongyu
Repo: NVIDIA/TensorRT-LLM PR: 9655
File: tensorrt_llm/_torch/pyexecutor/sampler.py:3031-3031
Timestamp: 2025-12-12T03:27:08.565Z
Learning: In files under tensorrt_llm/_torch/pyexecutor, avoid accessing torch.Tensor objects inside for-loops when iterating over requests. Convert batched tensors to Python lists beforehand using tensor.tolist(), and then iterate over those lists. This improves performance by reducing tensor-bound operations inside hot loops. Apply this pattern to similar code paths that process batches to access simple Python data structures (lists) inside loops.
Applied to files:
tensorrt_llm/_torch/pyexecutor/sampler.py
📚 Learning: 2025-08-28T10:25:22.370Z
Learnt from: ixlmar
Repo: NVIDIA/TensorRT-LLM PR: 7294
File: tensorrt_llm/_torch/pyexecutor/sampler.py:887-891
Timestamp: 2025-08-28T10:25:22.370Z
Learning: In tensorrt_llm/_torch/pyexecutor/sampler.py, the draft_probs and target_probs tensors have shapes [1, steps] not [steps, vocab_size] as might be expected, making the .squeeze(0) operations appropriate for removing the batch dimension of size 1.
Applied to files:
tensorrt_llm/_torch/pyexecutor/sampler.py
📚 Learning: 2025-08-13T16:20:37.987Z
Learnt from: dcampora
Repo: NVIDIA/TensorRT-LLM PR: 6867
File: tensorrt_llm/_torch/pyexecutor/sampler.py:67-72
Timestamp: 2025-08-13T16:20:37.987Z
Learning: In TensorRT-LLM sampler code, performance is prioritized over additional validation checks. The beam_width helper method intentionally returns the first request's beam_width without validating consistency across all requests to avoid performance overhead from iterating through the entire batch.
Applied to files:
tensorrt_llm/_torch/pyexecutor/sampler.py
📚 Learning: 2025-08-28T10:22:02.288Z
Learnt from: ixlmar
Repo: NVIDIA/TensorRT-LLM PR: 7294
File: tensorrt_llm/_torch/pyexecutor/sampler.py:1191-1197
Timestamp: 2025-08-28T10:22:02.288Z
Learning: In tensorrt_llm/_torch/pyexecutor/sampler.py, the object identity comparison `softmax_req_indices is not group_req_indices_cuda` on line ~1191 is intentional and used as an optimization to determine whether to reuse an existing indexer or create a new one, based on which code path was taken during tensor assignment.
Applied to files:
tensorrt_llm/_torch/pyexecutor/sampler.py
🪛 Ruff (0.14.8)
tensorrt_llm/_torch/pyexecutor/sampler.py
3052-3052: zip() without an explicit strict= parameter
Add explicit value for parameter strict=
(B905)
🔇 Additional comments (1)
jenkins/L0_Test.groovy (1)
2934-2957: New DGX H100 x4 Ray stage wiring looks consistent with existing routing (Ray + multi-GPU).
The added"DGX_H100-4_GPUs-PyTorch-Ray-1"entry should (a) pick up Ray via-Ray-and (b) be classified as multi-GPU via4_GPUs, matching the PR intent.
| log_probs_host = log_probs_host_tensor[seq_slots, 0, seq_lens].tolist() | ||
| idx = 0 | ||
| for request in reqs_with_new_tokens: | ||
| for seq_slot, request in zip(seq_slots, reqs_with_new_tokens): |
There was a problem hiding this comment.
Critical: Incorrect pairing of seq_slots with requests.
The zip(seq_slots, reqs_with_new_tokens) creates incorrect pairings because seq_slots is filtered (lines 3042-3048) to contain only requests where py_return_log_probs=True, while reqs_with_new_tokens contains all requests. When their lengths differ, zip() stops at the shorter length, causing:
- Requests with log probs may be paired with wrong seq_slots
- Some requests may be skipped entirely
Apply this fix to filter reqs_with_new_tokens before zipping:
+ reqs_with_log_probs = [r for r in reqs_with_new_tokens if r.py_return_log_probs]
idx = 0
- for seq_slot, request in zip(seq_slots, reqs_with_new_tokens):
- if request.py_return_log_probs:
+ for seq_slot, request in zip(seq_slots, reqs_with_log_probs, strict=True):
log_probs = [
{
new_tokens_host[seq_slot]: Logprob(
logprob=log_probs_host[idx],
rank=1,
)
}
]
cum_log_probs = [cum_log_probs_host[seq_slot]]
request.py_result.append_log_probs([log_probs], cum_log_probs)
idx += 1The strict=True parameter ensures the lengths match and will raise an error if they don't, preventing silent data corruption.
🧰 Tools
🪛 Ruff (0.14.8)
3052-3052: zip() without an explicit strict= parameter
Add explicit value for parameter strict=
(B905)
🤖 Prompt for AI Agents
In tensorrt_llm/_torch/pyexecutor/sampler.py around line 3052, the loop uses
zip(seq_slots, reqs_with_new_tokens) which pairs filtered seq_slots (only
requests with py_return_log_probs=True) with the full reqs_with_new_tokens list,
causing mispairing and dropped requests; fix by first filtering
reqs_with_new_tokens to the same subset used to build seq_slots (i.e., only
those requests where py_return_log_probs is True) and then iterate with
zip(filtered_seq_slots, filtered_reqs_with_new_tokens, strict=True) so lengths
must match and Python will raise if they do not, preventing silent data
corruption.
There was a problem hiding this comment.
This is valid issue. @shuyixiong please change to read from request.py_seq_slot sirectly.
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
|
PR_Github #28188 [ run ] triggered by Bot. Commit: |
23378a6 to
46d5570
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #28202 [ run ] triggered by Bot. Commit: |
Signed-off-by: Shuyi Xiong <219646547+shuyixiong@users.noreply.github.com>
46d5570 to
355d142
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #28235 [ run ] triggered by Bot. Commit: |
Signed-off-by: Shuyi Xiong <219646547+shuyixiong@users.noreply.github.com>
355d142 to
c5f2a72
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #28244 [ run ] triggered by Bot. Commit: |
|
PR_Github #28244 [ run ] completed with state |
Summary by CodeRabbit
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.
Description
Test Coverage
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)
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
/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.
Details
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.