Skip to content

Conversation

@mikeiovine
Copy link
Collaborator

@mikeiovine mikeiovine commented Nov 4, 2025

Description

Cherry pick the commits before the major dependency update.

Currently excluded due to high amount of conflicts

Excluded CUDA 13 runtime dependencies as well: #8858. These are related to the DLFW upgrade, which is being done separately for now.

Also excluded this WAR for a transient CI issue: #8616

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.

JunyiXu-nv and others added 12 commits November 4, 2025 11:21
… info with CI failure. (NVIDIA#8440)

Signed-off-by: Simeng Liu <[email protected]>
Signed-off-by: Mike Iovine <[email protected]>
…acy test result (NVIDIA#8609)

Signed-off-by: Lizhi Zhou <[email protected]>
Signed-off-by: Mike Iovine <[email protected]>
Signed-off-by: Ivy Zhang <[email protected]>
Co-authored-by: Larry Xu <[email protected]>
Signed-off-by: Mike Iovine <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 4, 2025

📝 Walkthrough

Walkthrough

This PR contains coordinated changes across C++ KV cache management, CUDA kernel synchronization, PyTorch model implementations, distributed execution infrastructure, and test configurations. Key changes include safer sequence access patterns, stream management refactoring, EXAONE4 model enhancements, termination handler redesign for disaggregated processing, and test infrastructure updates.

Changes

Cohort / File(s) Summary
C++ KV Cache Manager Safety
cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
Added guard lookups with mutex locks to safely check sequence presence in mSequences before access; replaced direct map access with helper function to prevent undefined behavior.
CUDA Kernel Synchronization
cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
Expanded CUDA architecture gate from SM 900+ to SM 700+; switched inline assembly from red.global.gpu.add.u32 to red.release.global.gpu.add.u32 with atomicAdd fallback for older architectures.
PyTorch CUDA Graph Workspace
tensorrt_llm/_torch/attention_backend/trtllm.py
Added cuda_graph_workspace field to TrtllmAttentionMetadata; initialize in _post_init_with_buffers and conditionally select workspace in forward based on CUDA graph usage.
PyTorch Backend Stream Management
tensorrt_llm/_torch/compilation/backend.py
Replaced aux_streams list with single num_streams count attribute; updated multi-stream scheduling and event calculations to use stream-count-based approach.
Distributed Communication API
tensorrt_llm/_torch/distributed/communicator.py
Added root parameter to MPIDist.pp_gather signature with default value 0; forwards to underlying pp_comm.gather call.
EXAONE4 Model Enhancements
tensorrt_llm/_torch/models/modeling_exaone4.py
Added QuantAlgo import and disable_deep_gemm flag to Exaone4Attention and Exaone4DecoderLayer; propagates quantization-based optimization control to both attention and MLP paths.
LLAMA Quantization Fusion Logic
tensorrt_llm/_torch/models/modeling_llama.py
Replaced next_attn-based NVFP4 guards with fusion operation type checks (post_feed_forward_fusion_op against RESIDUAL_RMS_NORM_QUANT_NVFP4); affects unpacking of allreduce output in post-MLP fusion path.
PyTorch Executor Infrastructure
tensorrt_llm/_torch/pyexecutor/model_engine.py
Introduced backend_num_streams attribute to PyTorchModelEngine; replaces reference to _torch_compile_backend.aux_streams for model extra attributes.
Disaggregated PP Termination Refactoring
tensorrt_llm/_torch/pyexecutor/py_executor.py
Redesigned DisaggPPTerminationHandler constructor (now accepts dist and terminator_func callback); replaced sync method with new terminate_pending_requests using ring-protocol coordination; updated all invocation sites in PyExecutor.
Executor Max Tokens Guard
tensorrt_llm/executor/base_worker.py
Added default_max_tokens > 0 condition to max tokens deduction logic; prevents clamping to non-positive defaults and preserves user-provided max_tokens in edge cases.
IPC Address Generation
tensorrt_llm/llmapi/trtllm-llmapi-launch
Replaced free TCP port-based IPC with UUID-based ipc://<tempdir>/rpc_test_<uuid> address; moved behind MPI rank check to run only on rank 0.
Disaggregated Serving Test Infrastructure
tests/integration/defs/accuracy/test_disaggregated_serving.py
Added per-server log redirection with output_<server_name>_<index>.log files; split multi_popen into three calls for ctx, gen, disagg servers; introduced health-check loop querying /health endpoint; added enable_block_reuse: True to kv_cache_config; removed skip_pre_hopper decorator.
LLM API PyTorch Test Rename
tests/integration/defs/accuracy/test_llm_api_pytorch.py
Renamed test_fp8_tp2pp2 to test_fp4_tp2pp2; updated model path to FP4 variant; adjusted quantization assertions to expect QuantAlgo.NVFP4.
CUDA Cache Cleanup
tests/integration/defs/conftest.py
Added gc.collect() call before torch.cuda.empty_cache() in torch_empty_cache fixture.
Disaggregated Single GPU Tests
tests/integration/defs/disaggregated/test_disaggregated_single_gpu.py
Added free_gpu_memory_fraction=0.4 to KvCacheConfig in spec-dec batch tests.
Serve Test Backend Update
tests/integration/defs/examples/serve/test_serve.py
Changed decorator from @skip_pre_hopper to @skip_no_hopper for test_extra_llm_api_options; added MOE backend FP8 blockscale documentation.
E2E Test Configuration
tests/integration/defs/test_e2e.py
Added dynamic SM version checks via get_sm_version(); branched MoE backend selection and KV cache fraction on Blackwell detection; updated GPU count for Llama3.1-70B-BF16 from 2 to 8; adjusted performance mapping values.
Test Lists & Test DB
tests/integration/test_lists/qa/llm_function_core.txt, llm_function_core_sanity.txt, llm_function_nim.txt, l0_b200.yml, l0_dgx_b200.yml, l0_h100.yml, waives.txt
Updated test selections: replaced FP8 TP2PP2 with FP4 TP2PP2; changed multi-GPU model references from 2-GPU to 8-GPU variants; added disaggregated and EXAONE4 test entries; removed waiver exemptions.
Unit Test Infrastructure & Skip Markers
tests/unittest/_torch/auto_deploy/_utils_test/_model_test_utils.py, _torch/modeling/test_modeling_exaone4.py, _torch/multi_gpu/test_mnnvl_allreduce.py, _torch/multi_gpu_modeling/test_deepseek.py, _torch/thop/parallel/test_fp8_rowwise_linear.py, _torch/thop/serial/test_moe.py, llmapi/test_llm.py
Added EXAONE4 FP8 quantization config and test_llm_load test; removed blank lines; removed tp_size==4 skip in Deepseek; replaced @skip_pre_hopper with @skip_blackwell; added pytest.skip calls for MoE FP4 tests due to NV bugs; removed skip marker on workspace test.

Sequence Diagram(s)

sequenceDiagram
    participant PyEx as PyExecutor
    participant DTermH as DisaggPPTerminationHandler
    participant Dist as Distributor
    participant App as Application
    Note over PyEx,App: Old Flow: Synchronous Per-Microbatch
    PyEx->>DTermH: sync(microbatch_idx)
    DTermH->>DTermH: local_termination check
    DTermH->>DTermH: cleanup() & await handles
    PyEx->>App: Process terminated requests
    
    Note over PyEx,App: New Flow: Ring Protocol Per-Iteration
    loop Each Executor Iteration
        PyEx->>DTermH: terminate_pending_requests()
        DTermH->>Dist: Send new_term_state (ready/term data)
        DTermH->>Dist: Recv new_term_state from neighbor
        DTermH->>DTermH: Decide terminations locally
        DTermH->>App: terminator_func() for each finalized request
        DTermH->>DTermH: Increment _terminating_iteration
    end
Loading
sequenceDiagram
    participant Test as Test Process
    participant MultiPopen as multi_popen
    participant Server as Server Process
    participant LogFile as Log File
    
    Note over Test,LogFile: Disaggregated Serving Startup
    Test->>MultiPopen: Start ctx_processes (server_name="ctx")
    activate MultiPopen
    MultiPopen->>Server: Launch with log redirect
    Server->>LogFile: stdout/stderr → output_ctx_0.log
    MultiPopen-->>Test: ctx process handle
    deactivate MultiPopen
    
    Test->>MultiPopen: Start gen_processes (server_name="gen")
    activate MultiPopen
    MultiPopen->>Server: Launch with log redirect
    Server->>LogFile: stdout/stderr → output_gen_0.log
    MultiPopen-->>Test: gen process handle
    deactivate MultiPopen
    
    Test->>MultiPopen: Start disagg_processes (server_name="disagg")
    activate MultiPopen
    MultiPopen->>Server: Launch with log redirect
    Server->>LogFile: stdout/stderr → output_disagg_0.log
    MultiPopen-->>Test: disagg process handle
    deactivate MultiPopen
    
    Test->>Test: Health check loop
    loop Until 200 or timeout
        Test->>Server: GET http://localhost:8000/health
        Server-->>Test: 200 OK (ready)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Areas requiring extra attention:

  • DisaggPPTerminationHandler refactoring (tensorrt_llm/_torch/pyexecutor/py_executor.py): Major API redesign shifting from synchronous per-microbatch to ring-protocol coordination; constructor signature changed significantly; internal state management restructured.
  • LLAMA post-feed-forward fusion logic (tensorrt_llm/_torch/models/modeling_llama.py): Behavioral change from next_attn-based guards to fusion-operation-type checks; impacts unpacking logic in critical forward path.
  • Disaggregated serving test restructuring (tests/integration/defs/accuracy/test_disaggregated_serving.py): Complex multi-process coordination with three separate server groups, log redirection, and health-check polling; significant control flow reorganization.
  • KV cache manager safety guards (cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp): Mutex-protected sequence lookups; verify locking correctness and thread-safety implications.
  • Stream management refactoring (tensorrt_llm/_torch/compilation/backend.py, tensorrt_llm/_torch/pyexecutor/model_engine.py): Transition from aux_streams list to num_streams count; verify all references updated consistently.

Possibly related PRs

Suggested reviewers

  • liji-nv
  • yuxianq

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning PR description is minimal and lacks required template sections. Missing detailed explanation of changes, proper ticket/issue reference format, and comprehensive test coverage details. Add a proper PR title following [JIRA/NVBugs/GitHub issue][type] format, expand the Description section with detailed explanation of changes, and provide specific test coverage information beyond 'N/A'.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title '[None][chore] Weekly mass integration of release/1.1' is directly related to the changeset, which contains a mass integration of multiple commits from the release/1.1 branch into main.
✨ 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: 8

🧹 Nitpick comments (12)
cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu (1)

113-126: Consider adding documentation for memory ordering semantics.

While the implementation is correct, the cta_arrive() function would benefit from brief comments explaining the memory ordering choices across different architectures, particularly:

  • The role of .release semantics in ensuring visibility of prior memory operations
  • Why red.async.release is used for sm_100+ vs. synchronous red.release for sm_70-99
  • The synchronization protocol assumptions (paired with the volatile load spin-wait in wait_and_update())

This would help future maintainers understand the correctness requirements and architectural tradeoffs.

tensorrt_llm/_torch/models/modeling_exaone4.py (1)

134-140: The workaround logic is correct, though consider simplifying quant_config access.

The disable_deep_gemm computation correctly identifies FP8_BLOCK_SCALES quantization to work around the documented memory access issue. The logic is sound.

For consistency, since Line 131 directly accesses model_config.quant_config, you could simplify lines 135-139 to use the same pattern instead of getattr:

 disable_deep_gemm = False
-quant_config = getattr(model_config, "quant_config", None)
-if quant_config is not None:
+if model_config.quant_config is not None:
     # EXAONE4 fp8 has an illegal memory access issue with deep_gemm.
-    disable_deep_gemm = getattr(quant_config, "quant_algo",
-                                None) == QuantAlgo.FP8_BLOCK_SCALES
+    disable_deep_gemm = model_config.quant_config.quant_algo == QuantAlgo.FP8_BLOCK_SCALES
tests/unittest/_torch/thop/serial/test_moe.py (1)

1152-1152: Consider using a class-level skip decorator for better maintainability.

Both test_autotune (line 1065) and test_no_autotune (line 1152) methods in TestMoeFp4 are skipped with the same bug reference. Consider applying @pytest.mark.skip("https://nvbugs/5575841") at the class level instead to avoid duplication and improve maintainability.

Apply this diff to use a class-level skip:

+@pytest.mark.skip("https://nvbugs/5575841")
 class TestMoeFp4:
     """
     Test the NVFP4 MoE. As autotune also covers the actual MoE, we can run the test
     with autotune by default. We add a separate test for no autotune to ensure that
     the default tactic selection works. This reduces unnecessary test runs for CI
     """

And remove the individual skips from lines 1065 and 1152.

tests/integration/defs/accuracy/test_llm_api_pytorch.py (1)

655-655: Rename aligns with FP4 path; consider naming clarity.

Switch to FP4 is correct. Optional: rename to test_nvfp4_tp2pp2 for consistency with QuantAlgo.NVFP4 to avoid ambiguity between generic “FP4” and “NVFP4”.

tests/unittest/_torch/modeling/test_modeling_exaone4.py (1)

57-59: Runtime risk: increased layers from 4→32.

Intent (trigger deep_gemm path) is clear, but 32 layers at hidden_size=5120 can inflate test time/mem. Consider lowering to the minimal depth that still reproduces the issue, or guard with a tighter input size/timeout.

Please confirm CI runtime for this test remains within budget.

tests/integration/test_lists/test-db/l0_b200.yml (1)

81-84: Potential duplicate/contradictory singlegpu entries.

You add:

  • singlegpu with -k "not test_trtllm_bench_backend_comparison"
  • and singlegpu (unfiltered)

The unfiltered line will still run the excluded test, possibly duplicating the rest. Clarify intent; keep only one or split into mutually exclusive subsets.

tensorrt_llm/llmapi/trtllm-llmapi-launch (1)

27-29: Update function and variable names to reflect IPC usage.

The function name export_free_tcp_addr_for_spawn_proxy_process and variable name free_port suggest TCP usage, but the implementation now generates an IPC address using Unix domain sockets. This naming mismatch can mislead maintainers.

Consider renaming:

-function export_free_tcp_addr_for_spawn_proxy_process {
+function export_ipc_addr_for_spawn_proxy_process {
     # Generate unique IPC address without importing tensorrt_llm to avoid MPI initialization conflicts
-    local free_port=$(python3 -c "import uuid, tempfile, os; print(f'ipc://{os.path.join(tempfile.gettempdir(), \"rpc_test_\" + str(uuid.uuid4()))}')")
-    export TLLM_SPAWN_PROXY_PROCESS_IPC_ADDR=$free_port
+    local ipc_addr=$(python3 -c "import uuid, tempfile, os; print(f'ipc://{os.path.join(tempfile.gettempdir(), \"rpc_test_\" + str(uuid.uuid4()))}')")
+    export TLLM_SPAWN_PROXY_PROCESS_IPC_ADDR=$ipc_addr
     log_stderr "TLLM_SPAWN_PROXY_PROCESS_IPC_ADDR: $TLLM_SPAWN_PROXY_PROCESS_IPC_ADDR"

And update the call site at line 43:

-    export_free_tcp_addr_for_spawn_proxy_process
+    export_ipc_addr_for_spawn_proxy_process
tests/integration/defs/conftest.py (1)

2677-2685: Early GC before CUDA cache clear is reasonable.

Looks good and may reduce OOMs by dropping Python refs before empty_cache().

If test time is a concern, consider gating the pre-empty_cache gc.collect() behind an env flag (e.g., TLLM_GC_BEFORE_EMPTY_CACHE=1).

tests/integration/defs/test_e2e.py (1)

2208-2208: Make Blackwell check explicit.

Use get_sm_version() >= 100 instead of > 90 for clarity and future-proofing.

-    is_blackwell = get_sm_version() > 90
+    is_blackwell = get_sm_version() >= 100
cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp (1)

2145-2146: Thread-safety of getNumTokens read.

Using getSequence(...) improves access, but getNumTokens() is read outside mSequencesMtx. If GenerationRequest isn’t internally thread-safe for reads, prefer fetching the count while holding the lock or add a small accessor that returns the value under lock.

tensorrt_llm/_torch/distributed/communicator.py (1)

408-410: Unify pp_gather parameter naming with TorchDist; consider large-object safety.

MPIDist uses root while TorchDist uses dst. This can break kwargs at call sites. Either accept both or standardize.

Also, PP gather still uses plain MPI gather; if objects can be large, consider safe_gather() like tp_gather.

Example change outside this hunk (TorchDist) to accept both:

def pp_gather(self, obj, dst=0, root=None):
    if root is not None:
        dst = root
    # rest unchanged...
tests/integration/defs/accuracy/test_disaggregated_serving.py (1)

189-205: Ensure redirected log files are closed on failures

When enable_redirect_log is true and popen(...) raises before we reach the manual cleanup loop, the opened log file handle is leaked because it never gets registered with the ExitStack. Let the stack manage both the file and the subprocess context so the descriptor is closed even on startup errors.

Apply this diff to manage the resources via the stack:

-        processes = []
-        log_files = []
-        try:
-            for i, (env, args) in enumerate(server_configs):
-                if enable_redirect_log:
-                    f = open(f"output_{server_name}_{i}.log", "w+")
-                    env["TLLM_LOG_LEVEL"] = "INFO"
-                    proc = popen(args, env=env, stdout=f, stderr=f)
-                    log_files.append(f)
-                else:
-                    proc = popen(args, env=env)
-                processes.append(proc)
-
-            with contextlib.ExitStack() as stack:
-                opened_processes = [
-                    stack.enter_context(proc) for proc in processes
-                ]
-                yield opened_processes
-            for f in log_files:
-                f.close()
+        try:
+            with contextlib.ExitStack() as stack:
+                opened_processes = []
+                for i, (env, args) in enumerate(server_configs):
+                    if enable_redirect_log:
+                        log_file = stack.enter_context(
+                            open(f"output_{server_name}_{i}.log", "w+"))
+                        env["TLLM_LOG_LEVEL"] = "INFO"
+                        proc_ctx = popen(
+                            args, env=env, stdout=log_file, stderr=log_file)
+                    else:
+                        proc_ctx = popen(args, env=env)
+                    opened_processes.append(stack.enter_context(proc_ctx))
+                yield opened_processes
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70e4d72 and 6925f4b.

📒 Files selected for processing (32)
  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp (2 hunks)
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu (1 hunks)
  • jenkins/L0_Test.groovy (1 hunks)
  • tensorrt_llm/_torch/attention_backend/trtllm.py (3 hunks)
  • tensorrt_llm/_torch/compilation/backend.py (3 hunks)
  • tensorrt_llm/_torch/distributed/communicator.py (1 hunks)
  • tensorrt_llm/_torch/models/modeling_exaone4.py (5 hunks)
  • tensorrt_llm/_torch/models/modeling_llama.py (2 hunks)
  • tensorrt_llm/_torch/pyexecutor/model_engine.py (2 hunks)
  • tensorrt_llm/_torch/pyexecutor/py_executor.py (4 hunks)
  • tensorrt_llm/executor/base_worker.py (1 hunks)
  • tensorrt_llm/llmapi/trtllm-llmapi-launch (2 hunks)
  • tests/integration/defs/accuracy/test_disaggregated_serving.py (4 hunks)
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py (1 hunks)
  • tests/integration/defs/conftest.py (1 hunks)
  • tests/integration/defs/disaggregated/test_disaggregated_single_gpu.py (1 hunks)
  • tests/integration/defs/examples/serve/test_serve.py (2 hunks)
  • tests/integration/defs/test_e2e.py (6 hunks)
  • tests/integration/test_lists/qa/llm_function_core.txt (2 hunks)
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt (2 hunks)
  • tests/integration/test_lists/qa/llm_function_nim.txt (1 hunks)
  • tests/integration/test_lists/test-db/l0_b200.yml (1 hunks)
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml (1 hunks)
  • tests/integration/test_lists/test-db/l0_h100.yml (1 hunks)
  • tests/integration/test_lists/waives.txt (0 hunks)
  • tests/unittest/_torch/auto_deploy/_utils_test/_model_test_utils.py (1 hunks)
  • tests/unittest/_torch/modeling/test_modeling_exaone4.py (4 hunks)
  • tests/unittest/_torch/multi_gpu/test_mnnvl_allreduce.py (0 hunks)
  • tests/unittest/_torch/multi_gpu_modeling/test_deepseek.py (0 hunks)
  • tests/unittest/_torch/thop/parallel/test_fp8_rowwise_linear.py (1 hunks)
  • tests/unittest/_torch/thop/serial/test_moe.py (3 hunks)
  • tests/unittest/llmapi/test_llm.py (0 hunks)
💤 Files with no reviewable changes (4)
  • tests/unittest/llmapi/test_llm.py
  • tests/integration/test_lists/waives.txt
  • tests/unittest/_torch/multi_gpu/test_mnnvl_allreduce.py
  • tests/unittest/_torch/multi_gpu_modeling/test_deepseek.py
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Use only spaces, no tabs; indent with 4 spaces.

Files:

  • tensorrt_llm/_torch/distributed/communicator.py
  • tests/unittest/_torch/thop/serial/test_moe.py
  • tensorrt_llm/_torch/pyexecutor/model_engine.py
  • tensorrt_llm/_torch/models/modeling_llama.py
  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tensorrt_llm/_torch/compilation/backend.py
  • tests/unittest/_torch/modeling/test_modeling_exaone4.py
  • tensorrt_llm/_torch/attention_backend/trtllm.py
  • tests/integration/defs/disaggregated/test_disaggregated_single_gpu.py
  • tests/integration/defs/accuracy/test_disaggregated_serving.py
  • tests/unittest/_torch/auto_deploy/_utils_test/_model_test_utils.py
  • tensorrt_llm/_torch/pyexecutor/py_executor.py
  • tests/integration/defs/examples/serve/test_serve.py
  • tests/integration/defs/conftest.py
  • tests/unittest/_torch/thop/parallel/test_fp8_rowwise_linear.py
  • tensorrt_llm/executor/base_worker.py
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
  • tests/integration/defs/test_e2e.py
  • tensorrt_llm/_torch/models/modeling_exaone4.py
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+.
Indent Python code with 4 spaces; do not use tabs.
Maintain module namespace when importing; prefer 'from package.subpackage import foo' then 'foo.SomeClass()' instead of importing the class directly.
Python filenames should be snake_case (e.g., some_file.py).
Python classes use PascalCase names.
Functions and methods use snake_case names.
Local variables use snake_case; prefix 'k' for variables that start with a number (e.g., k_99th_percentile).
Global variables use upper SNAKE_CASE prefixed with 'G' (e.g., G_MY_GLOBAL).
Constants use upper SNAKE_CASE (e.g., MY_CONSTANT).
Avoid shadowing variables from an outer scope.
Initialize all externally visible members of a class in the constructor.
Prefer docstrings for interfaces that may be used outside a file; comments for in-function or file-local interfaces.
Use Google-style docstrings for classes and functions (Sphinx-parsable).
Document attributes and variables inline so they render under the class/function docstring.
Avoid reflection when a simpler, explicit approach suffices (e.g., avoid dict(**locals()) patterns).
In try/except, catch the most specific exceptions possible.
For duck-typing try/except, keep the try body minimal and use else for the main logic.

Files:

  • tensorrt_llm/_torch/distributed/communicator.py
  • tests/unittest/_torch/thop/serial/test_moe.py
  • tensorrt_llm/_torch/pyexecutor/model_engine.py
  • tensorrt_llm/_torch/models/modeling_llama.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tensorrt_llm/_torch/compilation/backend.py
  • tests/unittest/_torch/modeling/test_modeling_exaone4.py
  • tensorrt_llm/_torch/attention_backend/trtllm.py
  • tests/integration/defs/disaggregated/test_disaggregated_single_gpu.py
  • tests/integration/defs/accuracy/test_disaggregated_serving.py
  • tests/unittest/_torch/auto_deploy/_utils_test/_model_test_utils.py
  • tensorrt_llm/_torch/pyexecutor/py_executor.py
  • tests/integration/defs/examples/serve/test_serve.py
  • tests/integration/defs/conftest.py
  • tests/unittest/_torch/thop/parallel/test_fp8_rowwise_linear.py
  • tensorrt_llm/executor/base_worker.py
  • tests/integration/defs/test_e2e.py
  • tensorrt_llm/_torch/models/modeling_exaone4.py
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).

Files:

  • tensorrt_llm/_torch/distributed/communicator.py
  • tests/unittest/_torch/thop/serial/test_moe.py
  • tensorrt_llm/_torch/pyexecutor/model_engine.py
  • tensorrt_llm/_torch/models/modeling_llama.py
  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tensorrt_llm/_torch/compilation/backend.py
  • tests/unittest/_torch/modeling/test_modeling_exaone4.py
  • tensorrt_llm/_torch/attention_backend/trtllm.py
  • tests/integration/defs/disaggregated/test_disaggregated_single_gpu.py
  • tests/integration/defs/accuracy/test_disaggregated_serving.py
  • tests/unittest/_torch/auto_deploy/_utils_test/_model_test_utils.py
  • tensorrt_llm/_torch/pyexecutor/py_executor.py
  • tests/integration/defs/examples/serve/test_serve.py
  • tests/integration/defs/conftest.py
  • tests/unittest/_torch/thop/parallel/test_fp8_rowwise_linear.py
  • tensorrt_llm/executor/base_worker.py
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
  • tests/integration/defs/test_e2e.py
  • tensorrt_llm/_torch/models/modeling_exaone4.py
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh}: Namespace closing braces must include a trailing comment with the namespace name (e.g., '} // namespace foo').
Prefer const or constexpr variables over #define for constants.
Declare variables that are not modified after initialization as const.
Avoid magic literals in code; except for 0, nullptr, true, false. Use named constants for comparisons and logic.
Use Allman brace style for formatting.
Place the semicolon of an empty for/while loop on a new line.
Bodies of switch/while/do-while/for must be compound statements (brace-delimited), and if/else must always be followed by brace-delimited statements.
Type names (e.g., classes) must be CamelCase starting with an uppercase letter (e.g., FooBar).
Local variables, methods, and namespaces use lowerCamelCase (e.g., localFooBar).
Non-magic-number global variables that are non-static and not in an anonymous namespace must be lowerCamelCase prefixed with 'g' (e.g., gDontUseGlobalFoos).
Non-magic-number globals that are static or in an anonymous namespace use lowerCamelCase prefixed with 's' (e.g., sMutableStaticGlobal).
Locally visible static variables use lowerCamelCase with 's' prefix (e.g., static std::once_flag sFlag).
Private/protected member variables use 'm' prefix with CamelCase (e.g., mNbFooValues). Public members may omit, but 'm' is encouraged for clarity.
Constants (enums, global constants, static constants, and function-scope magic/literal constants) use uppercase SNAKE_CASE with 'k' prefix (e.g., kDIGIT_NUM).
Function-scope constants that are not magic numbers or literals are named like non-constant variables (e.g., bool const pass = a && b).
If macros are necessary, name them in UPPER_SNAKE_CASE (e.g., FOO_VERSION) and prefer constants over #define.
Use LLVM clang-format; wrap lines at a maximum of 120 columns; use '// clang-format off/on' sparingly with justification.
Use smart pointers for heap allocations; prefer unique_ptr for sole ownership, shared_ptr for shared...

Files:

  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
**/*.{cpp,cxx,cc,cu,h,hpp,hh,hxx,cuh}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

C++ filenames should be lowerCamelCase (first letter lowercase) and must be case-insensitive unique within a compilation target.

Files:

  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
**/*.{h,hpp,hh,hxx,cpp,cxx,cc}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.{h,hpp,hh,hxx,cpp,cxx,cc}: Prefer anonymous namespaces over 'static' for internal linkage of functions.
All templates (class/function/member/static) must be instantiated at least once; non-POD classes should have private data members.

Files:

  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
🧠 Learnings (41)
📓 Common learnings
Learnt from: eopXD
Repo: NVIDIA/TensorRT-LLM PR: 6768
File: cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp:2010-2045
Timestamp: 2025-08-21T09:41:49.347Z
Learning: In cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp, updateSequenceCacheBlockOffsets is specifically for updating bookkeeping when blocks are added during the context phase, not for refreshing offsets after detach operations. During detach operations, GenerationRequest::removeFrontBlock handles the necessary cache block bookkeeping internally.
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
Repo: NVIDIA/TensorRT-LLM PR: 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:

  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tests/unittest/_torch/modeling/test_modeling_exaone4.py
  • tests/integration/test_lists/qa/llm_function_nim.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_b200.yml
  • jenkins/L0_Test.groovy
  • tensorrt_llm/llmapi/trtllm-llmapi-launch
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt
  • tests/integration/defs/test_e2e.py
📚 Learning: 2025-09-09T09:40:45.658Z
Learnt from: fredricz-20070104
Repo: NVIDIA/TensorRT-LLM PR: 7645
File: tests/integration/test_lists/qa/llm_function_core.txt:648-648
Timestamp: 2025-09-09T09:40:45.658Z
Learning: In TensorRT-LLM test lists, it's common and intentional for the same test to appear in multiple test list files when they serve different purposes (e.g., llm_function_core.txt for comprehensive core functionality testing and llm_function_core_sanity.txt for quick sanity checks). This duplication allows tests to be run in different testing contexts.

Applied to files:

  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tests/unittest/_torch/modeling/test_modeling_exaone4.py
  • tests/integration/test_lists/qa/llm_function_nim.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_b200.yml
  • jenkins/L0_Test.groovy
  • tensorrt_llm/llmapi/trtllm-llmapi-launch
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt
📚 Learning: 2025-08-29T14:07:45.863Z
Learnt from: EmmaQiaoCh
Repo: NVIDIA/TensorRT-LLM PR: 7370
File: tests/unittest/trt/model_api/test_model_quantization.py:24-27
Timestamp: 2025-08-29T14:07:45.863Z
Learning: In TensorRT-LLM's CI infrastructure, pytest skip markers (pytest.mark.skip) are properly honored even when test files have __main__ blocks that call test functions directly. The testing system correctly skips tests without requiring modifications to the __main__ block execution pattern.

Applied to files:

  • tests/unittest/_torch/thop/serial/test_moe.py
  • tests/integration/test_lists/test-db/l0_b200.yml
  • jenkins/L0_Test.groovy
  • tests/integration/defs/examples/serve/test_serve.py
  • tests/unittest/_torch/thop/parallel/test_fp8_rowwise_linear.py
📚 Learning: 2025-08-14T23:23:27.449Z
Learnt from: djns99
Repo: NVIDIA/TensorRT-LLM PR: 6915
File: cpp/tensorrt_llm/kernels/cutlass_kernels/moe_gemm/moe_kernels.cu:4010-4012
Timestamp: 2025-08-14T23:23:27.449Z
Learning: For MOE (Mixture of Experts) code reviews in TensorRT-LLM, avoid repeatedly suggesting finalize fusion validation checks and safety assertions. The user djns99 has indicated these suggestions are repetitive and unwanted across multiple MOE-related changes.

Applied to files:

  • tests/unittest/_torch/thop/serial/test_moe.py
📚 Learning: 2025-08-19T12:45:11.997Z
Learnt from: amitz-nv
Repo: NVIDIA/TensorRT-LLM PR: 7033
File: tensorrt_llm/_torch/pyexecutor/model_engine.py:0-0
Timestamp: 2025-08-19T12:45:11.997Z
Learning: In tensorrt_llm/_torch/pyexecutor/model_engine.py, DoRA (Delta Orthogonal Rank Adaptation) functionality was removed from the PyTorch flow to eliminate issues with inverted DoRA detection logic. The original is_dora condition was checking if scaling_vec_pointer == 0, which was potentially incorrect.

Applied to files:

  • tensorrt_llm/_torch/pyexecutor/model_engine.py
  • tensorrt_llm/_torch/models/modeling_llama.py
  • tensorrt_llm/_torch/pyexecutor/py_executor.py
  • tensorrt_llm/_torch/models/modeling_exaone4.py
📚 Learning: 2025-09-23T15:12:38.312Z
Learnt from: nv-lschneider
Repo: NVIDIA/TensorRT-LLM PR: 7910
File: cpp/tensorrt_llm/thop/allreduceOp.cpp:352-446
Timestamp: 2025-09-23T15:12:38.312Z
Learning: In TensorRT-LLM NCCL device allreduce implementation (cpp/tensorrt_llm/thop/allreduceOp.cpp), the goto pattern in runNCCLAllReduceDeviceFusion is intentionally used for future extensibility, allowing multiple switch cases to fallback to the default handler. While not aesthetically ideal, this pattern supports adding more fusion cases later that can reuse the same fallback logic.

Applied to files:

  • tensorrt_llm/_torch/models/modeling_llama.py
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
📚 Learning: 2025-08-14T06:36:40.701Z
Learnt from: timlee0212
Repo: NVIDIA/TensorRT-LLM PR: 6886
File: tensorrt_llm/_torch/models/modeling_deepseekv3.py:0-0
Timestamp: 2025-08-14T06:36:40.701Z
Learning: In DeepSeek V3 model (tensorrt_llm/_torch/models/modeling_deepseekv3.py), the disagreement between AllReduce.__init__ guard and _compute_mlp_tp_size logic for MNNVL usage is expected by design. The AllReduce component and MLP TP-size computation intentionally use different criteria for MNNVL availability decisions.

Applied to files:

  • tensorrt_llm/_torch/models/modeling_llama.py
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
📚 Learning: 2025-09-29T15:14:28.503Z
Learnt from: amitz-nv
Repo: NVIDIA/TensorRT-LLM PR: 8063
File: tensorrt_llm/lora_manager.py:1080-1112
Timestamp: 2025-09-29T15:14:28.503Z
Learning: In tensorrt_llm/lora_manager.py, when calculating part_sizes for attn_qkv fused LoRA modules, the sizes are correctly multiplied by tp_size because model_config.num_heads and model_config.num_kv_heads are already divided by tp_size (per-TP-rank values), so multiplication is needed to get the original full concatenated dimension size. The interleave_fused_lora_weights_for_tp function provides proper validation with asserts for total size and TP divisibility.

Applied to files:

  • tensorrt_llm/_torch/models/modeling_llama.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
📚 Learning: 2025-09-29T15:14:28.503Z
Learnt from: amitz-nv
Repo: NVIDIA/TensorRT-LLM PR: 8063
File: tensorrt_llm/lora_manager.py:1080-1112
Timestamp: 2025-09-29T15:14:28.503Z
Learning: In tensorrt_llm/lora_manager.py, when calculating part_sizes for attn_qkv fused LoRA modules, the sizes are correctly multiplied by tp_size because model_config.num_heads and model_config.num_kv_heads are already divided by tp_size (per-TP-rank values), so multiplication is needed to get the original full concatenated dimension size. The interleave_fused_lora_weights_for_tp function provides proper validation.

Applied to files:

  • tensorrt_llm/_torch/models/modeling_llama.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
📚 Learning: 2025-10-20T16:54:09.824Z
Learnt from: nvchenghaoz
Repo: NVIDIA/TensorRT-LLM PR: 8469
File: tensorrt_llm/_torch/auto_deploy/custom_ops/rms_norm.py:6-6
Timestamp: 2025-10-20T16:54:09.824Z
Learning: In tensorrt_llm/_torch/auto_deploy/custom_ops/rms_norm.py, the import `from ...modules.mamba.layernorm_gated import _layer_norm_fwd` is correct and should not be changed to modules.fla.layernorm_gated. The _layer_norm_fwd function exists in both modules/mamba/layernorm_gated.py and modules/fla/layernorm_gated.py, but the mamba version is the intended implementation for this use case.

Applied to files:

  • tensorrt_llm/_torch/models/modeling_llama.py
📚 Learning: 2025-09-23T15:12:38.312Z
Learnt from: nv-lschneider
Repo: NVIDIA/TensorRT-LLM PR: 7910
File: cpp/tensorrt_llm/thop/allreduceOp.cpp:352-446
Timestamp: 2025-09-23T15:12:38.312Z
Learning: In TensorRT-LLM NCCL device implementation, NCCL version 2.28+ requirements are handled at runtime in the nccl_device/config layer rather than with compile-time guards. This allows the allreduceOp to remain version-agnostic and delegates version compatibility validation to the appropriate lower-level components that can gracefully handle unsupported configurations.

Applied to files:

  • tensorrt_llm/_torch/models/modeling_llama.py
  • tensorrt_llm/llmapi/trtllm-llmapi-launch
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
📚 Learning: 2025-08-14T15:43:23.107Z
Learnt from: MatthiasKohl
Repo: NVIDIA/TensorRT-LLM PR: 6904
File: tensorrt_llm/_torch/attention_backend/trtllm.py:259-262
Timestamp: 2025-08-14T15:43:23.107Z
Learning: In TensorRT-LLM's attention backend, tensor parameters in the plan() method are assigned directly without validation (dtype, device, contiguity checks). This maintains consistency across all tensor inputs and follows the pattern of trusting callers to provide correctly formatted tensors.

Applied to files:

  • tensorrt_llm/_torch/models/modeling_llama.py
  • tensorrt_llm/_torch/attention_backend/trtllm.py
  • tensorrt_llm/_torch/models/modeling_exaone4.py
📚 Learning: 2025-08-15T06:46:53.813Z
Learnt from: eopXD
Repo: NVIDIA/TensorRT-LLM PR: 6767
File: cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp:0-0
Timestamp: 2025-08-15T06:46:53.813Z
Learning: In the TensorRT-LLM KV cache manager, SWA (Sliding Window Attention) combined with beam search is currently in a broken/non-functional state and is planned for future rework. During preparatory refactoring phases, code related to SWA+beam search may intentionally remain in a non-working state until the broader rework is completed.

Applied to files:

  • tensorrt_llm/_torch/models/modeling_llama.py
  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
  • tensorrt_llm/_torch/attention_backend/trtllm.py
📚 Learning: 2025-08-21T09:41:49.347Z
Learnt from: eopXD
Repo: NVIDIA/TensorRT-LLM PR: 6768
File: cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp:2010-2045
Timestamp: 2025-08-21T09:41:49.347Z
Learning: In cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp, updateSequenceCacheBlockOffsets is specifically for updating bookkeeping when blocks are added during the context phase, not for refreshing offsets after detach operations. During detach operations, GenerationRequest::removeFrontBlock handles the necessary cache block bookkeeping internally.

Applied to files:

  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
📚 Learning: 2025-08-20T06:48:45.368Z
Learnt from: eopXD
Repo: NVIDIA/TensorRT-LLM PR: 6768
File: cpp/include/tensorrt_llm/batch_manager/kvCacheManager.h:0-0
Timestamp: 2025-08-20T06:48:45.368Z
Learning: In cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp, updateSequenceCacheBlockOffsets is only called when adding a sequence, not during detach operations. During detach, the cache block bookkeeping is handled by GenerationRequest::removeFrontBlock.

Applied to files:

  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
📚 Learning: 2025-08-15T06:46:54.897Z
Learnt from: eopXD
Repo: NVIDIA/TensorRT-LLM PR: 6767
File: cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp:0-0
Timestamp: 2025-08-15T06:46:54.897Z
Learning: In cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp addToken function, newly allocated blocks are unshared by design. The beam search path in addToken (when sequence.getNumTokens() > windowSize) is currently broken/non-functional with SWA, so the block allocation doesn't follow a shared-then-unshared pattern.

Applied to files:

  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
  • tensorrt_llm/executor/base_worker.py
📚 Learning: 2025-08-14T21:04:50.248Z
Learnt from: thorjohnsen
Repo: NVIDIA/TensorRT-LLM PR: 6910
File: cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp:0-0
Timestamp: 2025-08-14T21:04:50.248Z
Learning: In KV cache onboarding logic during prefill in cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp, when calculating which blocks fall within the attention window, use getTokensPerBlock() to advance token indices rather than block->getUniqueTokens().size(), because the calculation needs to consider the post-prefill state where blocks will be filled to capacity, not their current token count.

Applied to files:

  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
  • tensorrt_llm/executor/base_worker.py
📚 Learning: 2025-08-20T06:56:02.889Z
Learnt from: eopXD
Repo: NVIDIA/TensorRT-LLM PR: 6768
File: cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp:577-579
Timestamp: 2025-08-20T06:56:02.889Z
Learning: In cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp, maxSequenceLength is now enforced as a non-optional argument in the BlockManager constructor, so concerns about std::nullopt defaulting to 0 are not applicable. When windowSize > maxSequenceLength, a warning should be added instead of handling optional parameter cases.

Applied to files:

  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
  • tensorrt_llm/executor/base_worker.py
📚 Learning: 2025-08-06T08:18:28.669Z
Learnt from: zhengd-nv
Repo: NVIDIA/TensorRT-LLM PR: 6633
File: cpp/tensorrt_llm/batch_manager/dataTransceiverImpl.cpp:145-155
Timestamp: 2025-08-06T08:18:28.669Z
Learning: In cpp/tensorrt_llm/batch_manager/dataTransceiverImpl.cpp, the existing `mMtxForMap` mutex in DataSenderImpl is sufficient to synchronize measurement file operations in the `release` method, as all file operations occur within the same critical section that protects the `mRequestToSession` map access.

Applied to files:

  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
📚 Learning: 2025-08-20T06:48:45.368Z
Learnt from: eopXD
Repo: NVIDIA/TensorRT-LLM PR: 6768
File: cpp/include/tensorrt_llm/batch_manager/kvCacheManager.h:0-0
Timestamp: 2025-08-20T06:48:45.368Z
Learning: There is a planned refactoring to move cache block bookkeeping utilities from BlockManager/WindowBlockManager into the GenerationRequest class itself to improve code organization and make responsibilities clearer.

Applied to files:

  • cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp
📚 Learning: 2025-08-26T09:37:10.463Z
Learnt from: jiaganc
Repo: NVIDIA/TensorRT-LLM PR: 7031
File: tensorrt_llm/bench/dataclasses/configuration.py:90-104
Timestamp: 2025-08-26T09:37:10.463Z
Learning: In TensorRT-LLM's bench configuration, the `get_pytorch_perf_config()` method returns `self.pytorch_config` which is a Dict[str, Any] that can contain default values including `cuda_graph_config`, making the fallback `llm_args["cuda_graph_config"]` safe to use.

Applied to files:

  • tests/unittest/_torch/modeling/test_modeling_exaone4.py
📚 Learning: 2025-08-26T09:49:04.956Z
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*").

Applied to files:

  • tests/unittest/_torch/modeling/test_modeling_exaone4.py
  • tests/integration/test_lists/qa/llm_function_nim.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_b200.yml
  • jenkins/L0_Test.groovy
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt
  • tests/integration/defs/test_e2e.py
📚 Learning: 2025-08-06T13:58:07.506Z
Learnt from: galagam
Repo: NVIDIA/TensorRT-LLM PR: 6487
File: tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py:1-12
Timestamp: 2025-08-06T13:58:07.506Z
Learning: In TensorRT-LLM, test files (files under tests/ directories) do not require NVIDIA copyright headers, unlike production source code files. Test files typically start directly with imports, docstrings, or code.

Applied to files:

  • tests/unittest/_torch/modeling/test_modeling_exaone4.py
  • tests/integration/test_lists/qa/llm_function_nim.txt
  • tensorrt_llm/llmapi/trtllm-llmapi-launch
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt
📚 Learning: 2025-08-26T09:37:10.463Z
Learnt from: jiaganc
Repo: NVIDIA/TensorRT-LLM PR: 7031
File: tensorrt_llm/bench/dataclasses/configuration.py:90-104
Timestamp: 2025-08-26T09:37:10.463Z
Learning: In TensorRT-LLM, the `get_pytorch_perf_config()` method returns `self.pytorch_config` which can contain default `cuda_graph_config` values, so `llm_args` may already have this config before the extra options processing.

Applied to files:

  • tests/unittest/_torch/modeling/test_modeling_exaone4.py
📚 Learning: 2025-09-17T02:48:52.732Z
Learnt from: tongyuantongyu
Repo: NVIDIA/TensorRT-LLM PR: 7781
File: tests/integration/test_lists/waives.txt:313-313
Timestamp: 2025-09-17T02:48:52.732Z
Learning: In TensorRT-LLM, `tests/integration/test_lists/waives.txt` is specifically for waiving/skipping tests, while other test list files like those in `test-db/` and `qa/` directories are for different test execution contexts (pre-merge, post-merge, QA tests). The same test appearing in both waives.txt and execution list files is intentional - the test is part of test suites but will be skipped due to the waiver.

Applied to files:

  • tests/integration/test_lists/qa/llm_function_nim.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_b200.yml
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt
📚 Learning: 2025-10-22T06:53:47.017Z
Learnt from: xinhe-nv
Repo: NVIDIA/TensorRT-LLM PR: 8534
File: scripts/format_test_list.py:1-6
Timestamp: 2025-10-22T06:53:47.017Z
Learning: The file `scripts/format_test_list.py` in the TensorRT-LLM repository does not require the NVIDIA Apache-2.0 copyright header.

Applied to files:

  • tests/integration/test_lists/qa/llm_function_nim.txt
📚 Learning: 2025-09-17T06:01:01.836Z
Learnt from: fredricz-20070104
Repo: NVIDIA/TensorRT-LLM PR: 7785
File: tests/integration/defs/perf/utils.py:321-333
Timestamp: 2025-09-17T06:01:01.836Z
Learning: In test infrastructure code for disaggregated serving tests, prefer logging errors and continuing execution rather than raising exceptions on timeout, to avoid disrupting test cleanup and causing cascading failures.

Applied to files:

  • tests/integration/defs/accuracy/test_disaggregated_serving.py
📚 Learning: 2025-08-26T06:07:02.166Z
Learnt from: shaharmor98
Repo: NVIDIA/TensorRT-LLM PR: 7231
File: tensorrt_llm/_torch/pyexecutor/_util.py:504-509
Timestamp: 2025-08-26T06:07:02.166Z
Learning: In tensorrt_llm/_torch/pyexecutor/_util.py, when calling model_engine.set_lora_model_config(), pass model_binding_config.mlp_hidden_size directly without multiplying by mapping.tp_size, as the mlp_hidden_size from get_bindings_model_config() is already the per-TP rank value needed for LoRA weight packaging.

Applied to files:

  • tests/unittest/_torch/auto_deploy/_utils_test/_model_test_utils.py
📚 Learning: 2025-09-02T13:43:22.657Z
Learnt from: pcastonguay
Repo: NVIDIA/TensorRT-LLM PR: 7455
File: tensorrt_llm/_torch/pyexecutor/py_executor.py:728-731
Timestamp: 2025-09-02T13:43:22.657Z
Learning: The user pcastonguay prefers creating dedicated handler classes to encapsulate complex subsystem logic rather than spreading it across the main class. For disaggregated pipeline parallel termination, they suggest creating a `_disagg_pp_termination_handler` with a `cleanup()` method instead of manually waiting on termination handles during shutdown.

Applied to files:

  • tensorrt_llm/_torch/pyexecutor/py_executor.py
📚 Learning: 2025-09-02T13:42:44.885Z
Learnt from: pcastonguay
Repo: NVIDIA/TensorRT-LLM PR: 7455
File: tensorrt_llm/_torch/pyexecutor/py_executor.py:1852-1860
Timestamp: 2025-09-02T13:42:44.885Z
Learning: In MPI communication within TensorRT-LLM pipeline parallelism, different communication types (tokens, logits, termination sync) must use disjoint tag namespaces to avoid message routing collisions when using the same source/destination patterns.

Applied to files:

  • tensorrt_llm/llmapi/trtllm-llmapi-launch
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
📚 Learning: 2025-09-16T09:30:09.716Z
Learnt from: tongyuantongyu
Repo: NVIDIA/TensorRT-LLM PR: 7763
File: cpp/tensorrt_llm/CMakeLists.txt:297-301
Timestamp: 2025-09-16T09:30:09.716Z
Learning: In the TensorRT-LLM project, NCCL libraries are loaded earlier by PyTorch libraries or the bindings library, so the main shared library doesn't need NCCL paths in its RPATH - the libraries will already be available in the process address space when needed.

Applied to files:

  • tensorrt_llm/llmapi/trtllm-llmapi-launch
📚 Learning: 2025-09-23T15:01:00.070Z
Learnt from: nv-lschneider
Repo: NVIDIA/TensorRT-LLM PR: 7910
File: cpp/tensorrt_llm/kernels/nccl_device/config.cu:15-17
Timestamp: 2025-09-23T15:01:00.070Z
Learning: In TensorRT-LLM NCCL device kernels, the <sstream> header is not needed as an explicit include in config.cu because it's provided transitively through other headers. Local compilation testing confirms this works without the explicit include.

Applied to files:

  • tensorrt_llm/llmapi/trtllm-llmapi-launch
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
📚 Learning: 2025-08-11T20:09:24.389Z
Learnt from: achartier
Repo: NVIDIA/TensorRT-LLM PR: 6763
File: tests/integration/defs/triton_server/conftest.py:16-22
Timestamp: 2025-08-11T20:09:24.389Z
Learning: In the TensorRT-LLM test infrastructure, the team prefers simple, direct solutions (like hard-coding directory traversal counts) over more complex but robust approaches when dealing with stable directory structures. They accept the maintenance cost of updating tests if the layout changes.

Applied to files:

  • tensorrt_llm/llmapi/trtllm-llmapi-launch
📚 Learning: 2025-09-23T14:58:05.372Z
Learnt from: nv-lschneider
Repo: NVIDIA/TensorRT-LLM PR: 7910
File: cpp/tensorrt_llm/kernels/nccl_device/config.cu:42-49
Timestamp: 2025-09-23T14:58:05.372Z
Learning: In TensorRT-LLM NCCL device kernels (cpp/tensorrt_llm/kernels/nccl_device/), the token partitioning intentionally uses ceil-like distribution (same token_per_rank for all ranks) to ensure all ranks launch the same number of blocks. This is required for optimal NCCL device API barrier performance, even though it may launch extra blocks for non-existent tokens on later ranks. Runtime bounds checking in the kernel (blockID validation) handles the overshoot cases.

Applied to files:

  • tensorrt_llm/llmapi/trtllm-llmapi-launch
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
📚 Learning: 2025-08-21T00:16:56.457Z
Learnt from: farshadghodsian
Repo: NVIDIA/TensorRT-LLM PR: 7101
File: docs/source/blogs/tech_blog/blog9_Deploying_GPT_OSS_on_TRTLLM.md:36-36
Timestamp: 2025-08-21T00:16:56.457Z
Learning: TensorRT-LLM container release tags in documentation should only reference published NGC container images. The README badge version may be ahead of the actual published container versions.

Applied to files:

  • tensorrt_llm/llmapi/trtllm-llmapi-launch
📚 Learning: 2025-08-18T08:42:02.640Z
Learnt from: samuellees
Repo: NVIDIA/TensorRT-LLM PR: 6974
File: tensorrt_llm/serve/scripts/benchmark_dataset.py:558-566
Timestamp: 2025-08-18T08:42:02.640Z
Learning: In TensorRT-LLM's RandomDataset (tensorrt_llm/serve/scripts/benchmark_dataset.py), when using --random-token-ids option, sequence length accuracy is prioritized over semantic correctness for benchmarking purposes. The encode/decode operations should use skip_special_tokens=True and add_special_tokens=False to ensure exact target token lengths.

Applied to files:

  • tensorrt_llm/executor/base_worker.py
📚 Learning: 2025-09-23T15:13:48.819Z
Learnt from: nv-lschneider
Repo: NVIDIA/TensorRT-LLM PR: 7910
File: cpp/tensorrt_llm/kernels/nccl_device/multimem.h:20-30
Timestamp: 2025-09-23T15:13:48.819Z
Learning: TRT-LLM targets modern CUDA toolkits that support FP8 datatypes, so cuda_fp8.h can be included unconditionally without version guards in TRT-LLM code.

Applied to files:

  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
📚 Learning: 2025-08-21T02:39:12.009Z
Learnt from: djns99
Repo: NVIDIA/TensorRT-LLM PR: 7104
File: cpp/tensorrt_llm/kernels/cutlass_kernels/moe_gemm/moe_kernels.cu:1475-1480
Timestamp: 2025-08-21T02:39:12.009Z
Learning: The min latency mode functionality in TensorRT-LLM MOE kernels (cpp/tensorrt_llm/kernels/cutlass_kernels/moe_gemm/moe_kernels.cu) is deprecated and no longer being maintained/updated, as confirmed by djns99. Bug reports and optimization suggestions for the computeStridesTmaWarpSpecializedLowLatencyKernel and related min latency code paths should be deprioritized.

Applied to files:

  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
📚 Learning: 2025-10-13T19:45:03.518Z
Learnt from: nv-lschneider
Repo: NVIDIA/TensorRT-LLM PR: 7910
File: tests/unittest/_torch/multi_gpu/test_nccl_device.py:138-149
Timestamp: 2025-10-13T19:45:03.518Z
Learning: In test_nccl_device.py, the NCCL device AllReduce implementation compares the entire residual tensor on each rank, unlike the UB implementation which compares per-rank chunks. The residual chunking calculations in the test are intentionally overridden to reflect this design difference.

Applied to files:

  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
📚 Learning: 2025-09-23T15:01:00.070Z
Learnt from: nv-lschneider
Repo: NVIDIA/TensorRT-LLM PR: 7910
File: cpp/tensorrt_llm/kernels/nccl_device/config.cu:15-17
Timestamp: 2025-09-23T15:01:00.070Z
Learning: In TensorRT-LLM NCCL device kernels (cpp/tensorrt_llm/kernels/nccl_device/config.cu), std::ostringstream is used but <sstream> doesn't need to be explicitly included because it's provided transitively through other headers like tensorrt_llm/common/cudaUtils.h or config.h. Local compilation testing confirms this works without the explicit include.

Applied to files:

  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlTwoShotAllreduceKernels.cu
🧬 Code graph analysis (10)
tests/unittest/_torch/thop/serial/test_moe.py (1)
cpp/tensorrt_llm/kernels/trtllmGenKernels/blockScaleMoe/runner.h (1)
  • intermediate_size (245-245)
tensorrt_llm/_torch/pyexecutor/model_engine.py (1)
tensorrt_llm/_torch/compilation/backend.py (2)
  • Backend (23-162)
  • Streams (29-30)
cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp (1)
cpp/tensorrt_llm/nanobind/batch_manager/kvCacheManager.cpp (16)
  • requestId (108-111)
  • requestId (108-108)
  • requestId (113-117)
  • requestId (113-114)
  • requestId (119-124)
  • requestId (119-121)
  • requestId (126-130)
  • requestId (126-127)
  • requestId (132-135)
  • requestId (132-132)
  • requestId (137-140)
  • requestId (137-137)
  • requestId (169-172)
  • requestId (169-169)
  • requestId (190-194)
  • requestId (190-191)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (3)
tests/integration/defs/conftest.py (1)
  • llm_models_root (80-94)
tensorrt_llm/models/modeling_utils.py (1)
  • quant_algo (550-551)
tensorrt_llm/quantization/mode.py (1)
  • QuantAlgo (23-47)
tensorrt_llm/_torch/compilation/backend.py (1)
tensorrt_llm/_torch/compilation/multi_stream/auto_multi_stream.py (1)
  • multi_stream_schedule (416-424)
tests/integration/defs/disaggregated/test_disaggregated_single_gpu.py (2)
tensorrt_llm/llmapi/llm_args.py (1)
  • KvCacheConfig (1265-1409)
cpp/tensorrt_llm/executor/kvCacheConfig.cpp (1)
  • KvCacheConfig (24-73)
tests/integration/defs/accuracy/test_disaggregated_serving.py (3)
tests/unittest/llmapi/apps/_test_disagg_serving_multi_nodes.py (1)
  • env (61-68)
tests/integration/defs/trt_test_alternative.py (1)
  • popen (199-218)
tests/unittest/_torch/auto_deploy/unit/singlegpu/utils/test_config.py (1)
  • temp_dir (101-104)
tensorrt_llm/_torch/pyexecutor/py_executor.py (4)
tensorrt_llm/_torch/pyexecutor/llm_request.py (1)
  • LlmRequest (422-631)
tensorrt_llm/_utils.py (1)
  • nvtx_range (872-891)
tensorrt_llm/_torch/distributed/communicator.py (10)
  • is_first_pp_rank (87-88)
  • recv_object (376-377)
  • recv_object (592-605)
  • prev_pp_rank (95-96)
  • is_last_pp_rank (79-80)
  • pp_size (59-60)
  • isend_object (373-374)
  • isend_object (613-625)
  • next_pp_rank (91-92)
  • pp_rank (75-76)
tensorrt_llm/mapping.py (5)
  • is_first_pp_rank (251-252)
  • prev_pp_rank (257-261)
  • is_last_pp_rank (245-246)
  • next_pp_rank (263-267)
  • pp_rank (508-509)
tests/integration/defs/test_e2e.py (1)
tests/integration/defs/conftest.py (5)
  • get_device_count (1986-1988)
  • get_sm_version (1890-1893)
  • llm_models_root (80-94)
  • tests_path (97-98)
  • unittest_path (101-102)
tensorrt_llm/_torch/models/modeling_exaone4.py (1)
tensorrt_llm/quantization/mode.py (1)
  • QuantAlgo (23-47)
🪛 Ruff (0.14.3)
tensorrt_llm/_torch/pyexecutor/model_engine.py

275-275: Undefined name pytorch_backend_config

(F821)

tests/unittest/_torch/modeling/test_modeling_exaone4.py

427-427: f-string without any placeholders

Remove extraneous f prefix

(F541)


427-427: Probable insecure usage of temporary file or directory: "/tmp/exaone4_llm_load_test_model"

(S108)


431-431: Do not catch blind exception: Exception

(BLE001)


432-432: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


432-432: Avoid specifying long messages outside the exception class

(TRY003)

tests/unittest/_torch/auto_deploy/_utils_test/_model_test_utils.py

505-505: Dictionary key literal "TinyLlama/TinyLlama-1.1B-Chat-v1.0" repeated

Remove repeated key literal "TinyLlama/TinyLlama-1.1B-Chat-v1.0"

(F601)

tensorrt_llm/_torch/pyexecutor/py_executor.py

2449-2449: Loop control variable req_id not used within loop body

(B007)

tests/unittest/_torch/thop/parallel/test_fp8_rowwise_linear.py

9-9: Undefined name skip_blackwell

(F821)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check

@mikeiovine
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #23541 [ run ] triggered by Bot. Commit: 6925f4b

@mikeiovine mikeiovine requested a review from a team as a code owner November 4, 2025 20:54
MrGeva and others added 11 commits November 4, 2025 13:17
…mprove stability + unwaive FP4 MoE torch unit tests (NVIDIA#8422)

Signed-off-by: Dom Brown <[email protected]>
Signed-off-by: Mike Iovine <[email protected]>
… to release 1.1 (NVIDIA#8854)

Signed-off-by: Dongxu Yang <[email protected]>
Signed-off-by: Mike Iovine <[email protected]>
@mikeiovine
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #23545 [ run ] triggered by Bot. Commit: 6c1fdfd

@tensorrt-cicd
Copy link
Collaborator

PR_Github #23541 [ run ] completed with state ABORTED. Commit: 6925f4b
LLM/main/L0_MergeRequest_PR #17717 (Blue Ocean) completed with status: ABORTED

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.