KEMBAR78
[#5860][autodeploy] GPT-OSS MXFP4 support by Fridah-nv · Pull Request #7451 · NVIDIA/TensorRT-LLM · GitHub
Skip to content

Conversation

@Fridah-nv
Copy link
Collaborator

@Fridah-nv Fridah-nv commented Sep 1, 2025

This PR does the following:

  1. Add custom op for the routing and MoE part of GptOssExperts separately:
  2. initialize the model in bf16 and pattern match to the two ops above
  3. Add a custom op that wraps triton_kernel's routing and MoE kernels, map the tensors from state_dict to the expected format of the triton kernels
  4. Add a transform that map torch.ops.auto_deploy.torch_moe_router and torch.ops.auto_deploy.torch_moe_dense_mlp to torch.ops.auto_deploy.triton_mxfp4_moe, register the new params expected from checkpoint
  5. Add ep sharding for torch.ops.auto_deploy.triton_mxfp4_moe

env requirements for huggingface to load MXFP4 model

pip install triton==3.4.0
pip install kernels
pip install transformers==4.56.1

Currently sharding uses tensorrt_llm._torch.modules.fused_moe.fused_moe_triton.TritonEPRouter which requires building triton from source:

cd path/to/triton
pip install -r python/requirements.txt # build-time dependencies
pip install -e .
cd python/triton_kernels
pip install -e .
export PYTHONPATH=/code/tensorrt_llm/tmp/triton/python:$PYTHONPATH

Verified with triton version 3.5 +, commit sha: f22c53ad7

Tested on 8*H200, model is able to load onto one H200.
Tested with command:

python build_and_run_ad.py \
--model "/workspaces/tensorrt_llm/models/openai/gpt-oss-20b" \
--args.world-size 1 \
--args.compile-backend "torch-simple" \
--args.attn-backend "torch"

python build_and_run_ad.py \
--model "/workspaces/tensorrt_llm/models/openai/gpt-oss-20b" \
--args.world-size 8 \
--args.compile-backend "torch-simple" \
--args.attn-backend "torch"

Output (WS=1 and WS=8 are the same)

[09/23/2025-00:24:09] [TRT-LLM AUTO-DEPLOY] [I] [PROMPT 0] How big is the universe? : 1.5 trillion light years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13.8 billion years? 13
[09/23/2025-00:24:09] [TRT-LLM AUTO-DEPLOY] [I] [PROMPT 1] In simple words and a single sentence, explain the concept of gravity: : 1) The 2nd law of Newton's law?

The second law of Newton's law states that the force acting on an object is equal to the mass of the object multiplied by its acceleration.

The second law of Newton's

The second law of Newton states that the force acting on an object is equal to the mass of the object multiplied by its acceleration.

The second law of Newton states that the force acting on an object is equal to the mass of the object multiplied by its

It's a bit repetitive, but the BF16 model gives something similar with torch attention backend. See discussions: https://nvidia.slack.com/archives/C08T55LHSG4/p1756162597642669?thread_ts=1756142462.162129&cid=C08T55LHSG4

Summary by CodeRabbit

  • New Features

    • Added MXFP4-based MoE support, including fused MoE router and dense MLP operators.
    • Introduced cached attention with cache initialization and resizing in the default pipeline.
    • Export path updated to use a fused router for GPT-Oss Top-K routing.
    • Model dtype now adapts automatically based on quantization settings.
  • Refactor

    • Reorganized the default deployment pipeline to include initialization/caching steps and finalize with model compilation.
    • Removed deprecated transforms (quantization, sharding, and fusion passes) from the default configuration to streamline processing.

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

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

@Fridah-nv Fridah-nv self-assigned this Sep 1, 2025
@Fridah-nv Fridah-nv requested a review from a team as a code owner September 1, 2025 19:46
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 1, 2025

📝 Walkthrough

Walkthrough

Adds MXFP4 MoE support: new custom ops (mxfp4_mlp, torch_moe_router, torch_moe_dense_mlp), FX transforms to match/insert MXFP4 MoE, a GPT‑Oss router export patch, adjustments to AutoDeploy pipeline (remove quantize/sharding/fusion stages, add cache initialization steps), and HF model dtype selection via quantizer.

Changes

Cohort / File(s) Summary
Transform pipeline config
tensorrt_llm/_torch/auto_deploy/config/default.yaml
Renamed match_moe_patternmatch_dense_moe_pattern; added insert_mxfp4_mlp; removed blocks for redundant-transposes/rope/quantize_moe/quantize_from_* /detect_sharding/sharding_executor and post-load fusions (fuse_*); inserted cached/flattened-attention init transforms (update_in_out_nodes, insert_cached_attention, insert_cached_mla_attention (attn_backend: MultiHeadLatentAttention), initialize_cache, resize_kv_cache); retained compile_model.
Custom ops package exports
tensorrt_llm/_torch/auto_deploy/custom_ops/__init__.py
Re-exported modules: added from .mxfp4 import * and from .torch_router import *.
MXFP4 custom op
tensorrt_llm/_torch/auto_deploy/custom_ops/mxfp4.py
New op auto_deploy::mxfp4_mlp (and fake variant) implementing FP4-weighted fused MoE MLP via Triton kernels hub; includes weight swizzle/scale handling and routing integration.
MoE runtime ops
tensorrt_llm/_torch/auto_deploy/custom_ops/torch_router.py
.../custom_ops/torch_moe.py
Added auto_deploy::torch_moe_router and auto_deploy::torch_moe_dense_mlp with registered fake implementations for meta/shape contexts; implement router top-k and dense per-expert MLP aggregation.
FX transform library
tensorrt_llm/_torch/auto_deploy/transform/library/mxfp4.py
New FX transforms: MatchMOEDenseMLP, MatchMOERouter, InsertMXFP4MLP; utilities to register MXFP4 expert params, extract alpha/limit/top_k, and pattern/replacement implementations to rewrite FX graphs to use mxfp4 ops/params.
Export patch
tensorrt_llm/_torch/auto_deploy/models/patches/gptoss-mxfp4.py
Added GptOssTopKRouterPatch that replaces GPT‑Oss router forward with a fused torch_moe_router call during export and supports revert.
HF model factory dtype handling
tensorrt_llm/_torch/auto_deploy/models/hf.py
After model.eval(), derive dtype via AutoHfQuantizer(model_config.quantization_config, pre_quantized=True).update_dtype(model_config.dtype) and cast model to that dtype (replacing prior unconditional bf16 cast).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Exporter
  participant Model
  participant Patch as GptOssTopKRouterPatch
  participant Op as torch.ops.auto_deploy.torch_moe_router

  Exporter->>Patch: apply()
  Exporter->>Model: forward(hidden_states)
  Note over Model: Router.forward replaced
  Model->>Op: torch_moe_router(hs, weight, bias, top_k)
  Op-->>Model: router_scores [T,E]
  Model-->>Exporter: (router_scores, None)
  Exporter->>Patch: revert()
Loading
sequenceDiagram
  autonumber
  participant FX_Graph
  participant PatternMatcher
  participant InsertMXFP4
  participant CacheInit
  participant Compile

  FX_Graph->>PatternMatcher: match_dense_moe_pattern / match_moe_router
  PatternMatcher-->>FX_Graph: replace nodes with torch_moe_* calls
  FX_Graph->>InsertMXFP4: insert_mxfp4_mlp
  InsertMXFP4-->>FX_Graph: add mxfp4_mlp nodes + expert params
  FX_Graph->>CacheInit: update_in_out_nodes / insert_cached_* / initialize_cache / resize_kv_cache
  CacheInit-->>FX_Graph: kvcache nodes added
  FX_Graph->>Compile: compile_model
  Compile-->>FX_Graph: compiled artifact
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

SW Architecture

Suggested reviewers

  • suyoggupta
  • yizhang-nv
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Fridah-nv Fridah-nv marked this pull request as draft September 1, 2025 19:47
@Fridah-nv Fridah-nv force-pushed the user/fridah/oss-mxfp4 branch from 76c0156 to 89d5727 Compare September 1, 2025 19:55
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: 3

🧹 Nitpick comments (9)
tensorrt_llm/_torch/auto_deploy/custom_ops/mxfp4.py (4)

1-3: Add NVIDIA copyright header.

All source files must include the current-year NVIDIA header.

Apply:

+# Copyright (c) 2025, NVIDIA CORPORATION.  All rights reserved.
+
 import torch

45-69: Docstring return mismatch.

Docstring says the op returns routed_out and router_logits, but the function returns only routed_out. Fix the docstring to avoid confusion in downstream users and tooling.

Apply:

-    Return:
-      routed_out:   same leading shape as hidden_states, last dim = H
-      router_logits: [T, E] (T = number of tokens = prod(hidden_states.shape[:-1]))
+    Return:
+      routed_out: same leading shape as hidden_states, last dim = H

6-13: Harden kernel hub import with a clear error message.

If kernels hub is unavailable, the import will fail at runtime without context. Raise a descriptive error.

Apply:

 def _hub():
     global _triton_kernels_hub
     if _triton_kernels_hub is None:
-        from kernels import get_kernel
-
-        _triton_kernels_hub = get_kernel("kernels-community/triton_kernels")
+        try:
+            from kernels import get_kernel
+            _triton_kernels_hub = get_kernel("kernels-community/triton_kernels")
+        except Exception as e:
+            raise RuntimeError(
+                "Failed to load Triton kernels hub 'kernels-community/triton_kernels'. "
+                "Ensure kernels are installed and discoverable."
+            ) from e
     return _triton_kernels_hub

15-26: Follow codebase globals convention (G_ prefix, UPPER_SNAKE_CASE).

_global _triton_kernels_hub violates the repository’s Python globals naming rule.

Apply:

-_triton_kernels_hub = None
+G_TRITON_KERNELS_HUB = None
@@
-    global _triton_kernels_hub
-    if _triton_kernels_hub is None:
+    global G_TRITON_KERNELS_HUB
+    if G_TRITON_KERNELS_HUB is None:
@@
-        _triton_kernels_hub = get_kernel("kernels-community/triton_kernels")
-    return _triton_kernels_hub
+        G_TRITON_KERNELS_HUB = get_kernel("kernels-community/triton_kernels")
+    return G_TRITON_KERNELS_HUB

Also update its single reference at Line 17 accordingly.

tensorrt_llm/_torch/auto_deploy/transform/library/mxfp4.py (5)

1-3: Add NVIDIA copyright header.

New source files must include the current-year NVIDIA header.

Apply:

+# Copyright (c) 2025, NVIDIA CORPORATION.  All rights reserved.
+
 from typing import Tuple

124-139: Router pattern return annotation is incorrect.

Function returns a single Tensor, but type hints declare a Tuple. Align annotation to avoid confusion and tooling issues.

Apply:

-def _router_pattern(
+def _router_pattern(
     hidden_states: torch.Tensor,
     weight: torch.Tensor,
     bias: torch.Tensor,
     top_k: int = 2,
-) -> Tuple[torch.Tensor, torch.Tensor]:
+) -> torch.Tensor:
@@
-    return router_scores
+    return router_scores

(Only the return type changes.)


150-163: Remove stray debug print.

Printing the FX graph during transforms is noisy and pollutes logs. Use logging if needed.

Apply:

-        print(str(graph))

215-218: Register expert blocks/scales as buffers, not parameters.

These tensors are inference-only metadata. Registering as parameters can perturb optimizers and state dict semantics.

Apply:

-def _ensure_param(mod: nn.Module, name: str, tensor: torch.Tensor) -> None:
-    if not hasattr(mod, name):
-        mod.register_parameter(name, nn.Parameter(tensor, requires_grad=False))
+def _ensure_param(mod: nn.Module, name: str, tensor: torch.Tensor) -> None:
+    if not hasattr(mod, name):
+        mod.register_buffer(name, tensor, persistent=True)

No other call sites need changes since attributes are accessed via get_attr nodes.


356-359: Potential name collisions for newly registered attributes.

gate_up_proj_blocks/scales and down_proj_blocks/scales are generic. If users re-run transforms, these may exist already. Consider suffixing with a stable tag or checking existence before registering.

You already guard with hasattr in _ensure_param, but add a prefix (e.g., ad) or a model-unique tag to avoid clashes across different experts modules if multiple MoE blocks exist.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 76c0156 and f06b436.

📒 Files selected for processing (5)
  • tensorrt_llm/_torch/auto_deploy/config/default.yaml (1 hunks)
  • tensorrt_llm/_torch/auto_deploy/custom_ops/__init__.py (1 hunks)
  • tensorrt_llm/_torch/auto_deploy/custom_ops/mxfp4.py (1 hunks)
  • tensorrt_llm/_torch/auto_deploy/models/hf.py (1 hunks)
  • tensorrt_llm/_torch/auto_deploy/transform/library/mxfp4.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • tensorrt_llm/_torch/auto_deploy/custom_ops/init.py
  • tensorrt_llm/_torch/auto_deploy/config/default.yaml
🧰 Additional context used
📓 Path-based instructions (4)
**/*

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Filenames compiled into a target must be case-insensitively unique

Files:

  • tensorrt_llm/_torch/auto_deploy/models/hf.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/mxfp4.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/mxfp4.py
**/*.{h,hpp,hh,hxx,cc,cpp,cxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Use spaces, not tabs; indent 4 spaces

Files:

  • tensorrt_llm/_torch/auto_deploy/models/hf.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/mxfp4.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/mxfp4.py
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Code must target Python 3.8+
Indent with 4 spaces; do not use tabs (Python)
Maintain module namespace on import: prefer from package.subpackage import foo; use foo.Symbol()
Python filenames use snake_case
Python class names use PascalCase
Python functions and methods use snake_case
Python local variables use snake_case; if starting with a number concept, prefix with k (e.g., k_99th_percentile)
Python global variables use G_ prefix with UPPER_SNAKE_CASE
Python constants use UPPER_SNAKE_CASE
Avoid shadowing variables from outer scopes
Initialize all externally visible class members in init
For public interfaces, prefer docstrings over comments; comments should be for in-function or file-local interfaces
Use Google-style docstrings for classes and functions (Sphinx-parsable)
Document attributes and variables inline with docstrings immediately after assignment
Avoid reflection when a non-reflective approach suffices
Limit except clauses to specific exceptions where possible
When using try/except for duck-typing, keep try body minimal and move logic to else

Files:

  • tensorrt_llm/_torch/auto_deploy/models/hf.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/mxfp4.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/mxfp4.py
**/*.{cpp,cc,cxx,h,hpp,hh,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend NVIDIA copyright header (current year) to all source files

Files:

  • tensorrt_llm/_torch/auto_deploy/models/hf.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/mxfp4.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/mxfp4.py
🧬 Code graph analysis (2)
tensorrt_llm/_torch/auto_deploy/models/hf.py (2)
tensorrt_llm/_torch/auto_deploy/custom_ops/attention_interface.py (1)
  • to (336-340)
tensorrt_llm/_torch/auto_deploy/shim/interface.py (1)
  • to (33-37)
tensorrt_llm/_torch/auto_deploy/transform/library/mxfp4.py (6)
tensorrt_llm/_torch/auto_deploy/utils/pattern_matcher.py (2)
  • ADPatternMatcherPass (61-67)
  • register_ad_pattern (99-182)
tensorrt_llm/_torch/auto_deploy/utils/node_utils.py (1)
  • is_op (183-206)
tensorrt_llm/_torch/auto_deploy/transform/interface.py (3)
  • BaseTransform (139-378)
  • TransformInfo (108-133)
  • TransformRegistry (381-409)
tensorrt_llm/_torch/auto_deploy/custom_ops/torch_moe.py (1)
  • torch_moe_dense_mlp (343-372)
tensorrt_llm/_torch/auto_deploy/custom_ops/torch_router.py (1)
  • torch_moe_router (6-31)
tensorrt_llm/_torch/auto_deploy/custom_ops/mxfp4.py (1)
  • mxfp4_mlp (46-140)
⏰ 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 (1)
tensorrt_llm/_torch/auto_deploy/models/hf.py (1)

174-183: Approve import guard and dtype fallback

The try-except around AutoHfQuantizer import handles missing transformers, quantization_config is None is checked, and model.to() is only called when a valid dtype is determined.

@Fridah-nv Fridah-nv linked an issue Sep 8, 2025 that may be closed by this pull request
5 tasks
@Fridah-nv Fridah-nv force-pushed the user/fridah/oss-mxfp4 branch from f06b436 to 27d15ec Compare September 8, 2025 16:40
@Fridah-nv Fridah-nv removed the request for review from nvchenghaoz September 8, 2025 16:45
@Fridah-nv Fridah-nv force-pushed the user/fridah/oss-mxfp4 branch from 27d15ec to 9e77893 Compare September 15, 2025 20:00
@Fridah-nv Fridah-nv marked this pull request as ready for review September 23, 2025 00:17
@Fridah-nv Fridah-nv force-pushed the user/fridah/oss-mxfp4 branch from 38117f0 to b6291d0 Compare September 23, 2025 00:27
@Fridah-nv Fridah-nv changed the title [#5860][autodeploy] GPT-OSS MXFP4 support V3: pure graph approach [#5860][autodeploy] GPT-OSS MXFP4 support Sep 23, 2025
@Fridah-nv Fridah-nv force-pushed the user/fridah/oss-mxfp4 branch from e61f11f to 6cc41b1 Compare September 24, 2025 00:04
Copy link
Collaborator

@greg-kwasniewski1 greg-kwasniewski1 left a comment

Choose a reason for hiding this comment

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

In general, looks good for me. I left comments throughout the files. My only concern is the sharding logic when num_experts % world_size != 0, and a mismatch between the test and the actual logic.

@Fridah-nv Fridah-nv force-pushed the user/fridah/oss-mxfp4 branch from 33fa7ba to 94a0490 Compare September 25, 2025 18:25
@Fridah-nv
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #19987 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@Fridah-nv
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #19998 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@Fridah-nv
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20017 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

minor update on default.yaml

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

minor update on default.yaml

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>
Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

add new custom op

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

add HfQuantizer

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>
Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

use TRTLLM EPRouter for sharding support

Signed-off-by: Fridah-nv <201670829+Fridah-nv@users.noreply.github.com>
…de duplication

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

minor file rename

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>
Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

update quantize_mxfp4_moe transform to read from quant config

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>
Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>
…tter naming and comments use simple expert load balancing

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

minor

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

minor

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

move get_submodule to new util function

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>

minor:move QuantConfigReader detection to quant_config_reader.py

Signed-off-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com>
@Fridah-nv Fridah-nv force-pushed the user/fridah/oss-mxfp4 branch from 54d8edd to bc5edc1 Compare September 26, 2025 05:19
@Fridah-nv
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20043 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20043 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #15099 completed with status: 'FAILURE'

@Fridah-nv
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20107 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@Fridah-nv
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20114 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20114 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15157 completed with status: 'SUCCESS'

@Fridah-nv Fridah-nv merged commit a36b48b into NVIDIA:main Sep 26, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in AutoDeploy Board Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[AutoDeploy]:Unify Checkpoint and Graph-Based Quantization Detection

5 participants