Skip to content

[#14588][feat] AutoDeploy: DeepSeek-R1 optimization for low concurrency#14810

Merged
taylor-yb-lee merged 45 commits into
NVIDIA:mainfrom
nv-auto-deploy:taylor/dsr1_nvfp4_opt
Jul 6, 2026
Merged

[#14588][feat] AutoDeploy: DeepSeek-R1 optimization for low concurrency#14810
taylor-yb-lee merged 45 commits into
NVIDIA:mainfrom
nv-auto-deploy:taylor/dsr1_nvfp4_opt

Conversation

@taylor-yb-lee

@taylor-yb-lee taylor-yb-lee commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for DeepSeek-R1-0528-NVFP4-v2 model variant
  • Performance Improvements

    • Enhanced multi-stream execution for improved throughput
    • Optimized expert-merging and routing in MoE models
    • Added kernel fusions for normalization operations
    • Improved CUDA graph compatibility

Description

  • Achieved 120 tps for ISL1K/OSL1K, Conc1 at B200x4
  • Multi stream MLA : overlap q_b, kv_b
  • Use dsv3 gemms: fuse MLA q_a + kv_a_with_mqa into dsv3_fused_a_gemm
  • Use dsv3_router_gemm
  • Fuse MoE allReduce with residual RMS Norm, residual Add into the triton RMSNorm
  • Remove redundant copy and .contiguous
  • Remove MLA deinterleaving loadhook from modeling code (It was added to optimize out deinterleaving part, but now it is not needed because trtllm-attn can handle interleaved input. )
  • Fix MoE all-to-all regression : prevent cudagraph eager bypass for non-attn DB case
  • Add accuracy test for DSR1 NVFP4 in the post merge test. (gsm8k 94.24)

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)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • 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

To see a list of available CI bot commands, please comment /bot help.

@taylor-yb-lee taylor-yb-lee force-pushed the taylor/dsr1_nvfp4_opt branch 2 times, most recently from 6172683 to c967775 Compare June 4, 2026 22:49
@taylor-yb-lee taylor-yb-lee changed the title [DRAFT][AutoDeploy] wip) dsr1 nvfp4 optimization [#14588][feat] AutoDeploy: DeepSeek-R1 optimization for low concurrency Jun 10, 2026
@taylor-yb-lee taylor-yb-lee force-pushed the taylor/dsr1_nvfp4_opt branch 4 times, most recently from 33d0a57 to a31e9d1 Compare June 14, 2026 07:00
@taylor-yb-lee taylor-yb-lee marked this pull request as ready for review June 14, 2026 07:19
@taylor-yb-lee taylor-yb-lee requested review from a team as code owners June 14, 2026 07:19
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds nvidia/DeepSeek-R1-0528-NVFP4-v2 to the AutoDeploy model registry by introducing new DSv3 fused GEMM, router, EP-local routing, and Triton add+RMSNorm custom ops; refactoring the DeepSeek model forward pass (MoE all-reduce ordering, KV-before-Q, GPTJ RoPE layout); extending multi-stream CUDA scheduling with per-id event pools and two new MLA KV-cone overlap patterns; and updating graph transforms and sharding logic to consume these new primitives.

Changes

DeepSeek-R1 NVFP4-v2 support: custom ops, transforms, multi-stream scheduling, and model registry

Layer / File(s) Summary
New DSv3 custom ops: fused-A-GEMM, router-GEMM, triton add+RMSNorm, EP local route
tensorrt_llm/_torch/auto_deploy/custom_ops/normalization/triton_rms_norm.py, tensorrt_llm/_torch/auto_deploy/custom_ops/fused_moe/triton_routing.py, tensorrt_llm/_torch/auto_deploy/custom_ops/linear/dsv3_fused_a_gemm.py, tensorrt_llm/_torch/auto_deploy/custom_ops/linear/dsv3_router_gemm.py, tensorrt_llm/_torch/auto_deploy/custom_ops/linear/linear.py, tensorrt_llm/_torch/auto_deploy/custom_ops/linear/__init__.py, tensorrt_llm/_torch/auto_deploy/custom_ops/linear/swiglu.py
Adds four new AutoDeploy custom ops: dsv3_fused_a_gemm, dsv3_router_gemm, triton_fused_add_rms_norm (fused residual-add + RMSNorm in a single Triton pass), and ep_local_route (EP-local expert index remapping and weight masking via Triton). Updates linear.simple() to dispatch specific DSv3 A-proj weight shapes to dsv3_fused_a_gemm, and swiglu.py to prefer trtllm.silu_and_mul.
MLA decode optimizations and GPTJ RoPE layout detection
tensorrt_llm/_torch/auto_deploy/custom_ops/mla/trtllm_mla.py, tensorrt_llm/_torch/auto_deploy/models/custom/mla_rope_utils.py
Removes the q_absorbed intermediate in _handle_decode_impl by writing directly into fused_q_view with torch.bmm(out=...). Reduces unconditional .contiguous() calls in _mla_with_cache_impl. Adds is_gptj_layout() predicate and _GPTJ_LAYOUT_MODEL_TYPES frozenset for detecting deepseek_v3 native GPTJ RoPE weight layout.
DeepSeek model forward: MoE gate BF16, shared expert type, KV-before-Q, RoPE load hook removal
tensorrt_llm/_torch/auto_deploy/models/custom/modeling_deepseek.py
Removes explicit dtype=torch.float32 from DeepSeekV3MoEGate.weight to enable the dsv3_router_gemm_op path. Sets shared expert layer_type="shared_expert". Changes DeepSeekV3MoE.forward to all-reduce routed output before adding shared expert. Reorders DeepSeekV3Attention.forward to compute KV before Q for FX multi-stream scheduling. Removes the RoPE load-time de-interleave hook from DeepSeekV3ForCausalLM.
Multi-stream CUDA utilities: per-id event pool, debug counters, V19 MoE aux wrapper
tensorrt_llm/_torch/auto_deploy/utils/multi_stream_utils.py
Adds events_per_id dict and get_event_for_id() to CudaStreamManager for CUDA-graph-safe per-fork event allocation. Extends begin/end/wait_aux_stream_passthrough with event_id parameter. Adds AD_DEBUG_MULTI_STREAM diagnostic counters. Adds dsv3_moe_shared_mlp_in_aux_wrapped (V19) to run fused_nvfp4_swiglu_mlp on the aux stream.
Multi-stream MLA attention: Pattern 3 (no-AllGather KV chain) and Pattern 2 (fused KV-cone)
tensorrt_llm/_torch/auto_deploy/transform/library/multi_stream_attn.py
Adds _is_narrow_op and DSv3 split-size constants. Implements Pattern 3 wrapping the unfused KV chain on aux stream (no downstream AllGather path). Implements Pattern 2 BFS-collecting the fused KV cone and wrapping with aux-stream begin/end/wait. Reworks _apply to attempt Pattern 3 → Pattern 2 → Pattern 1 in order.
Multi-stream MoE: V19 gated shared-MLP aux wrapper
tensorrt_llm/_torch/auto_deploy/transform/library/multi_stream_moe.py
Imports dsv3_moe_shared_mlp_in_aux_wrapped. Adds a disabled _V19_ENABLE_WRAP path that, when enabled, replaces the shared-expert begin+MLP+end with a single Dynamo-disabled FX call node for fused_nvfp4_swiglu_mlp.
Graph transforms: fused norm (Triton path), MoE all-reduce fusion, GEMM non-contiguous, RoPE layout, fused MoE routing
tensorrt_llm/_torch/auto_deploy/transform/library/fused_add_rms_norm.py, tensorrt_llm/_torch/auto_deploy/transform/library/fuse_moe_allreduce_residual_rmsnorm.py, tensorrt_llm/_torch/auto_deploy/transform/library/fusion.py, tensorrt_llm/_torch/auto_deploy/transform/library/fuse_rope_mla.py, tensorrt_llm/_torch/auto_deploy/transform/library/fused_moe.py
Extends FuseAddRmsNorm to match triton_rms_norm and dispatch to triton_fused_add_rms_norm. Adds FuseMoEAllreduceResidualRMSNorm transform fusing wait(view(all_reduce)) + triton_fused_add_rms_norm into trtllm_fused_allreduce_residual_rmsnorm. Changes FuseGemms to allow_not_contigous=True. Adds _peel_ep_local_route for routing extraction through ep_local_route nodes. Updates FuseRopeIntoTrtllmMLA to skip NeoX→GPTJ re-interleave when is_gptj_layout.
Sharding: exclude filter, ep_local_route MoE insertion, MLA sharding exclusion
tensorrt_llm/_torch/auto_deploy/transform/library/sharding.py
Adds ShardingTransformConfig.exclude_shard_node_filter and _is_node_excluded(). Enforces exclusion in ShardingTransformContainer.add(). Replaces prior MoE routing-localization/masking nodes with a single ep_local_route fused op. Applies exclusion filter in _process_mla_sharding for q_a_proj and kv_a_proj nodes.
CUDA graph fallback: BypassCapturedGraphs for attention-DP mixed mode
tensorrt_llm/_torch/auto_deploy/shim/ad_executor.py
Defines _call_func_eager wrapping execution in BypassCapturedGraphs(). Updates maybe_pad_for_cuda_graph fallback branches to call the unified _fallback() selecting eager-bypass for attention-DP+TP>1 and normal path otherwise.
Model config, registry, and integration tests
examples/auto_deploy/model_registry/configs/deepseek-r1.yaml, examples/auto_deploy/model_registry/models.yaml, tensorrt_llm/_torch/auto_deploy/config/default.yaml, tests/integration/defs/accuracy/references/gsm8k.yaml, tests/integration/defs/accuracy/test_llm_api_autodeploy.py, tests/integration/test_lists/..., tests/test_common/llm_data.py
Adds nvidia/DeepSeek-R1-0528-NVFP4-v2 to models.yaml. Updates deepseek-r1.yaml with fusion toggles and apply_sharding_hints with SYMM_MEM. Registers fuse_moe_allreduce_residual_rmsnorm (disabled) in default.yaml. Adds GSM8K accuracy reference (94.24, NVFP4/FP8). Adds integration test parametrization, QA list, B200 test-db entry, and model directory mapping.

Sequence Diagram(s)

sequenceDiagram
  participant ModelForward as DeepSeekV3Attention.forward
  participant KVproj as kv_a_proj (computed first)
  participant Qproj as q_a_proj (computed after KV)
  participant AuxStream as Aux CUDA Stream
  participant MLAop as trtllm_mla_with_cache

  ModelForward->>KVproj: project hidden → compressed_kv + kpe
  Note over KVproj,AuxStream: begin_aux_stream_passthrough (Pattern 2/3)
  KVproj->>AuxStream: layernorm + reshape on aux stream
  ModelForward->>Qproj: project hidden → q_nope + q_pe
  AuxStream->>AuxStream: end_aux_stream_passthrough
  Qproj->>MLAop: wait_aux_stream_passthrough before MLA
  MLAop->>MLAop: fused MLA attention
Loading
sequenceDiagram
  participant MoEForward as DeepSeekV3MoE.forward
  participant RoutedExperts as EP-sharded routed experts
  participant AllReduce as all_reduce(layer_type=moe)
  participant SharedExpert as replicated shared expert
  participant FusedNorm as trtllm_fused_allreduce_residual_rmsnorm

  MoEForward->>RoutedExperts: compute routed expert output
  MoEForward->>AllReduce: all_reduce(routed) via SYMM_MEM
  MoEForward->>SharedExpert: compute shared expert (replicated)
  AllReduce->>FusedNorm: routed_3d after AR
  SharedExpert->>FusedNorm: shared + prev_residual
  FusedNorm->>MoEForward: (normed_output, updated_residual)
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Suggested reviewers

  • greg-kwasniewski1
  • nvchenghaoz
  • suyoggupta
  • crazydemo
  • schetlur-nv
  • chang-l
  • kaiyux
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning PR description is incomplete and lacks required sections. The author only included the GitHub template structure without meaningful content in key sections like 'Description' and 'Test Coverage'. Fill in the 'Description' section with a summary of what was changed and why (not just bullet points of optimizations). Complete the 'Test Coverage' section listing relevant tests that validate the changes. Reference the commit message details already provided in pr_objectives.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and specifically describes the main feature being added: AutoDeploy optimizations for DeepSeek-R1 model targeting low-concurrency inference scenarios.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 11

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/auto_deploy/transform/library/multi_stream_attn.py (1)

716-724: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the transform docstring to match the new fallback order.

The class docstring still says Pattern 0 falls straight through to Pattern 2, but _apply() now tries Pattern 3 before Pattern 2. In a transform this pattern-heavy, stale ordering sends the next debugger to the wrong rewrite path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/_torch/auto_deploy/transform/library/multi_stream_attn.py`
around lines 716 - 724, Update the docstring of the multi-stream attention class
to reflect the actual pattern trial order implemented in the _apply() method.
The docstring currently states that Pattern 0 falls through to Pattern 2 if
nothing is found, but the _apply() method now attempts Pattern 3 before Pattern
2. Revise the docstring to document the correct order: Pattern 0 is tried first,
Pattern 3 is tried next, then Pattern 2, with Pattern 1 as the legacy fallback.
This ensures the documented behavior matches the actual implementation and
guides future debuggers through the correct rewrite path.
🧹 Nitpick comments (1)
tensorrt_llm/_torch/auto_deploy/shim/ad_executor.py (1)

199-207: ⚡ Quick win

Extend bypass regression coverage to the other new _fallback() branches.

tests/unittest/auto_deploy/multigpu/compile/test_bypass_captured_graphs.py:74-207 covers the not can_run_cuda_graph_all path, but this change also routes cg_batch_size is None and not can_pad_all through _fallback(). Please add one scenario for each case so a future change cannot reintroduce mixed replay/eager execution on those branches.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/_torch/auto_deploy/shim/ad_executor.py` around lines 199 - 207,
Extend the bypass regression test coverage in the test file to include scenarios
for the two new _fallback() branches introduced in ad_executor.py. Currently,
only the not can_run_cuda_graph_all path is tested (lines 74-207). Add one test
scenario that exercises the cg_batch_size is None branch and another test
scenario that exercises the not can_pad_all branch, ensuring both paths properly
fall back to eager execution instead of using captured graphs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tensorrt_llm/_torch/auto_deploy/custom_ops/fused_moe/triton_routing.py`:
- Around line 257-289: The function ep_local_route_fn extracts K from
selected_experts.shape but does not validate that routing_weights has the same
shape. Add a shape validation check after the assertion and before the kernel
launch to ensure both selected_experts and routing_weights have identical
dimensions (T, K). This will prevent silent misindexing of routing_weights if
upstream code passes tensors with mismatched top_k values.

In `@tensorrt_llm/_torch/auto_deploy/custom_ops/linear/linear.py`:
- Around line 80-86: The guard condition at lines 80-86 determines whether to
invoke the DSv3 fused GEMM operation but only checks the weight dtype and shape
along with whether bias is None. The targeted operation
torch.ops.auto_deploy.dsv3_fused_a_gemm requires bf16-precision inputs, but the
current guard does not validate input.dtype. Add a check for input.dtype ==
torch.bfloat16 to the conditional expression to prevent non-bf16 activations
from being routed to this path, which would cause a runtime failure.

In `@tensorrt_llm/_torch/auto_deploy/custom_ops/linear/swiglu.py`:
- Around line 43-46: The exception handling in the try-except block that loads
the trtllm.silu_and_mul operation is too broad, catching all Exception types
instead of just the AttributeError that occurs when the operation is not
available. Replace the broad Exception catch with AttributeError specifically to
ensure only attribute lookup failures trigger the fallback to flashinfer,
preventing masked issues from other unexpected exceptions.

In `@tensorrt_llm/_torch/auto_deploy/custom_ops/normalization/triton_rms_norm.py`:
- Around line 121-145: The row_stride is extracted only from hidden_states but
reused for all inputs and outputs in the add_rms_norm_kernel call. This causes
incorrect memory access if residual has a different row stride (stride(-2)) than
hidden_states. After checking and making hidden_states and residual contiguous
based on stride(-1), you must also verify that residual has the same row_stride
as hidden_states (check residual.stride(-2) against hidden_states.stride(-2)).
If the row strides don't match, make residual fully contiguous to align its
stride with hidden_states before extracting row_stride and calling the kernel.

In `@tensorrt_llm/_torch/auto_deploy/models/custom/modeling_deepseek.py`:
- Around line 799-804: The code currently skips the _rope_deinterleave_load_hook
assuming that fuse_rope_into_trtllm_mla will always rewrite the graph, but
DeepSeekV3Attention.forward still calls torch_rope_with_explicit_cos_sin before
torch_mla. If the fusion is disabled or doesn't match the expected pattern, the
eager path will incorrectly apply RoPE rotation to native GPTJ-layout weights.
Either restore a de-interleaved fallback path in the model's load hook to handle
unfused execution safely, or add a runtime check that explicitly validates the
fused MLA rewrite was applied before forward pass execution to fail fast if
fusion is missing or disabled.

In
`@tensorrt_llm/_torch/auto_deploy/transform/library/fuse_moe_allreduce_residual_rmsnorm.py`:
- Around line 74-75: The `_trace_ar_path()` function extracts the all-reduce
strategy from the original node into the `_ar_strategy` variable, but when
emitting the fused operation, the code uses the global
`shared_config.dist_config.allreduce_strategy` instead. Replace the
`shared_config.dist_config.allreduce_strategy` reference on line 74 (and any
other location where the fused operation is created) with the extracted
`_ar_strategy` variable to preserve the original node's strategy in the fused
rewrite.
- Around line 42-56: The _trace_ar_path function extracts the structure of the
wait_aux_stream_passthrough node but does not preserve its kwargs, causing them
to be dropped during node rewriting and breaking stream ordering for graphs
using per-id events. Modify _trace_ar_path to extract the kwargs dictionary from
the node parameter (the wait_aux_stream_passthrough call_function node) and
include it in the return tuple alongside routed, view shape, and strategy. Then,
at the call site where the new wait node is created (referenced at line 111),
apply these extracted kwargs when constructing the new
wait_aux_stream_passthrough call to preserve the original event configuration.

In `@tensorrt_llm/_torch/auto_deploy/transform/library/fuse_rope_mla.py`:
- Around line 446-450: The exception handling in the GPTJ-layout detection block
starting at line 446 uses a broad except Exception clause that should be
narrowed to specific exception types. Examine the identical
factory._get_model_config() call at line 318 elsewhere in the file to see what
specific exceptions are already being caught there. Replace the broad except
Exception clause in the try-except block around _model_config assignment with
the same specific exception types used at line 318, maintaining the same logic
where already_gptj is set to False on exception.

In `@tensorrt_llm/_torch/auto_deploy/transform/library/multi_stream_attn.py`:
- Around line 415-439: The calls to begin_aux_stream_passthrough,
end_aux_stream_passthrough, and wait_aux_stream_passthrough are using the
default event_id=-1, which causes all MLA forks to share main/aux events instead
of getting unique per-fork event IDs from the new events_per_id pool. This
defeats the purpose of the new pooling mechanism and can cause duplicate-event
collapse across layers. Thread a stable per-fork event_id through all three
function calls in both affected locations (the primary rewrite at lines 415-439
involving kv_linear, last_kv_op, and mla_op, and the fused-path rewrite at lines
673-699). Use the same pattern for generating a unique, stable event ID per
match/fork that is already established elsewhere in the codebase to ensure the
events_per_id pool activates and maintains KV/Q overlap across layers.

In `@tensorrt_llm/_torch/auto_deploy/transform/library/sharding.py`:
- Around line 274-285: The exclude_shard_node_filter configuration is documented
to match against weight/module names (like q_a_proj and kv_a_proj_with_mqa), but
the filtering logic around line 1429 checks against transform.target_node, which
contains FX-traced node names (torch_linear_*, torch_moe_*), causing the filter
to be silently ignored. Update the filtering logic to check against the actual
weight/module names instead of the FX node names. This may require accessing the
underlying module or weight name from the transform object rather than relying
on target_node for the comparison operation.
- Around line 2811-2832: The early return statement checking if
`num_simple_shards < len(a_proj_to_shard)` at lines 2828-2831 is preventing the
function from continuing to process q_b/kv_b/o_proj nodes when some a_proj nodes
were already sharded in prior passes. Remove this entire early abort condition
(the if block that returns 0) since the subsequent transform_container.add()
calls will safely handle duplicate nodes through no-op behavior, allowing the
full MLA processing pipeline to continue.

---

Outside diff comments:
In `@tensorrt_llm/_torch/auto_deploy/transform/library/multi_stream_attn.py`:
- Around line 716-724: Update the docstring of the multi-stream attention class
to reflect the actual pattern trial order implemented in the _apply() method.
The docstring currently states that Pattern 0 falls through to Pattern 2 if
nothing is found, but the _apply() method now attempts Pattern 3 before Pattern
2. Revise the docstring to document the correct order: Pattern 0 is tried first,
Pattern 3 is tried next, then Pattern 2, with Pattern 1 as the legacy fallback.
This ensures the documented behavior matches the actual implementation and
guides future debuggers through the correct rewrite path.

---

Nitpick comments:
In `@tensorrt_llm/_torch/auto_deploy/shim/ad_executor.py`:
- Around line 199-207: Extend the bypass regression test coverage in the test
file to include scenarios for the two new _fallback() branches introduced in
ad_executor.py. Currently, only the not can_run_cuda_graph_all path is tested
(lines 74-207). Add one test scenario that exercises the cg_batch_size is None
branch and another test scenario that exercises the not can_pad_all branch,
ensuring both paths properly fall back to eager execution instead of using
captured graphs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 22572f7e-b2bb-46ae-be1e-6c66295a15fd

📥 Commits

Reviewing files that changed from the base of the PR and between 4f46653 and a31e9d1.

📒 Files selected for processing (28)
  • examples/auto_deploy/model_registry/configs/deepseek-r1.yaml
  • examples/auto_deploy/model_registry/models.yaml
  • tensorrt_llm/_torch/auto_deploy/config/default.yaml
  • tensorrt_llm/_torch/auto_deploy/custom_ops/fused_moe/triton_routing.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/linear/__init__.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/linear/dsv3_fused_a_gemm.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/linear/dsv3_router_gemm.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/linear/linear.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/linear/swiglu.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/mla/trtllm_mla.py
  • tensorrt_llm/_torch/auto_deploy/custom_ops/normalization/triton_rms_norm.py
  • tensorrt_llm/_torch/auto_deploy/models/custom/mla_rope_utils.py
  • tensorrt_llm/_torch/auto_deploy/models/custom/modeling_deepseek.py
  • tensorrt_llm/_torch/auto_deploy/shim/ad_executor.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/fuse_moe_allreduce_residual_rmsnorm.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/fuse_rope_mla.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/fused_add_rms_norm.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/fused_moe.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/fusion.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/multi_stream_attn.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/multi_stream_moe.py
  • tensorrt_llm/_torch/auto_deploy/transform/library/sharding.py
  • tensorrt_llm/_torch/auto_deploy/utils/multi_stream_utils.py
  • tests/integration/defs/accuracy/references/gsm8k.yaml
  • tests/integration/defs/accuracy/test_llm_api_autodeploy.py
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/test_common/llm_data.py

Comment thread tensorrt_llm/_torch/auto_deploy/custom_ops/fused_moe/triton_routing.py Outdated
Comment thread tensorrt_llm/_torch/auto_deploy/custom_ops/linear/linear.py Outdated
Comment thread tensorrt_llm/_torch/auto_deploy/custom_ops/linear/swiglu.py
Comment thread tensorrt_llm/_torch/auto_deploy/custom_ops/normalization/triton_rms_norm.py Outdated
Comment thread tensorrt_llm/_torch/auto_deploy/models/custom/modeling_deepseek.py
Comment thread tensorrt_llm/_torch/auto_deploy/transform/library/fuse_rope_mla.py
Comment thread tensorrt_llm/_torch/auto_deploy/transform/library/sharding.py
Comment thread tensorrt_llm/_torch/auto_deploy/transform/library/sharding.py Outdated
@taylor-yb-lee taylor-yb-lee added the AutoDeploy <NV> AutoDeploy Backend label Jun 14, 2026
@taylor-yb-lee taylor-yb-lee changed the title [#14588][feat] AutoDeploy: DeepSeek-R1 optimization for low concurrency [#14588][feat] AutoDeploy: DeepSeek-R1 optimization for low concurrency Jun 14, 2026
@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast --stage-list "DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #54103 [ run ] triggered by Bot. Commit: e0cf551 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #54103 [ run ] completed with state SUCCESS. Commit: e0cf551
/LLM/main/L0_MergeRequest_PR pipeline #43187 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #54150 [ run ] triggered by Bot. Commit: e0cf551 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #54150 [ run ] completed with state FAILURE. Commit: e0cf551
/LLM/main/L0_MergeRequest_PR pipeline #43233 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55000 [ run ] triggered by Bot. Commit: 6a487f3 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #55000 [ run ] completed with state SUCCESS. Commit: 6a487f3
/LLM/main/L0_MergeRequest_PR pipeline #43992 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@nvchenghaoz

Copy link
Copy Markdown
Collaborator

Could you add the perf number in the comment or PR description?

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

Could you add the perf number in the comment or PR description?

Added in the description. Thanks!

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57039 [ run ] triggered by Bot. Commit: d44613d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57039 [ run ] completed with state FAILURE. Commit: d44613d
/LLM/main/L0_MergeRequest_PR pipeline #45834 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

… OOM)

gemma3n_e2b_it.yaml was the only registry config relying on the AutoDeploy
default free_gpu_memory_fraction=0.9. Gemma-3n uses VSWA + AltUp (4 parallel
hidden streams): under the VSWA scheme the KV manager sizes the pool purely
from free_gpu_memory_fraction and ignores max_num_tokens, so 0.9 grabs ~55 GiB
of KV on an 80 GiB GPU. The AltUp prefill activation peak then has too little
headroom and OOMs mid-run during long-output generation (GSM8K); the executor
recovery path turns that OOM into a hang, so the accuracy test is reported as
Timeout.

Cap free_gpu_memory_fraction at 0.8 (matching the gemma4_e2b sibling). KV cache
55.37 -> 49.21 GiB; test_gemma3n_e2b_it now passes end-to-end locally on an
H100 80GB (MMLU 59.36 >= 57.71, GSM8K 72.25 >= 68.97).

Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

1 similar comment
@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57219 [ run ] triggered by Bot. Commit: 046ae4e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57219 [ run ] completed with state FAILURE. Commit: 046ae4e
/LLM/main/L0_MergeRequest_PR pipeline #45990 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57234 [ run ] triggered by Bot. Commit: 046ae4e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57234 [ run ] completed with state SUCCESS. Commit: 046ae4e
/LLM/main/L0_MergeRequest_PR pipeline #46001 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57243 [ run ] triggered by Bot. Commit: 364ac74 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57243 [ run ] completed with state FAILURE. Commit: 364ac74
/LLM/main/L0_MergeRequest_PR pipeline #46010 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57329 [ run ] triggered by Bot. Commit: 364ac74 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57329 [ run ] completed with state FAILURE. Commit: 364ac74
/LLM/main/L0_MergeRequest_PR pipeline #46089 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57362 [ run ] triggered by Bot. Commit: 364ac74 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57362 [ run ] completed with state SUCCESS. Commit: 364ac74
/LLM/main/L0_MergeRequest_PR pipeline #46116 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57513 [ run ] triggered by Bot. Commit: 364ac74 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57513 [ run ] completed with state SUCCESS. Commit: 364ac74
/LLM/main/L0_MergeRequest_PR pipeline #46244 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57630 [ run ] triggered by Bot. Commit: 364ac74 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57630 [ run ] completed with state SUCCESS. Commit: 364ac74
/LLM/main/L0_MergeRequest_PR pipeline #46354 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

CI Report

Link to invocation

@taylor-yb-lee taylor-yb-lee merged commit 45fae3e into NVIDIA:main Jul 6, 2026
7 checks passed
BrianLi23 pushed a commit to BrianLi23/TensorRT-LLM that referenced this pull request Jul 9, 2026
…currency (NVIDIA#14810)

Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AutoDeploy <NV> AutoDeploy Backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: [AutoDeploy] Perf analysis & optimize DeekSeek R1 (lower concurrency)

5 participants