Skip to content

Conversation

mikeiovine
Copy link
Collaborator

@mikeiovine mikeiovine commented Oct 8, 2025

Description

Cherry pick relesae/1.1 changes into main.

Test Coverage

N/A

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

  • 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.

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

  • Performance
    • Improved startup and latency with enhanced warmup sequencing (reverse and piecewise CUDA graph warmups) and more accurate KV‑cache block estimation.
  • Bug Fixes
    • Safer FP8/NVFP4 fusion handling with additional guards to prevent incorrect scaling selection.
  • Tests
    • Added FP8 TP2/PP2 accuracy test; updated pre‑merge test list; removed an obsolete multi‑GPU unit test.
  • Chores
    • Added precompiled kernel binaries (tracked via LFS) to support more hardware.
  • Style
    • Minor formatting cleanup.

@mikeiovine mikeiovine requested review from a team as code owners October 8, 2025 15:09
@mikeiovine
Copy link
Collaborator Author

/bot run --disable-fail-fast

@mikeiovine
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20805 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20806 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20805 [ run ] completed with state ABORTED

Copy link
Contributor

coderabbitai bot commented Oct 8, 2025

📝 Walkthrough

Walkthrough

Adds many Git LFS pointer files for precompiled cubins, a small header formatting fix, guarded fusion-scale checks in LLaMA models, CUDA-graph-aware KV-cache and expanded warmup sequencing in the model engine, refactors speculative drafter signature to accept LlmRequest, and updates tests.

Changes

Cohort / File(s) Summary
Formatting cleanup
cpp/tensorrt_llm/kernels/.../BatchedGemmInterface.h
Removed a stray empty line after alignPtr declaration. No API or logic changes.
Cubin LFS pointers (many new assets)
cpp/tensorrt_llm/kernels/trtllmGenKernels/batchedGemm/trtllmGen_bmm_export/cubins/*
Added numerous Git LFS pointer files for precompiled CUDA/CuBLAS/TensorRT kernels; each file contains LFS metadata (version, oid, size). No source, API, or runtime logic changes.
LLM fusion guard adjustments
tensorrt_llm/_torch/models/modeling_llama.py
tensorrt_llm/_torch/models/modeling_llama_min_latency.py
Tightened guards before accessing next_attn.qkv_proj.input_scale using hasattr and defaulted fusion branch to RESIDUAL_RMS_NORM when absent. Mirrored the guarded pattern across fusion locations; min_latency file contains an introduced line-continuation and a likely typo.
KV-cache estimation for CUDA graphs
tensorrt_llm/_torch/pyexecutor/_util.py
Account for CUDA graph warmup batch-size: compute max_cuda_graph_bs, derive cuda_graph_warmup_block, bump num_cache_blocks to cover warmup, and enforce lower bound relative to model batch size.
Model engine warmup flow and API
tensorrt_llm/_torch/pyexecutor/model_engine.py
Added least_requests: bool = True param to get_warmup_request, added general_warmup(reverse: bool=False), changed warmup sequencing to include reverse and piecewise CUDA-graph warmups, added logging, and adjusted request-splitting behavior based on least_requests.
Speculative drafter API change
tensorrt_llm/_torch/speculative/model_drafter.py
Changed get_draft_model_prompt to accept request: LlmRequest and return List[int]; internals now derive draft tokens from request and handle Eagle/context-init cases; call sites updated.
Integration test addition
tests/integration/defs/accuracy/test_llm_api_pytorch.py
Added test_fp8_tp2pp2 for Llama 3.3 70B Instruct with tensor_parallel_size=2 and pipeline_parallel_size=2; verifies FP8 quantization and runs accuracy benchmarks.
Test list updates
tests/integration/test_lists/test-db/l0_dgx_b200.yml
Added the new accuracy test to pre-merge list and removed one unittest entry from post-merge lists.
Unit test removal
tests/unittest/_torch/multi_gpu_modeling/test_llama3.py
Removed a multi-GPU Llama 3.3 unit test and related imports; no API changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant ME as ModelEngine
  participant GW as get_warmup_request
  participant GU as general_warmup
  participant CG as CUDA_Graph_Capture

  U->>ME: initialize(engine, config)
  ME->>GU: general_warmup(reverse=false)
  loop pre-capture warmups (small→large)
    GU->>GW: get_warmup_request(num_tokens, num_gen_tokens, least_requests=True)
    GU-->>ME: run warmup batch
  end

  alt CUDA graph enabled
    ME->>CG: capture graph (piecewise batches)
    note right of CG: capture uses selected batch sizes
    ME->>GU: general_warmup(reverse=true)
    loop post-capture warmups (large→small)
      GU->>GW: get_warmup_request(..., least_requests=False)
      GU-->>ME: run warmup batch
    end
  end

  ME-->>U: engine ready
  rect rgba(220,235,255,0.6)
    note right of GU: New/changed: general_warmup, reverse pass, piecewise capture, least_requests flag
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “[None][chore] Mass integration of release/1.1” follows the project’s naming template, concisely conveys the primary change of merging release/1.1 into main, and avoids unnecessary detail or noise.
Description Check ✅ Passed The PR description includes the required sections—Description, Test Coverage, PR Checklist, and GitHub Bot Help—and clearly states that the changes are a cherry-pick of release/1.1 into main with no associated tests. It follows the repository’s template structure and provides all essential information despite omitting the optional @coderabbitai summary directive.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • 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

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

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: 5

🧹 Nitpick comments (5)
tensorrt_llm/_torch/speculative/model_drafter.py (1)

31-45: Normalize tokens to List[int] and avoid in-place mutation of request tokens.

get_tokens(0) may return a tensor/pybind vector; ensure Python list[int] and copy before modifying to prevent side-effects on the original request.

Apply:

-def get_draft_model_prompt(spec_dec_mode: SpeculativeDecodingMode,
-                           request: LlmRequest) -> List[int]:
+def get_draft_model_prompt(spec_dec_mode: SpeculativeDecodingMode,
+                           request: LlmRequest) -> List[int]:
@@
-    draft_input_tokens = request.get_tokens(0)
+    tokens = request.get_tokens(0)
+    # Normalize to a Python List[int] and copy to avoid mutating request state.
+    if hasattr(tokens, "tolist"):
+        draft_input_tokens = list(tokens.tolist())
+    else:
+        draft_input_tokens = list(tokens)
@@
-        draft_input_tokens = draft_input_tokens[1:]
+        draft_input_tokens = draft_input_tokens[1:]
@@
-        draft_input_tokens.append(0)
+        draft_input_tokens.append(0)
     return draft_input_tokens

If you’re certain get_tokens already returns a list[int], keeping the tolist branch is harmless.

tensorrt_llm/_torch/pyexecutor/model_engine.py (3)

529-539: Harden inputs: reject invalid num_tokens/num_gen_tokens.

Add guards to avoid negative or inconsistent inputs (e.g., num_gen_tokens > num_tokens). It’s cheap and prevents silent misallocation.

Apply:

 def get_warmup_request(num_tokens: int,
                        num_gen_tokens: int,
                        least_requests: bool = True):
+    if num_tokens < 0 or num_gen_tokens < 0:
+        return None
     available_tokens = kv_cache_manager.get_num_available_tokens(
         self.runtime_draft_len)
     available_blocks = kv_cache_manager.get_num_free_blocks()
+    if num_gen_tokens > num_tokens:
+        return None
     if num_tokens > self.max_num_tokens or num_tokens > available_tokens:
         return None
     if num_gen_tokens > self.batch_size:
         return None

569-578: Defensive check to avoid division by zero in “most requests” path.

Current guards make max_bs > 0, but a small future change could break that assumption. Add an explicit early return.

Apply:

-    else:
-        max_bs = min(num_ctx_tokens,
-                     self.batch_size - num_gen_tokens)
+    else:
+        max_bs = min(num_ctx_tokens, self.batch_size - num_gen_tokens)
+        if max_bs <= 0:
+            return None
         if num_ctx_tokens % max_bs == 0:
             num_full_seqs = max_bs
         else:
             num_full_seqs = max_bs - 1
         max_seq_len = num_ctx_tokens // num_full_seqs
         num_left_over_tokens = num_ctx_tokens - max_seq_len * num_full_seqs

793-815: Comment typo and clarity.

Nit: “memory faction” → “memory fragmentation”; also clarify “num of requests” → “number of requests.”

Apply:

-# When using piecewise cuda graph, the logits may suffer severe memory faction problem.
-# When the num of requests is growing, the block allocated by torch cannot be reused.
+# When using piecewise CUDA graph, logits may suffer severe memory fragmentation.
+# As the number of requests grows, blocks allocated by torch may not be reused.
tests/integration/defs/accuracy/test_llm_api_pytorch.py (1)

646-669: LGTM; consider guarding world size explicitly.

Test mirrors tp4 variant and config is consistent. Optionally add skip_less_mpi_world_size(4) to ensure MPI world size matches 2x2 layout when running under MPI.

@mikeiovine
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20808 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20806 [ run ] completed with state ABORTED
LLM/main/L0_MergeRequest_PR #15730 (Blue Ocean) completed with status: ABORTED

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20808 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15732 completed with status: 'FAILURE'

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.

8 participants