-
Notifications
You must be signed in to change notification settings - Fork 2k
[None] [fix] Fix missing ActivationType issue #9171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThis PR consolidates the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
jenkins/L0_MergeRequest.groovy(1 hunks)tensorrt_llm/_torch/auto_deploy/custom_ops/fused_moe/trtllm_moe.py(1 hunks)tensorrt_llm/_torch/custom_ops/torch_custom_ops.py(1 hunks)tensorrt_llm/_torch/modules/fused_moe/fused_moe_cutlass.py(1 hunks)tensorrt_llm/_torch/modules/fused_moe/interface.py(3 hunks)tensorrt_llm/_torch/modules/fused_moe/ops/moe_op_cutlass.py(1 hunks)tensorrt_llm/_torch/utils.py(2 hunks)tests/unittest/_torch/auto_deploy/unit/singlegpu/custom_ops/test_trtllm_moe.py(1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📚 Learning: 2025-08-09T20:57:04.084Z
Learnt from: sklevtsov-nvidia
Repo: NVIDIA/TensorRT-LLM PR: 3294
File: cpp/tensorrt_llm/kernels/cutlass_kernels/moe_gemm/moe_gemm_tma_warp_specialized_input.cu:118-127
Timestamp: 2025-08-09T20:57:04.084Z
Learning: In the CUTLASS MoE finalize fusion implementation (cpp/tensorrt_llm/kernels/cutlass_kernels/moe_gemm/moe_gemm_tma_warp_specialized_input.cu), when setting `fused_finalize_epilogue.stride_final_output` with shape `(hidden_size, num_output_tokens, 1)`, the `num_rows_in_final_output` should be set to `num_output_tokens` (not `hidden_size`) because of a swap+transpose operation that maps rows of the output tensor to `hidden_size` and columns to `num_output_tokens`.
Applied to files:
tensorrt_llm/_torch/modules/fused_moe/fused_moe_cutlass.pytensorrt_llm/_torch/modules/fused_moe/ops/moe_op_cutlass.py
📚 Learning: 2025-08-21T21:48:35.135Z
Learnt from: djns99
Repo: NVIDIA/TensorRT-LLM PR: 7104
File: cpp/tensorrt_llm/cutlass_extensions/include/cutlass_extensions/epilogue/fusion/sm90_visitor_scatter.hpp:399-417
Timestamp: 2025-08-21T21:48:35.135Z
Learning: CUTLASS extensions in TensorRT-LLM (located under cpp/tensorrt_llm/cutlass_extensions/) are designed to integrate with and extend functionality in the external CUTLASS repository. When analyzing these extensions, their consumers and functionality wiring may exist in the CUTLASS codebase rather than within TensorRT-LLM itself.
Applied to files:
tensorrt_llm/_torch/modules/fused_moe/fused_moe_cutlass.pyjenkins/L0_MergeRequest.groovy
📚 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:
tests/unittest/_torch/auto_deploy/unit/singlegpu/custom_ops/test_trtllm_moe.pyjenkins/L0_MergeRequest.groovytensorrt_llm/_torch/auto_deploy/custom_ops/fused_moe/trtllm_moe.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/auto_deploy/unit/singlegpu/custom_ops/test_trtllm_moe.pyjenkins/L0_MergeRequest.groovy
📚 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:
jenkins/L0_MergeRequest.groovy
📚 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:
jenkins/L0_MergeRequest.groovy
📚 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:
jenkins/L0_MergeRequest.groovy
📚 Learning: 2025-10-20T17:09:21.560Z
Learnt from: nvchenghaoz
Repo: NVIDIA/TensorRT-LLM PR: 8469
File: tensorrt_llm/_torch/auto_deploy/transform/library/rms_norm.py:180-182
Timestamp: 2025-10-20T17:09:21.560Z
Learning: In tensorrt_llm/_torch/auto_deploy/transform/library/rms_norm.py, the _gated_rmsnorm_replacement function does not need to cast the output of torch.ops.auto_deploy.torch_rmsnorm_gated back to the input dtype, even though the custom op returns fp32. The dtype handling is managed elsewhere or the fp32 output is acceptable for downstream consumers.
Applied to files:
tensorrt_llm/_torch/auto_deploy/custom_ops/fused_moe/trtllm_moe.py
🧬 Code graph analysis (4)
tests/unittest/_torch/auto_deploy/unit/singlegpu/custom_ops/test_trtllm_moe.py (2)
cpp/tensorrt_llm/kernels/cutlass_kernels/include/common.h (2)
tensorrt_llm(19-36)ActivationType(23-36)tensorrt_llm/_torch/utils.py (1)
ActivationType(34-43)
tensorrt_llm/_torch/modules/fused_moe/interface.py (1)
tensorrt_llm/_torch/utils.py (4)
ActivationType(34-43)Fp4QuantizedTensor(122-129)get_model_extra_attrs(76-77)is_torch_compiling(51-53)
tensorrt_llm/_torch/auto_deploy/custom_ops/fused_moe/trtllm_moe.py (2)
cpp/tensorrt_llm/kernels/cutlass_kernels/include/common.h (2)
tensorrt_llm(19-36)ActivationType(23-36)tensorrt_llm/_torch/utils.py (1)
ActivationType(34-43)
tensorrt_llm/_torch/custom_ops/torch_custom_ops.py (2)
tensorrt_llm/_torch/utils.py (2)
ActivationType(34-43)fp4_scale_infer_shape(274-279)cpp/tensorrt_llm/kernels/cutlass_kernels/include/common.h (1)
ActivationType(23-36)
⏰ 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). (3)
- GitHub Check: Check PR Checklist Resolution
- GitHub Check: Check PR Title Format
- GitHub Check: Pre-commit Check
🔇 Additional comments (10)
jenkins/L0_MergeRequest.groovy (1)
701-701: LGTM! Appropriate CI configuration update.Adding
torch_custom_ops.pyto the multi-GPU test trigger list aligns with the ActivationType refactoring and ensures proper test coverage when this file changes.tensorrt_llm/_torch/modules/fused_moe/ops/moe_op_cutlass.py (1)
85-85: LGTM! Correct propagation of activation_type.The change properly passes
module.activation_typeto theMoERunnerconstructor, aligning with the PR's objective to wire activation type handling through the MoE module chain.tensorrt_llm/_torch/utils.py (1)
4-4: LGTM! Correct import addition.Adding
IntEnumto the imports is necessary for the newActivationTypeenum class.tensorrt_llm/_torch/auto_deploy/custom_ops/fused_moe/trtllm_moe.py (1)
3-3: LGTM! Correct import path update.The import path correctly reflects the relocation of
ActivationTypefromtorch_custom_opsto the centralizedutilsmodule.tensorrt_llm/_torch/modules/fused_moe/fused_moe_cutlass.py (1)
568-568: LGTM! Correct parameter propagation.The change properly passes
self.activation_typeto thetorch.ops.trtllm.fused_moecall, completing the activation type parameter flow through the fused MoE path.tests/unittest/_torch/auto_deploy/unit/singlegpu/custom_ops/test_trtllm_moe.py (1)
15-15: LGTM! Correct import path update.The test correctly updates the import path to reference
ActivationTypefrom the centralizedutilsmodule.tensorrt_llm/_torch/modules/fused_moe/interface.py (3)
11-12: LGTM! Correct import addition.The import of
ActivationTypefromutilsis properly placed and aligns with the centralized enum definition.
147-147: LGTM! Appropriate default activation type.The default value
ActivationType.Swigluis appropriate for gated MLP architectures commonly used in MoE models.
165-165: LGTM! Correct storage as integer.Storing
activation_typeas an integer is appropriate for passing to C++ kernels, which expect integer enum values.tensorrt_llm/_torch/custom_ops/torch_custom_ops.py (1)
16-18: LGTM! Correct import path update.The import correctly references
ActivationTypefrom the centralizedutilsmodule, replacing the previous local definition.
|
/bot run |
|
PR_Github #24579 [ run ] triggered by Bot. Commit: |
nzmora-nvidia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and thanks for fixing this!
|
PR_Github #24579 [ run ] completed with state |
Signed-off-by: Kaiyu Xie <26294424+kaiyux@users.noreply.github.com>
8b2e19a to
fac38a8
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #24591 [ run ] triggered by Bot. Commit: |
|
PR_Github #24591 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #24639 [ run ] triggered by Bot. Commit: |
Signed-off-by: Enwei Zhu <21126786+syuoni@users.noreply.github.com>
|
/bot run --disable-fail-fast |
|
PR_Github #24642 [ run ] triggered by Bot. Commit: |
|
PR_Github #24639 [ run ] completed with state |
|
PR_Github #24642 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #24654 [ run ] triggered by Bot. Commit: |
|
PR_Github #24654 [ run ] completed with state |
Signed-off-by: Neta Zmora <96238833+nzmora-nvidia@users.noreply.github.com>
@nzmora-nvidia No worries, thanks for taking care of this PR! I've cherry-picked your fixes. |
|
/bot run --disable-fail-fast |
|
PR_Github #24662 [ run ] triggered by Bot. Commit: |
|
PR_Github #24662 [ run ] completed with state |
|
/bot run |
|
PR_Github #24674 [ run ] triggered by Bot. Commit: |
|
PR_Github #24674 [ run ] completed with state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fix the issue, but lets update the approach to be more robust to future changes.
As far as I know there is not a nice way to expose an enum through pybind, so that duplication will have to stay, but lets use the enum properly in the function list. (Can be a follow up to unblock)
Signed-off-by: Kaiyu Xie <26294424+kaiyux@users.noreply.github.com> Signed-off-by: Enwei Zhu <21126786+syuoni@users.noreply.github.com> Signed-off-by: Neta Zmora <96238833+nzmora-nvidia@users.noreply.github.com> Co-authored-by: Enwei Zhu <21126786+syuoni@users.noreply.github.com> Co-authored-by: Neta Zmora <96238833+nzmora-nvidia@users.noreply.github.com>
This PR: #9011 introduced a breaking change which breaks wide EP functionality.
Summary by CodeRabbit
Release Notes
New Features
Refactor
Description
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...Provide a user friendly way for developers to interact with a Jenkins server.
Run
/bot [-h|--help]to print this help message.See details below for each supported subcommand.
Details
run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]Launch build/test pipelines. All previously running jobs will be killed.
--reuse-test (optional)pipeline-id(OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.--disable-reuse-test(OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.--disable-fail-fast(OPTIONAL) : Disable fail fast on build/tests/infra failures.--skip-test(OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.--stage-list "A10-PyTorch-1, xxx"(OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.--gpu-type "A30, H100_PCIe"(OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.--test-backend "pytorch, cpp"(OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.--only-multi-gpu-test(OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.--disable-multi-gpu-test(OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.--add-multi-gpu-test(OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.--post-merge(OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx"(OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".--detailed-log(OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.--debug(OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in thestage-listparameter to access the appropriate container environment. Note: Does NOT update GitHub check status.For guidance on mapping tests to stage names, see
docs/source/reference/ci-overview.mdand the
scripts/test_to_stage_mapping.pyhelper.kill
killKill all running builds associated with pull request.
skip
skip --comment COMMENTSkip testing for latest commit on pull request.
--comment "Reason for skipping build/test"is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.reuse-pipeline
reuse-pipelineReuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.