Skip to content

Conversation

@rosenrodt
Copy link
Collaborator

@rosenrodt rosenrodt commented Nov 30, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Added configurable top-k ID generation methods (uniform, random, and Gaussian distribution options) for autotuner profiling.
  • Refactor

    • Enhanced autotuner efficiency in multi-process environments through improved cache synchronization and broadcasting.
    • Updated autotuner to use mapping-based configuration for streamlined distributed processing.

✏️ Tip: You can customize this high-level summary in your review settings.

Description

#9087 introduces autotune with topk_id/topk_weights instead of routing_logits. But the uniform distribution of topk_id during autotune brings down perf in some test cases. This PR attempt to recover the performance.

image

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.

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.

@rosenrodt rosenrodt requested review from a team as code owners November 30, 2025 16:52
@rosenrodt rosenrodt force-pushed the anchengc/align-autotune-across-ranks branch from f1cc891 to d14c4ac Compare November 30, 2025 16:53
@rosenrodt
Copy link
Collaborator Author

/bot run

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 30, 2025

📝 Walkthrough

Walkthrough

The autotuner context manager is refactored to accept a mapping parameter instead of rank, enabling unified cache handling. A new top-k ID generation system with configurable strategies (UNIFORM, RANDINT, GAUSSIAN) is introduced. MPI synchronization utilities are integrated for distributed profiling cache broadcasting.

Changes

Cohort / File(s) Summary
Autotune Context Manager Refactoring
tensorrt_llm/_torch/autotuner.py
Signature changed from rank-based to mapping-based parameter; added MPI utilities for inter-process synchronization; unified cache file handling with single shared path; cache saving restricted to rank 0; added explicit broadcast step for cache synchronization when world_size > 1
Top-k ID Generation System
tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py
Added TopkIdsGenMethod enum with UNIFORM, RANDINT, and GAUSSIAN strategies; introduced create_dummy_topk_ids() function to generate dummy top-k IDs by method; extended prepare_dummy_topk_and_hook() with topk_ids_gen_method parameter; integrated Normal distribution import for Gaussian generation path
Engine Integration
tensorrt_llm/_torch/pyexecutor/model_engine.py
Updated _run_autotuner_warmup() call to use mapping-based autotune signature instead of rank-based

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas requiring extra attention:
    • MPI synchronization logic in autotuner.py — verify rank 0 caching and broadcast timing are correct for distributed scenarios
    • Top-k ID generation method selection and casting to int32 in create_dummy_topk_ids() — ensure all generation paths maintain expected tensor shapes and device placement
    • Signature change propagation — confirm all call sites using the autotune context manager have been updated (verify model_engine.py and any other callers)

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive PR description provides context about performance regression and solution but lacks detailed explanation of technical changes and missing test coverage details. Expand description with details on cache alignment mechanism, expected performance improvements, and list specific test cases validating the changes across different DEP configurations.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title references 'MoE Perf' and 'DEP' recovery, which align with the PR's core objective to fix performance regressions. However, it omits the significant architectural change: shifting from rank-based to mapping-based autotuner cache synchronization.
✨ 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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tensorrt_llm/_torch/autotuner.py (1)

228-271: Guard mapping being None and gate MPI sync on actual tuning

The autotune signature allows mapping to be omitted (defaults to None), but the finally block unconditionally dereferences it with mapping.world_size and mapping.rank, which will raise AttributeError for any caller that doesn't provide mapping. Additionally, the MPI barrier and broadcast operations run whenever mapping is not None, even when this context didn't actually enable tuning (when autotune_enabled is False).

Type hints should also use Optional[...] instead of bare type names with = None:

-@contextlib.contextmanager
-def autotune(tune_mode: bool = True,
-             cache_path: str = None,
-             mapping: "tensorrt_llm.Mapping" = None):
+@contextlib.contextmanager
+def autotune(
+    tune_mode: bool = True,
+    cache_path: Optional[str] = None,
+    mapping: Optional["tensorrt_llm.Mapping"] = None,
+):
@@
-        AutoTuner.get().is_tuning_mode = old_mode
-        if autotune_enabled:
-            logger.info("[Autotuner] Autotuning process ends")
-
-        # Broadcast the cache from rank 0 to all other ranks
-        if mapping.world_size > 1:
-            # Synchronize all ranks before broadcasting
-            mpi_barrier()
-            cache_data = AutoTuner.get().profiling_cache.cache
-            cache_data = mpi_broadcast(cache_data, root=0)
-            AutoTuner.get().profiling_cache.cache = cache_data
-
-        # save cache
-        if cache_path is not None and mapping.rank == 0:
-            logger.info(f"[Autotuner] Saving cache to {cache_path}")
-            AutoTuner.get().profiling_cache.save_cache(cache_path)
+        AutoTuner.get().is_tuning_mode = old_mode
+        if autotune_enabled:
+            logger.info("[Autotuner] Autotuning process ends")
+
+            # Broadcast the cache from rank 0 to all other ranks
+            if mapping is not None and mapping.world_size > 1:
+                # Synchronize all ranks before broadcasting
+                mpi_barrier()
+                cache_data = AutoTuner.get().profiling_cache.cache
+                cache_data = mpi_broadcast(cache_data, root=0)
+                AutoTuner.get().profiling_cache.cache = cache_data
+
+            # Save cache from rank 0 (or the only rank if mapping is None)
+            is_rank0 = mapping is None or mapping.rank == 0
+            if cache_path is not None and is_rank0:
+                logger.info(f"[Autotuner] Saving cache to {cache_path}")
+                AutoTuner.get().profiling_cache.save_cache(cache_path)
🧹 Nitpick comments (2)
tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py (2)

18-85: Tighten create_dummy_topk_ids for robustness and minor cleanup

The new TopkIdsGenMethod and create_dummy_topk_ids cover the required generation strategies and produce tensors with the right shape/dtype. A couple of small improvements would make this more robust and tidy:

  • Explicitly assert the basic invariant once, to fail fast in misconfigured setups instead of letting multinomial raise cryptic errors:
 def create_dummy_topk_ids(
@@
-    method: TopkIdsGenMethod,
+    method: TopkIdsGenMethod,
 ) -> torch.Tensor:
@@
-    # Note: RANDINT is uniform distribution with replacement which can cause duplicates. However we
+    # Note: RANDINT is uniform distribution with replacement which can cause duplicates. However we
@@
-    if method == TopkIdsGenMethod.UNIFORM:
+    assert 0 < top_k <= num_experts, "top_k must satisfy 0 < top_k <= num_experts"
+
+    if method == TopkIdsGenMethod.UNIFORM:
@@
-    return topk_ids.to(torch.int32).to(device)
+    return topk_ids.to(dtype=torch.int32, device=device)

This keeps the API the same, documents expectations, and removes a redundant device transfer.


87-198: prepare_dummy_topk_and_hook integration looks correct; consider exposing method selection

The refactor to have prepare_dummy_topk_and_hook call create_dummy_topk_ids for both initial and shape-change paths is consistent:

  • Dummy tensors in the attention-DP path still have shapes (num_tokens, top_k) and use local_num_experts as the index range.
  • The recreate_dummy_topk_if_needed hook correctly updates inputs[-2] and inputs[-1] when the token count changes, now delegating dummy id creation to create_dummy_topk_ids with the same parameters.
  • Normal routing (non-attention-DP) behavior for routing_logits is unchanged.

Right now, all callers rely on the default topk_ids_gen_method=TopkIdsGenMethod.RANDINT. If you later want to experiment with UNIFORM/GAUSSIAN globally, consider threading a configuration flag (e.g., from env or MoE config) into the various *_moe_runner wrappers instead of hard-coding RANDINT at the call sites.

📜 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 694b60d and d14c4ac.

📒 Files selected for processing (3)
  • tensorrt_llm/_torch/autotuner.py (4 hunks)
  • tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py (6 hunks)
  • tensorrt_llm/_torch/pyexecutor/model_engine.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., use from package.subpackage import foo and then foo.SomeClass() instead of from 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 prefix k for variable names that start with a number (e.g., k_99th_percentile = ...)
Python global variables should use upper snake_case with prefix G (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 = 5 followed 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/autotuner.py
  • tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py
  • tensorrt_llm/_torch/pyexecutor/model_engine.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/autotuner.py
  • tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py
  • tensorrt_llm/_torch/pyexecutor/model_engine.py
🧠 Learnings (12)
📚 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/_torch/autotuner.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/autotuner.py
📚 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/_torch/autotuner.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/_torch/autotuner.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:

  • tensorrt_llm/_torch/autotuner.py
📚 Learning: 2025-08-14T15:38:01.771Z
Learnt from: MatthiasKohl
Repo: NVIDIA/TensorRT-LLM PR: 6904
File: cpp/tensorrt_llm/pybind/thop/bindings.cpp:55-57
Timestamp: 2025-08-14T15:38:01.771Z
Learning: In TensorRT-LLM Python bindings, tensor parameter collections like mla_tensor_params and spec_decoding_tensor_params are kept as required parameters without defaults to maintain API consistency, even when it might affect backward compatibility.

Applied to files:

  • tensorrt_llm/_torch/autotuner.py
📚 Learning: 2025-08-01T15:14:45.673Z
Learnt from: yibinl-nvidia
Repo: NVIDIA/TensorRT-LLM PR: 6506
File: examples/models/core/mixtral/requirements.txt:3-3
Timestamp: 2025-08-01T15:14:45.673Z
Learning: In TensorRT-LLM, examples directory can have different dependency versions than the root requirements.txt file. Version conflicts between root and examples dependencies are acceptable because examples are designed to be standalone and self-contained.

Applied to files:

  • tensorrt_llm/_torch/autotuner.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:

  • tensorrt_llm/_torch/autotuner.py
📚 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:

  • tensorrt_llm/_torch/autotuner.py
📚 Learning: 2025-10-20T17:07:18.745Z
Learnt from: nvchenghaoz
Repo: NVIDIA/TensorRT-LLM PR: 8469
File: tensorrt_llm/_torch/auto_deploy/models/patches/nemotron_h.py:98-116
Timestamp: 2025-10-20T17:07:18.745Z
Learning: In NemotronH models (tensorrt_llm/_torch/auto_deploy/models/patches/nemotron_h.py), the gate (self.gate) returns topk_indices and topk_weights that are already in the correct shape to be passed directly to torch_ops.auto_deploy.torch_moe without needing to reshape them when hidden_states is flattened.

Applied to files:

  • tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.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
📚 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:

  • tensorrt_llm/_torch/pyexecutor/model_engine.py
🧬 Code graph analysis (2)
tensorrt_llm/_torch/autotuner.py (1)
tensorrt_llm/_utils.py (2)
  • mpi_barrier (577-579)
  • mpi_broadcast (587-588)
tensorrt_llm/_torch/pyexecutor/model_engine.py (1)
tensorrt_llm/_torch/models/checkpoints/base_weight_mapper.py (1)
  • mapping (162-163)
🪛 Ruff (0.14.6)
tensorrt_llm/_torch/autotuner.py

230-230: PEP 484 prohibits implicit Optional

Convert to T | None

(RUF013)

⏰ 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
🔇 Additional comments (3)
tensorrt_llm/_torch/pyexecutor/model_engine.py (1)

635-637: Wiring mapping into autotune context looks correct

Passing mapping=self.mapping here aligns with the new autotuner API and enables rank-aware cache broadcast without changing warmup control flow. Given self.mapping is already assumed non-None elsewhere (e.g., mapping.cp_config, mapping.pp_size), this doesn’t introduce new nullability risks in this class.

tensorrt_llm/_torch/autotuner.py (1)

863-871: Profiling failure logging change is reasonable

The updated warning message for profiling failures (including runner, tactic, shapes, and error) improves diagnosability without changing behavior. No issues from a correctness or performance perspective.

tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py (1)

452-463: Callers of prepare_dummy_topk_and_hook are consistent with the new contract

All the MoE custom ops (fp4_block_scale_moe_runner, fp8_block_scale_moe_runner, mxe4m3_mxe2m1_block_scale_moe_runner, e4m3_mxe2m1_block_scale_moe_runner, bf16_mxe2m1_block_scale_moe_runner, fp8_fp4_block_scale_moe_runner) now:

  • Pass hidden_states and hidden_states_index=2, matching the layout expected by recreate_dummy_topk_if_needed.
  • Build input_tensors_for_tuner with topk_weights_for_tuner and topk_ids_for_tuner as the last two entries, consistent with inputs[-2]/inputs[-1] usage in the hook.
  • Replace dummy {routing_logits, topk_weights, topk_ids} with the actual tensors only after tuning, so the tuning-time distribution is controlled by the factory while the final run uses real data.

This wiring looks coherent and should preserve existing behavior while enabling improved dummy top-k distributions.

Also applies to: 781-792, 1089-1099, 1358-1368, 1621-1631, 1872-1882

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26324 [ run ] triggered by Bot. Commit: d14c4ac

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26324 [ run ] completed with state SUCCESS. Commit: d14c4ac
/LLM/main/L0_MergeRequest_PR pipeline #19990 completed with status: 'FAILURE'

@rosenrodt
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26337 [ run ] triggered by Bot. Commit: c1e69eb

@rosenrodt rosenrodt requested review from dongxuy04 and hyukn December 1, 2025 01:48
@tensorrt-cicd
Copy link
Collaborator

PR_Github #26337 [ run ] completed with state SUCCESS. Commit: c1e69eb
/LLM/main/L0_MergeRequest_PR pipeline #20001 completed with status: 'FAILURE'

@longlee0622
Copy link
Collaborator

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26369 [ run ] triggered by Bot. Commit: c1e69eb

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26369 [ run ] completed with state SUCCESS. Commit: c1e69eb
/LLM/main/L0_MergeRequest_PR pipeline #20028 completed with status: 'FAILURE'

@rosenrodt rosenrodt requested a review from a team as a code owner December 1, 2025 07:08
@tensorrt-cicd
Copy link
Collaborator

PR_Github #26393 [ run ] triggered by Bot. Commit: 17e7af2

@rosenrodt rosenrodt force-pushed the anchengc/align-autotune-across-ranks branch from 17e7af2 to 116dc65 Compare December 1, 2025 07:24
@tensorrt-cicd
Copy link
Collaborator

PR_Github #26395 [ kill ] triggered by Bot. Commit: 116dc65

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26393 [ run ] completed with state ABORTED. Commit: 17e7af2
LLM/main/L0_MergeRequest_PR #20052 (Blue Ocean) completed with status: ABORTED

@rosenrodt
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26395 [ kill ] completed with state SUCCESS. Commit: 116dc65
Successfully killed previous jobs for commit 116dc65

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26396 [ run ] triggered by Bot. Commit: 116dc65

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26396 [ run ] completed with state SUCCESS. Commit: 116dc65
/LLM/main/L0_MergeRequest_PR pipeline #20054 completed with status: 'FAILURE'

@rosenrodt rosenrodt requested review from a team as code owners December 2, 2025 06:24
@longlee0622 longlee0622 enabled auto-merge (squash) December 3, 2025 08:40
@longlee0622 longlee0622 added the Release Blocker PRs that blocking the final release build or branching out the release branch label Dec 3, 2025
@tensorrt-cicd
Copy link
Collaborator

PR_Github #26718 [ run ] completed with state SUCCESS. Commit: ae7eace
/LLM/main/L0_MergeRequest_PR pipeline #20335 completed with status: 'FAILURE'

@rosenrodt
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26771 [ run ] triggered by Bot. Commit: ae7eace

Copy link
Collaborator

@mikeiovine mikeiovine left a comment

Choose a reason for hiding this comment

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

Looks good to me

@rosenrodt rosenrodt marked this pull request as draft December 3, 2025 15:27
auto-merge was automatically disabled December 3, 2025 15:27

Pull request was converted to draft

@rosenrodt rosenrodt marked this pull request as ready for review December 3, 2025 16:16
@tensorrt-cicd
Copy link
Collaborator

PR_Github #26815 [ run ] triggered by Bot. Commit: 89e52f6

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26771 [ run ] completed with state ABORTED. Commit: ae7eace
LLM/main/L0_MergeRequest_PR #20384 (Blue Ocean) completed with status: ABORTED

@rosenrodt rosenrodt force-pushed the anchengc/align-autotune-across-ranks branch from 89e52f6 to 64ec271 Compare December 3, 2025 17:10
…back; last minute fix expert weight dtype

Signed-off-by: Anthony Chang <[email protected]>
@rosenrodt rosenrodt force-pushed the anchengc/align-autotune-across-ranks branch from 64ec271 to ab1838c Compare December 3, 2025 17:12
@tensorrt-cicd
Copy link
Collaborator

PR_Github #26822 [ run ] triggered by Bot. Commit: ab1838c

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26815 [ run ] completed with state ABORTED. Commit: 89e52f6
LLM/main/L0_MergeRequest_PR #20420 (Blue Ocean) completed with status: ABORTED

@rosenrodt
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26825 [ run ] triggered by Bot. Commit: ab1838c

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26822 [ run ] completed with state ABORTED. Commit: ab1838c
LLM/main/L0_MergeRequest_PR #20427 (Blue Ocean) completed with status: ABORTED

@rosenrodt
Copy link
Collaborator Author

/bot kill

@rosenrodt
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26846 [ kill ] triggered by Bot. Commit: ab1838c

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26825 [ run ] completed with state ABORTED. Commit: ab1838c
LLM/main/L0_MergeRequest_PR #20430 (Blue Ocean) completed with status: ABORTED

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26846 [ kill ] completed with state SUCCESS. Commit: ab1838c
Successfully killed previous jobs for commit ab1838c

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26847 [ run ] triggered by Bot. Commit: ab1838c

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26847 [ run ] completed with state FAILURE. Commit: ab1838c

@rosenrodt
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #26855 [ run ] triggered by Bot. Commit: ab1838c

Copy link
Member

@yizhang-nv yizhang-nv left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release Blocker PRs that blocking the final release build or branching out the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants