Skip to content

[None][fix] AutoDeploy: Update the model yaml file for the correct world_size - #12115

Closed
nvchenghaoz wants to merge 14 commits into
NVIDIA:mainfrom
nv-auto-deploy:chenghao/update_0311
Closed

[None][fix] AutoDeploy: Update the model yaml file for the correct world_size#12115
nvchenghaoz wants to merge 14 commits into
NVIDIA:mainfrom
nv-auto-deploy:chenghao/update_0311

Conversation

@nvchenghaoz

@nvchenghaoz nvchenghaoz commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added support for HunYuan Dense V1, Granite MoE Hybrid, and Qwen3 model architectures
    • Introduced model registry integration with --use-registry flag for automatic configuration management
    • Added new debugging and review agents for model onboarding workflows
  • Bug Fixes

    • Fixed token_type_ids parameter handling in model inference
  • Configuration

    • Updated default backends and hyperparameters for improved performance
    • Added configurations for multiple new model variants
  • Documentation

    • Added comprehensive model onboarding skill documentation and agent guidelines
  • Tests

    • Added test suites for new model implementations

lucaslie and others added 14 commits March 9, 2026 15:29
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Balamurugan Marimuthu <246387390+bmarimuthu-nv@users.noreply.github.com>
* build_and_run_ad.py from registry

Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>

* csv generator file

Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>

---------

Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Balamurugan Marimuthu <246387390+bmarimuthu-nv@users.noreply.github.com>
Signed-off-by: Balamurugan Marimuthu <246387390+bmarimuthu-nv@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Working models: ibm-granite/granite-4.0-micro, ibm-granite/granite-4.0-tiny-preview, ibm-granite/granite-4.0-h-small 

Signed-off-by: Govind Ramnarayan <105831528+govind-ramnarayan@users.noreply.github.com>
* hunyuan model onboarding

Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>

* support hunyuan instruct model

Signed-off-by: nvchenghaoz <211069071+nvchenghaoz@users.noreply.github.com>

* update world_size for hunyuan models

Signed-off-by: nvchenghaoz <211069071+nvchenghaoz@users.noreply.github.com>

---------

Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
Signed-off-by: nvchenghaoz <211069071+nvchenghaoz@users.noreply.github.com>
* [None][feat] Add AutoDeploy custom model for Qwen3 (Qwen/Qwen3-0.6B-FP8)

Add prefill-only Qwen3 custom model implementation for AutoDeploy export
with GQA attention, per-head Q/K normalization, and FP8 dtype handling.

- Custom model: modeling_qwen3.py using torch_attention and torch_rope ops
- Hierarchical equivalence tests against HF reference (MLP, attention,
  decoder layer, full model, export with dynamic shapes)
- AD config with fuse_finegrained_fp8_linear disabled (CUDA 13.1 NVRTC
  workaround)

Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>

* [None][fix] Address PR feedback: use torch_rmsnorm op, simplify yaml

- Replace custom RMSNorm implementation with torch.ops.auto_deploy.torch_rmsnorm
- Simplify AD config yaml to only override fuse_finegrained_fp8_linear

Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>

* [None][fix] Add SM check to fuse_finegrained_fp8_linear, remove FP8 config override

- Skip fuse_finegrained_fp8_linear on SM < 100 (Hopper and below) since
  fp8_block_scaling_gemm requires Blackwell (SM 100+)
- Remove the no-longer-needed qwen3_0_6b_fp8_no_fuse_fp8.yaml config override

Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>

* [None][fix] Move position slicing to RoPE, assert position_ids, update models.yaml

- Move cos/sin position_ids slicing from attention into RoPE forward
  (avoids redundant slicing per layer)
- Assert position_ids is not None in both Model and ForCausalLM forward
  (no fallback — AD always provides position_ids)
- Update Qwen3-14B and Qwen3-32B to world_size_2 in models.yaml

Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>

---------
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
Signed-off-by: Chenghao Zhang <211069071+nvchenghaoz@users.noreply.github.com>
@nvchenghaoz
nvchenghaoz requested a review from a team as a code owner March 11, 2026 17:59
@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a77bf12e-b31c-4dd1-8215-83620edb33cf

📥 Commits

Reviewing files that changed from the base of the PR and between f90b35f and 3819269.

📒 Files selected for processing (30)
  • .claude/agents/ad-run-agent.md
  • .claude/skills/ad-model-onboard/SKILL.md
  • .codex/AGENTS.md
  • .codex/agents/ad_debug_agent.toml
  • .codex/agents/ad_onboard_reviewer.toml
  • .codex/agents/ad_run_agent.toml
  • .codex/config.toml
  • .codex/skills/ad-model-onboard/SKILL.md
  • examples/auto_deploy/build_and_run_ad.py
  • examples/auto_deploy/model_registry/configs/dashboard_default.yaml
  • examples/auto_deploy/model_registry/configs/granite_4.0_h_small.yaml
  • examples/auto_deploy/model_registry/configs/granite_4.0_micro.yaml
  • examples/auto_deploy/model_registry/configs/granite_4.0_tiny_preview.yaml
  • examples/auto_deploy/model_registry/configs/hunyuan_mt_7b.yaml
  • examples/auto_deploy/model_registry/configs/minimax_m2.yaml
  • examples/auto_deploy/model_registry/configs/nemotron_flash.yaml
  • examples/auto_deploy/model_registry/generate_csv.py
  • examples/auto_deploy/model_registry/models.yaml
  • tensorrt_llm/_torch/auto_deploy/config/default.yaml
  • tensorrt_llm/_torch/auto_deploy/llm.py
  • tensorrt_llm/_torch/auto_deploy/llm_args.py
  • tensorrt_llm/_torch/auto_deploy/models/custom/__init__.py
  • tensorrt_llm/_torch/auto_deploy/models/custom/modeling_granite_moe_hybrid.py
  • tensorrt_llm/_torch/auto_deploy/models/custom/modeling_hunyuan_dense_v1.py
  • tensorrt_llm/_torch/auto_deploy/models/custom/modeling_qwen3.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/fuse_quant.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/rms_norm.py
  • tests/unittest/auto_deploy/singlegpu/models/test_granite_moe_hybrid_modeling.py
  • tests/unittest/auto_deploy/singlegpu/models/test_hunyuan_dense_v1_modeling.py
  • tests/unittest/auto_deploy/singlegpu/models/test_qwen3_modeling.py

📝 Walkthrough

Walkthrough

Introduces AutoDeploy model onboarding infrastructure with agent configurations for running, debugging, and reviewing model onboarding; three new custom model implementations (GraniteMoeHybrid, HunYuanDenseV1, Qwen3) for prefill-only inference; model registry with yaml_extra config support; updated default backends and performance parameters; and comprehensive test suites for model equivalence and export validation.

Changes

Cohort / File(s) Summary
Agent & Skill Documentation
.claude/agents/ad-run-agent.md, .claude/skills/ad-model-onboard/SKILL.md, .codex/AGENTS.md, .codex/agents/ad_debug_agent.toml, .codex/agents/ad_onboard_reviewer.toml, .codex/agents/ad_run_agent.toml, .codex/config.toml, .codex/skills/ad-model-onboard/SKILL.md
Introduces agent/skill framework for AutoDeploy onboarding workflow including run automation, adversarial reviewer, and debugging guidance; replaces Phase 8 summary with end-to-end deployment run configuration.
Custom Model Implementations
tensorrt_llm/_torch/auto_deploy/models/custom/modeling_granite_moe_hybrid.py, tensorrt_llm/_torch/auto_deploy/models/custom/modeling_hunyuan_dense_v1.py, tensorrt_llm/_torch/auto_deploy/models/custom/modeling_qwen3.py, tensorrt_llm/_torch/auto_deploy/models/custom/__init__.py
Adds three complete prefill-only custom model implementations with RMSNorm, rotary embeddings, attention/MLP blocks, and causal LM heads; registered for AutoDeploy export via factory pattern.
Model Registry Integration
examples/auto_deploy/build_and_run_ad.py, examples/auto_deploy/model_registry/generate_csv.py, examples/auto_deploy/model_registry/models.yaml
Introduces registry lookup for yaml_extra configs with command-line injection (\-\-use-registry flag); updates 34+ model entries with new or consolidated config references; adds CSV generation utility.
Model Configuration Files
examples/auto_deploy/model_registry/configs/granite_4.0_*.yaml, examples/auto_deploy/model_registry/configs/hunyuan_mt_7b.yaml, examples/auto_deploy/model_registry/configs/minimax_m2.yaml, examples/auto_deploy/model_registry/configs/dashboard_default.yaml
Adds specialized YAML config presets for Granite, HunYuan, Minimax, and Qwen models; removes redundant compile_backend, model_factory, and skip_loading_weights from dashboard defaults.
Default Configuration & Backend Changes
tensorrt_llm/_torch/auto_deploy/config/default.yaml, tensorrt_llm/_torch/auto_deploy/llm_args.py, tensorrt_llm/_torch/auto_deploy/llm.py
Updates default backends (flashinfer→trtllm, torch-compile→torch-cudagraph) and increases performance defaults (max_seq_len 512→2048, max_batch_size 8→64, batch_size 2→10); adds token_type_ids removal in input processor.
Transform & Utility Updates
tensorrt_llm/_torch/auto_deploy/transform/library/fuse_quant.py, tensorrt_llm/_torch/auto_deploy/transform/library/rms_norm.py
Adds CUDA capability guard (SM < 100 skip) for FP8 quantization transforms; preserves fake-tensor metadata in RMSNorm fusion.
Model Equivalence & Export Tests
tests/unittest/auto_deploy/singlegpu/models/test_granite_moe_hybrid_modeling.py, tests/unittest/auto_deploy/singlegpu/models/test_hunyuan_dense_v1_modeling.py, tests/unittest/auto_deploy/singlegpu/models/test_qwen3_modeling.py
Adds comprehensive test suites validating component and full-model equivalence with HuggingFace references, torch_export_to_gm correctness, and numerical parity across dynamic shapes; includes block-level, layer, and end-to-end comparisons.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Suggested reviewers

  • chang-l
  • Shixiaowei02
  • Fridah-nv
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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.

4 participants