Skip to content

[None][perf] Qwen3.5 GB300: upstream the AgentX side-branch optimizations - #20815

Merged
dc3671 merged 116 commits into
NVIDIA:mainfrom
dc3671:user/zhenhuanc/q35-upstream
Nov 1, 2026
Merged

dc3671 merged 116 commits into
NVIDIA:mainfrom
dc3671:user/zhenhuanc/q35-upstream

Conversation

@dc3671

@dc3671 dc3671 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

The change set adds SM103-focused attention, GEMM, MoE, all-reduce, and speculative-decoding paths. It also changes GDN state handling, executor scheduling and CUDA-graph preparation, disaggregated transfer admission, prefix-tokenization caching, frontend affinity, and public configuration.

Review risks include kernel synchronization and graph-capture behavior, recurrent and KV-cache state updates, lossy FP8 payload behavior, pre-routed MoE table and tile consistency, and compatibility across changed APIs. Eligibility checks and fallback paths do not establish correctness for every configuration.

New opt-in settings cover FP8 all-reduce payloads, embedding replication, draft precision, frontend affinity, and context scheduling. Verify default behavior, model eligibility, schema/runtime consistency, and interactions with existing configuration. Prefix-cache and executor scheduling changes can affect behavior beyond Qwen3.5.

The supplied CI comment reports a failed pipeline for commit f773e7d. The PR description says review-driven validation is in progress and reports measurements from a pre-review state. Final-state test results and review severity counts are unavailable.

QA Engineer Review

The supplied change summary reports changes to test code and four CI test lists: l0_b200.yml, l0_cpu.yml, l0_gb300.yml, and l0_gb300_multi_gpus.yml. Reported coverage includes attention, collectives, low-M GEMM and MoE, GDN state and verification, speculative decoding, scheduling, graph replay, disaggregation, tokenization caching, and frontend affinity. No manual-QA list changes are reported. The CI failure is reported for a commit, but final-state test results are unavailable. Coverage verdict: needs follow-up.

Shell responses supplied no diff inventory or test-list contents. File-level notes below use the supplied change summaries; list membership and test-name details were not independently confirmed.

Per-File QA Perspective

Source files

  • cpp/tensorrt_llm/kernels/causalConv1d/causalConv1d.cu — Verify variable-length tail handling when vector loads are disabled.
  • cpp/tensorrt_llm/kernels/communicationKernels/mnnvlAllreduceKernels.cu and .h — Verify FP8 payload scaling, buffer sizing, rank accumulation, and default-off behavior.
  • cpp/tensorrt_llm/nanobind/batch_manager/bindings.cpp, cpp/tensorrt_llm/nanobind/common/tokenIds.h, and cpp/tensorrt_llm/nanobind/executor/request.cpp — Verify token conversion and ownership for ndarray and sequence inputs, including source-array mutation behavior.
  • cpp/tensorrt_llm/thop/allreduceOp.cpp — Verify symmetric all-reduce fallback and FP8 payload propagation.
  • cpp/tensorrt_llm/thop/cublasScaledMM.cpp and cpp/tensorrt_llm/thop/cublasScaledMMLut.h — Verify exact-shape SM103 selection and fallback.
  • cpp/tensorrt_llm/thop/moe/trtllmGen/fp4BlockScaleMoe.cpp — Verify pre-routed input validation, tile matching, and unfinalized outputs.
  • docs/source/features/prefix-tokenization-cache.md and tensorrt_llm/inputs/prefix_token_cache.py — Verify seam-based cache reuse when re-tokenization changes a cached prompt tail.
  • tensorrt_llm/_torch/attention/ATTENTION_DEVELOPER_GUIDE.md, attention.py, qk_norm_attention.py, and backends/ — Verify deferred-prologue dispatch, GQA decode eligibility, KV append, gate handling, cache keys, backend precedence, and fallbacks.
  • tensorrt_llm/_torch/attention/backends/fmha/flashinfer_trtllm_gen.py — Verify generation preprocessing and decode argument handling.
  • tensorrt_llm/_torch/attention/backends/fmha/gqa_decode.py, gqa_kv_replica.py, gqa_kv_replica_fused.py, gqa_segmented_decode.py, and gqa_split_kv_decode.py — Verify shape dispatch, rank exchange, workspace and graph-capture rules, output gates, and fallback behavior.
  • tensorrt_llm/_torch/attention/backends/interface.py, trtllm.py, and utils.py — Verify new forward metadata and steady-decode preparation with existing backends.
  • tensorrt_llm/_torch/attention/kernels/blackwell/gqa_split_kv_decode_attn.py — Verify split-KV synchronization, deferred reads, KV append, and output. fused_qk_norm_rope_gate.py — Verify FP8 cache writes and PDL ordering.
  • tensorrt_llm/_torch/custom_ops/cpp_custom_ops.py — Verify the fake all-reduce schema matches the native operator. trtllm_gen_custom_ops.py — Verify pre-routed arguments and fake outputs match native MoE behavior.
  • tensorrt_llm/_torch/cute_dsl_utils.py — Verify graph-safe tensor and pointer helpers preserve required lifetime and alignment.
  • tensorrt_llm/_torch/disaggregation/kv_cache_transceiver.py, transceiver.py, and orchestration/admission.py and orchestration/coordinator.py — Verify deferred-receive reporting, idle-poll synchronization, explicit transfer budgets, admission ordering, and receive publication.
  • tensorrt_llm/_torch/distributed/ll_exchange.py — Verify peer-memory fallback, key ordering, synchronization, and graph capture.
  • tensorrt_llm/_torch/distributed/mnnvl_fused_allreduce.py, mnnvl_memory.py, and ops.py — Verify eligibility, workspace sizing, rank mapping, fused dispatch, and unsupported-option behavior.
  • tensorrt_llm/_torch/kernels/blackwell/gemm_allreduce_norm.py, low_m_mma_gemm.py, mnnvl_allreduce_norm.py, and mnnvl_slot_allreduce_norm.py — Verify shape limits, workspace updates, rank reductions, PDL ordering, and quantized outputs.
  • tensorrt_llm/_torch/kernels/blackwell/moe_decode_front.py and moe_route_front.py — Verify routing tables, top-k selection, quantization, and launch limits. mxfp8_argmax_gemv.py — Verify key ordering, tie-breaking, and PDL behavior.
  • tensorrt_llm/_torch/kernels/spec_step_copies/op.py — Verify SM103 selects the intended CuTe kernels.
  • tensorrt_llm/_torch/model_config.py, models/modeling_qwen3.py, modeling_qwen3_5.py, modeling_qwen3_next.py, modeling_speculative.py, and modeling_utils.py — Verify configuration defaults, model eligibility, multimodal positions, fused paths, and speculative fast-path capability.
  • tensorrt_llm/_torch/modules/draft_experts_nvfp4.py — Verify load-time conversion and scales. embedding.py — Verify gather bounds and fallback behavior.
  • tensorrt_llm/_torch/modules/fla/cache_manager.py, cached_replay.py, gdn_verify_fused.py, and op.py — Verify replay commits, shape selection, recurrent-state updates, and dependency waits.
  • tensorrt_llm/_torch/modules/linear.py, low_m_gemm.py, and low_m_mma_gemm.py — Verify dispatcher eligibility, tactic selection, and fused all-reduce fallback.
  • tensorrt_llm/_torch/modules/mamba/causal_conv1d_triton.py, gdn_mixer.py, layernorm_gated.py, and mamba2_metadata.py — Verify input hoisting, fused verification, stream ordering, PDL, and in-forward split planning.
  • tensorrt_llm/_torch/modules/multi_stream_utils.py — Verify deferred-join event handling and output stream ownership. mxfp8_draft_head.py and q35_mtp_glue.py — Verify draft-head selection, sharded sampling, and fused MTP inputs.
  • tensorrt_llm/_torch/moe/fused_moe/configurable_moe.py, impl_contract.py, interface.py, moe_op_backend.py, and moe_scheduler.py — Verify pre-routed routing restrictions and API forwarding.
  • tensorrt_llm/_torch/moe/fused_moe/trtllm_gen/decode_front.py, fp4_block_scale.py, and trtllm_nvfp4.py — Verify decode-front eligibility, tactic lookup, and pre-routed support.
  • tensorrt_llm/_torch/pyexecutor/_util.py, breakable_cuda_graph_runner.py, cuda_graph_runner.py, py_executor.py, py_executor_creator.py, and profiling.py — Verify transfer-budget propagation, stream ordering, graph bucket handling, staged-input replay, and cached utilization reporting.
  • tensorrt_llm/_torch/pyexecutor/engine/runners/decoder/config.py, dummy_requests.py, graphs.py, inputs.py, metadata.py, runner.py, and interface.py — Verify steady MTP matching, graph capture variants, staged-input replay, and padding behavior.
  • tensorrt_llm/_torch/pyexecutor/kv_cache/kv_cache_manager_v2.py, resource_manager.py, and mamba_cache_manager/ — Verify block-table keys, replay policy, snapshot allocation, state commits, and manager selection.
  • tensorrt_llm/_torch/pyexecutor/llm_request.py and model_engine.py — Verify token-ID conversion and speculative fast-path detection.
  • tensorrt_llm/_torch/pyexecutor/scheduler/scheduler.py and scheduler_v2.py — Verify scheduling policy, starvation handling, transfer admission, and snapshot-aware chunking.
  • tensorrt_llm/_torch/pyexecutor/steady_spec_prepare.py — Verify steady-input staging, batch matching, ring-slot lifetime, and attention preparation.
  • tensorrt_llm/_torch/speculative/eagle3.py, eagle3_dynamic_tree.py, fused_accept.py, interface.py, mtp.py, and utils.py — Verify sharded sampling, acceptance counts, step-zero updates, and metadata defaults.
  • tensorrt_llm/_torch/utils.py — Verify the new auxiliary stream and event type are handled by stream setup.
  • tensorrt_llm/commands/serve.py, llmapi/disagg_utils.py, serve/_frontend_processes.py, serve/openai_client.py, serve/openai_disagg_server.py, serve/openai_server.py, serve/router.py, and serve/router_utils.py — Verify socket ownership, affinity routing, cache-enabled tokenization, and stats collection.
  • tensorrt_llm/functional.py — Verify new all-reduce and MoE parameter defaults and propagation.
  • tensorrt_llm/inputs/registry.py — Verify the one-time warning when a processor does not support tokenization caching.

Configuration and test-list files

  • tensorrt_llm/llmapi/llm_args.py, tensorrt_llm/schemas/trtllm-serve-config.schema.json, and tensorrt_llm/schemas/trtllm-serve-disagg-config.schema.json — Verify option names, defaults, validation, and runtime parsing agree.
  • tensorrt_llm/usage/llm_args_golden_manifest.json and tests/unittest/api_stability/references/llm.yaml — Verify public argument documentation matches implementation.
  • tests/integration/test_lists/test-db/l0_b200.yml — The supplied summary reports embedding, NVFP4 draft-expert, fused-acceptance, steady-preparation, and MXFP8 draft-head entries.
  • tests/integration/test_lists/test-db/l0_cpu.yml — The supplied summary reports frontend-affinity coverage.
  • tests/integration/test_lists/test-db/l0_gb300.yml — The supplied summary reports SM103 GEMM, GDN, MoE, embedding, GQA attention, draft-head, MTP, and steady-preparation entries.
  • tests/integration/test_lists/test-db/l0_gb300_multi_gpus.yml — The supplied summary reports MNNVL fused all-reduce and low-latency exchange entries.

Test-code files

  • tests/unittest/_torch/attention/test_fmha_manager.py — Tests deferred-prologue dispatch and cache separation.
  • tests/unittest/_torch/attention/test_gqa_decode_fmha.py — Tests GQA backend selection and numerical results; the supplied summary reports it in l0_gb300.yml.
  • tests/unittest/_torch/attention/test_mixed_precision_backends.py and test_trtllm_paged_context_fmha_gate.py — Update attention test doubles for new metadata.
  • tests/unittest/_torch/attention/multi_gpu/test_gqa_kv_replica.py — Tests segmented and fused KV-replica decode; no test-list entry is reported.
  • tests/unittest/_torch/disaggregation/fake_kv_cache_transceiver.py, test_disagg_coordinator_admission.py, test_disagg_coordinator_receive.py, test_disagg_loop_transcript.py, and test_kv_cache_transceiver_contract.py — Cover deferred-receive reporting, admission, and updated fixtures.
  • tests/unittest/_torch/executor/kv_cache/test_kv_cache_v2_capacity_only.py and test_kv_cache_v2_scheduler.py — Cover transferred draft lengths, context scheduling, starvation, snapshots, and transfer admission.
  • tests/unittest/_torch/executor/test_breakable_cuda_graph.py — Covers graph capture, padding, output aliasing, and replay.
  • tests/unittest/_torch/executor/test_iter_stats_populate.py — Updates token-count fixtures.
  • tests/unittest/_torch/executor/test_model_loader_llm_args.py — Tests rejection of unsupported model options.
  • tests/unittest/_torch/executor/test_multimodal_scheduler.py — Updates snapshot fixtures.
  • tests/unittest/_torch/executor/test_py_executor.py — Tests stream ordering and first streamed responses.
  • tests/unittest/_torch/executor/test_steady_spec_prepare.py — Tests staging, cache keys, and replay; the supplied summary reports it in l0_b200.yml and l0_gb300.yml.
  • tests/unittest/_torch/executor/test_pytorch_model_engine.py and test_request_utils.py — Cover staged-input forwarding and token ownership.
  • tests/unittest/_torch/kernels/parallel/test_scaled_mm.py — Tests SM103 FP8 algorithm output.
  • tests/unittest/_torch/models/test_qwen3_next_eager_fusion.py and test_qwen3next_moe_allreduce_guard.py — Cover model all-reduce and fusion behavior.
  • tests/unittest/_torch/modules/mamba/test_gdn_inforward_snapshot.py — Tests staged GDN state. test_gdn_kernel_optimizations.py — Tests convolution hoisting, PDL, and fused verification; the supplied summary reports it in l0_gb300.yml.
  • tests/unittest/_torch/modules/mamba/test_mamba2_metadata.py — Updates replay-partition fixture behavior.
  • tests/unittest/_torch/modules/test_embedding_lookup.py — Tests gather and sharded embeddings; the supplied summary reports it in l0_b200.yml and l0_gb300.yml.
  • tests/unittest/_torch/modules/test_low_m_mma_gemm.py — Tests SM103 GEMM paths; the supplied summary reports it in l0_gb300.yml.
  • tests/unittest/_torch/modules/test_mxfp8_draft_head.py — Tests draft-head output, tie-breaking, replay, and PDL; the supplied summary reports it in l0_b200.yml and l0_gb300.yml.
  • tests/unittest/_torch/modules/test_q35_mtp_glue.py — Tests fused MTP inputs; the supplied summary reports it in l0_gb300.yml.
  • tests/unittest/_torch/moe/test_draft_experts_nvfp4.py — Tests conversion and NVFP4 output; the supplied summary reports it in l0_b200.yml.
  • tests/unittest/_torch/moe/test_moe_decode_front.py — Tests route-front and pre-routed MoE; the supplied summary reports it in l0_gb300.yml.
  • tests/unittest/_torch/multi_gpu/test_allreduce.py — Tests NCCL symmetric all-reduce on unregistered inputs.
  • tests/unittest/_torch/multi_gpu/test_ll_exchange.py — Tests key and group exchanges; the supplied summary reports it in l0_gb300_multi_gpus.yml.
  • tests/unittest/_torch/multi_gpu/test_mnnvl_allreduce.py — Tests the FP8 payload path.
  • tests/unittest/_torch/multi_gpu/test_mnnvl_fused_allreduce_norm.py — Tests fused MNNVL all-reduce; the supplied summary reports it in l0_gb300_multi_gpus.yml.
  • tests/unittest/_torch/speculative/hw_agnostic/test_ragged_spec_sampler.py — Updates sampler fixtures.
  • tests/unittest/_torch/speculative/hw_agnostic/test_sampling_scan_cache.py and test_spec_worker_target_logits.py — Test sampling-cache invalidation and sharded-logit eligibility.
  • tests/unittest/_torch/speculative/test_fused_accept.py — Tests acceptance and step-zero updates; the supplied summary reports it in l0_b200.yml.
  • tests/unittest/_torch/speculative/test_capture_sampling_params.py, test_eagle3.py, and test_group_all_greedy_sync.py — Update speculative fixtures or metadata tests.
  • tests/unittest/disaggregated/test_coordinator_worker.py and tests/unittest/inputs/test_prefix_token_cache.py — Test prefix-tokenization-cache reuse.
  • tests/unittest/disaggregated/test_disagg_openai_client.py and test_disagg_utils.py — Test frontend-affinity selection and configuration extraction.
  • tests/unittest/disaggregated/test_openai_disagg_server.py, test_sync_transfer_timing.py, test_transfer_lifecycle_acceptance.py, test_transfer_ownership_regressions.py, and test_unsubmitted_session.py — Update disaggregation fixtures for polling and configuration state.
  • tests/unittest/disaggregated/test_transceiver_bounded_polling.py — Tests rank-synchronized polling and receive lifecycle.
  • tests/unittest/llmapi/test_serve_frontend_affinity.py — Tests socket binding, handoff, and cleanup; the supplied summary reports it in l0_cpu.yml.
  • The four tests/integration/test_lists/test-db/*.yml files listed above — Their CI-list changes are summarized above; exact entries were not available in the shell output.

Description

Brings the Qwen3.5-397B NVFP4 GB300 disaggregated-serving optimizations that the InferenceX AgentX submission ran from the side branch feat/1.3.0rc24-iter-perf-stats-interval onto main, together with the generic executor / scheduler / disaggregation / serving pieces they rely on.

No environment switches. The side branch carried ~240 TRTLLM_* switches and a TRTLLM_Q35_PROFILE=gen|ctx role table. Here every path is either on by default where its capability holds (decided once at construction by the module that owns it), derived from existing config (max_batch_size, max_num_tokens, CUDA-graph batch sizes, prefill CUDA-graph backend, SM count), or an explicit config field when it is lossy or deployment-dependent. New env names in non-test code: one (TLLM_FRONTEND_AFFINITY_FD, launcher→child fd hand-off, same idiom as TLLM_FRONTEND_READY_FD).

New config fields (all default off / auto):

Field Why it is a field
scheduler_config.context_scheduling_policy (fcfs | shortest_uncached_first), context_starvation_iterations deployment policy for context workers
serve_frontend_affinity_port_stride, disagg context_servers.num_serve_frontends multi-frontend deployment layout
replicate_embedding memory (~1.8 GB/GPU) for latency; model must declare support
mnnvl_allreduce_fp8_payload lossy (E4M3 all-reduce payload)
MTPDecodingConfig.draft_lm_head_dtype (auto | mxfp8), draft_moe_dtype (auto | nvfp4) lossy on the draft model only (affects acceptance, not target outputs)

Existing fields reused: enable_tokenization_cache (incremental chat tokenization now extends PrefixTokenCache), prefill_cuda_graph_backend, disable_overlap_scheduler, cache_transceiver_config.max_tokens_in_buffer (an explicit value keeps the GEN transfer window).

Where the specialisations plug in

  • Decode attention: FMHA libraries (gqa_decode and variants) registered in FmhaManager, each declaring its conditions in is_supported; the fused prologue is a declared capability in the selection key.
  • All-reduce + RMSNorm / GEMM + all-reduce: kernel choices inside MNNVLAllReduce, reached through AllReduceParams fusion ops; workspaces sized at construction.
  • Low-M GEMM: warp-MMA BF16 / FP8 runners in low_m_gemm's AutoTuner race, no hand-pinned tactics. Qwen3.5's GDN in_proj passes fuse_conv1d_into_in_proj, so its race only considers tactics the conv1d epilogue can fuse with.
  • FP4 MoE tuning: rank-0 tactic broadcast and decode-sized buckets only where the model declares moe_decode_tuning (Qwen3.5 on SM 10.0 / 10.3); other models keep main's tuning.
  • MoE decode front: explicit prerouted routing argument to the TRTLLM-gen backend.
  • GDN fused verify: capability decided in post_load_weights; AOT CUDA kernel trtllm::gdn_verify.
  • CuTe fused all-reduce + RMSNorm: only where the model declares allreduce_mnnvl_fused_norm (Qwen3.5).

GDN prefill core graphs: captured at warmup by the breakable prefill graph runner, keyed by bounded prefill buckets (≤ max_num_tokens // 4, 1–2 context requests, snapshot split), eager outside them. Cost at TEP4 CTX: 3060 graphs, up to ~574 MiB/GPU outside KV sizing, +9–17 s warmup.

Removed from the side branch on purpose: lazy per-shape graph capture while serving, the context MTP draft-step graphs (≤0.2% TTFT), the NVRTC-compiled GDN verify kernel (replaced by the AOT kernel), and all hand-pinned tactic tables.

Kept for performance against a review rule (one commit each; the commit body names the rule):

  • context attention plan shared by one forward's layers (second copy of the context dispatch);
  • segmented / merge-free GQA decode calls FlashInfer's trtllm_paged_attention_decode directly;
  • GDN verify / conv1d and KV-replica prep read earlier-step state before the PDL wait; split-KV decode uses plain PDL launches;
  • draft-loop kv_lens increment folded into the next MTP input launch (state across the loop);
  • Qwen3.5-only steady Mamba state-index skip; in-forward snapshot staging outside the GPU cache quota;
  • Qwen3.5 opts its all-reduces out of NCCL_SYMMETRIC via model_config.extra_attrs.
  • Qwen3.5 decode kernels are enabled by the model (has_decode_kernels) on SM 10.0 and 10.3 (B200/GB200, B300/GB300); the one-model speculative store uses main's CuTe DSL SlotScatter / StepInputGather on both.

Behaviour changes outside Qwen3.5

  • NCCL_SYMMETRIC all-reduce no longer pairs a window output with a non-window input (wrong sums for small inputs at TP4).
  • One-model MTP-Eagle: fused acceptance / draft bookkeeping, vocab-sharded greedy and temperature-only target sampling, step-input caches — gated on a capability the model declares.
  • Disagg GEN: idle receive-status polls skipped while every rank is idle (rank-uniform); first GEN step is streamed; admission gate runs wherever the transfer window applies.
  • GDN models: lossless conv1d / replay kernel options; end-of-prompt Mamba snapshot taken inside the forward when the cache supports it.

Overlap with open PRs: shortest-first context scheduling (#20516, #20736).

Test Coverage

Unit tests for the changed modules run on GB300 (jhb); CI via /bot run.

End-to-end (GB300, InferenceX AgentX trace, same harness and configs as the submission's Pareto points):

Image of 1462fb8 (tables removed, gates and fuse_conv1d_into_in_proj in) vs the submission build (B5) or a same-day rerun of it (b5ref), one run per point; tok/$ = total tokens per $1 TCO, intvty = 1000 / ITL p90 (ms):

Point Ref Δ tok/$ Δ intvty Δ TTFT p90
1 CTX TEP4 + 1 GEN TEP8 b4, c28 b5ref -0.0% +1.5% -2.9%
2 CTX TEP2 + 1 GEN TEP8 b64, c256 B5 +0.9% -0.2% -3.3%
3 CTX TEP2 + 1 GEN TEP8 b128, c392 b5ref +1.2% -7.5% +5.0%
1 CTX TEP4 + 1 GEN TEP16 b1, c8 b5ref -1.2% -2.0% -4.2%
1 CTX TEP4 + 1 GEN TEP16 b2, c16 b5ref -0.0% -1.3% +3.2%
1 CTX TEP4 + 2 GEN TEP8 b16, c128 B5 -0.2% -0.0% +3.0%
3 CTX DEP4 + 2 GEN DEP4 b36, c720 B5 +0.1% +0.5% +3.9%

The c392 point runs at a heavier GEN load (its faster context side admits ~1% more requests); across runs our c392 interactivity is 260–268 against 268–281 for b5ref.

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.

🤖 Generated with Claude Code

@dc3671
dc3671 force-pushed the user/zhenhuanc/q35-upstream branch 5 times, most recently from 3ec3d07 to 4cbab7a Compare October 23, 2026 08:51
dc3671 pushed a commit to dc3671/TensorRT-LLM that referenced this pull request Oct 26, 2026
…IA#20815

Ports tekit user/xiaomingc/qwen35-r3-merged f76e4dd5d5 onto the PR head 3ec3d07 in the PR's layout and
style: attention/backends, kernels/blackwell and moe/fused_moe paths, no debug or test hooks, and every new
TRTLLM_Q35_* switch read in a @q35_env.register reader or at call time, so TRTLLM_Q35_PROFILE can set it.

- CP-lite attention: the balanced split's wide plan (33..64 requests) and the two-slot plan with kernel_two
  (65..128), the quad plan for tests, and multi-CTA counter slots sized by the CP-lite batch cap. MAX_BATCH
  stays the PR's 32 here.
- MoE front: route-only launch with clusters of 16 for 257..512 and 513..1024 tokens
  (TRTLLM_Q35_MOE_FRONT_BIG_C16, TRTLLM_Q35_MOE_FRONT_BIG_C16W).
- Communication: CuTe two-shot all-reduce with several tokens per CTA (TRTLLM_Q35_FUSED_AR_TPC) and with an
  E4M3 payload (TRTLLM_Q35_FUSED_AR_FP8); plain all-reduces on the CuTe two-shot
  (TRTLLM_Q35_FUSED_AR_PLAIN_TWOSHOT); MNNVL two-shot all-reduce with an E4M3 payload and a token cap
  (TRTLLM_MNNVL_TWOSHOT_FP8, TRTLLM_MNNVL_TWOSHOT_FP8_MAX_TOKENS).
- GEMMs and MTP draft: explicit cuBLASLt configs for exact FP8 shapes (TRTLLM_CUBLAS_FP8_ALGO); 17..64-row
  draft head passes on a cuBLAS MXFP8 GEMM (TRTLLM_Q35_DRAFT_HEAD_MX_ROWS); argmax of the BF16 draft head in
  one launch (TRTLLM_Q35_DRAFT_ARGMAX_LOGITS).
- Scheduling: TRTLLM_DISAGG_GEN_ADMIT_BEFORE_ALLOC applies the KV-transfer window before KV allocation. The
  gate sits next to DisaggTransferAdmissionController in disaggregation/orchestration/admission.py. On main
  the coordinator bypasses the window for the Python transceiver with KV cache manager V2 and PP1; the switch
  keeps it on, which is how round 3's E46 / E51 GEN ran (max_tokens_in_buffer 4M). The PR's SRPT aging
  (TRTLLM_CTX_SCHED_SRPT_AGE_S / _AGE_ITERS / _AGE_CAP) already equals f76e4dd5d5's.

Not ported: TRTLLM_Q35_GDN_CORE_CONV and TRTLLM_Q35_GDN_BA_SERIAL_MIN_ROWS. No round-3 layout sets them, and
they conflict with the PR's rewrite of the GDN core kernel. Every switch defaults to off.

(cherry picked from commit f76e4dd5d5694443d21d578fc66172232800f2ab)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Zhenhuan Chen <[email protected]>
@dc3671

dc3671 commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@dc3671
dc3671 force-pushed the user/zhenhuanc/q35-upstream branch from f74d636 to f773e7d Compare October 26, 2026 05:29
dc3671 pushed a commit to dc3671/TensorRT-LLM that referenced this pull request Oct 26, 2026
…IA#20815

Ports tekit user/xiaomingc/qwen35-r3-merged f76e4dd5d5 onto the PR head 3ec3d07 in the PR's layout and
style: attention/backends, kernels/blackwell and moe/fused_moe paths, no debug or test hooks, and every new
TRTLLM_Q35_* switch read in a @q35_env.register reader or at call time, so TRTLLM_Q35_PROFILE can set it.

- CP-lite attention: the balanced split's wide plan (33..64 requests) and the two-slot plan with kernel_two
  (65..128), the quad plan for tests, and multi-CTA counter slots sized by the CP-lite batch cap. MAX_BATCH
  stays the PR's 32 here.
- MoE front: route-only launch with clusters of 16 for 257..512 and 513..1024 tokens
  (TRTLLM_Q35_MOE_FRONT_BIG_C16, TRTLLM_Q35_MOE_FRONT_BIG_C16W).
- Communication: CuTe two-shot all-reduce with several tokens per CTA (TRTLLM_Q35_FUSED_AR_TPC) and with an
  E4M3 payload (TRTLLM_Q35_FUSED_AR_FP8); plain all-reduces on the CuTe two-shot
  (TRTLLM_Q35_FUSED_AR_PLAIN_TWOSHOT); MNNVL two-shot all-reduce with an E4M3 payload and a token cap
  (TRTLLM_MNNVL_TWOSHOT_FP8, TRTLLM_MNNVL_TWOSHOT_FP8_MAX_TOKENS).
- GEMMs and MTP draft: explicit cuBLASLt configs for exact FP8 shapes (TRTLLM_CUBLAS_FP8_ALGO); 17..64-row
  draft head passes on a cuBLAS MXFP8 GEMM (TRTLLM_Q35_DRAFT_HEAD_MX_ROWS); argmax of the BF16 draft head in
  one launch (TRTLLM_Q35_DRAFT_ARGMAX_LOGITS).
- Scheduling: TRTLLM_DISAGG_GEN_ADMIT_BEFORE_ALLOC applies the KV-transfer window before KV allocation. The
  gate sits next to DisaggTransferAdmissionController in disaggregation/orchestration/admission.py. On main
  the coordinator bypasses the window for the Python transceiver with KV cache manager V2 and PP1; the switch
  keeps it on, which is how round 3's E46 / E51 GEN ran (max_tokens_in_buffer 4M). The PR's SRPT aging
  (TRTLLM_CTX_SCHED_SRPT_AGE_S / _AGE_ITERS / _AGE_CAP) already equals f76e4dd5d5's.

Not ported: TRTLLM_Q35_GDN_CORE_CONV and TRTLLM_Q35_GDN_BA_SERIAL_MIN_ROWS. No round-3 layout sets them, and
they conflict with the PR's rewrite of the GDN core kernel. Every switch defaults to off.

(cherry picked from commit f76e4dd5d5694443d21d578fc66172232800f2ab)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Zhenhuan Chen <[email protected]>
@dc3671

dc3671 commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #80541 [ run ] triggered by Bot. Commit: f773e7d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #80541 [ run ] completed with state FAILURE. Commit: f773e7d
/LLM/main/L0_MergeRequest_PR pipeline #66303 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

@dc3671
dc3671 force-pushed the user/zhenhuanc/q35-upstream branch from f773e7d to 39ba32e Compare October 26, 2026 06:54
dc3671 pushed a commit to dc3671/TensorRT-LLM that referenced this pull request Oct 26, 2026
…IA#20815

Ports tekit user/xiaomingc/qwen35-r3-merged f76e4dd5d5 onto the PR head 3ec3d07 in the PR's layout and
style: attention/backends, kernels/blackwell and moe/fused_moe paths, no debug or test hooks, and every new
TRTLLM_Q35_* switch read in a @q35_env.register reader or at call time, so TRTLLM_Q35_PROFILE can set it.

- CP-lite attention: the balanced split's wide plan (33..64 requests) and the two-slot plan with kernel_two
  (65..128), the quad plan for tests, and multi-CTA counter slots sized by the CP-lite batch cap. MAX_BATCH
  stays the PR's 32 here.
- MoE front: route-only launch with clusters of 16 for 257..512 and 513..1024 tokens
  (TRTLLM_Q35_MOE_FRONT_BIG_C16, TRTLLM_Q35_MOE_FRONT_BIG_C16W).
- Communication: CuTe two-shot all-reduce with several tokens per CTA (TRTLLM_Q35_FUSED_AR_TPC) and with an
  E4M3 payload (TRTLLM_Q35_FUSED_AR_FP8); plain all-reduces on the CuTe two-shot
  (TRTLLM_Q35_FUSED_AR_PLAIN_TWOSHOT); MNNVL two-shot all-reduce with an E4M3 payload and a token cap
  (TRTLLM_MNNVL_TWOSHOT_FP8, TRTLLM_MNNVL_TWOSHOT_FP8_MAX_TOKENS).
- GEMMs and MTP draft: explicit cuBLASLt configs for exact FP8 shapes (TRTLLM_CUBLAS_FP8_ALGO); 17..64-row
  draft head passes on a cuBLAS MXFP8 GEMM (TRTLLM_Q35_DRAFT_HEAD_MX_ROWS); argmax of the BF16 draft head in
  one launch (TRTLLM_Q35_DRAFT_ARGMAX_LOGITS).
- Scheduling: TRTLLM_DISAGG_GEN_ADMIT_BEFORE_ALLOC applies the KV-transfer window before KV allocation. The
  gate sits next to DisaggTransferAdmissionController in disaggregation/orchestration/admission.py. On main
  the coordinator bypasses the window for the Python transceiver with KV cache manager V2 and PP1; the switch
  keeps it on, which is how round 3's E46 / E51 GEN ran (max_tokens_in_buffer 4M). The PR's SRPT aging
  (TRTLLM_CTX_SCHED_SRPT_AGE_S / _AGE_ITERS / _AGE_CAP) already equals f76e4dd5d5's.

Not ported: TRTLLM_Q35_GDN_CORE_CONV and TRTLLM_Q35_GDN_BA_SERIAL_MIN_ROWS. No round-3 layout sets them, and
they conflict with the PR's rewrite of the GDN core kernel. Every switch defaults to off.

(cherry picked from commit f76e4dd5d5694443d21d578fc66172232800f2ab)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Zhenhuan Chen <[email protected]>
@dc3671
dc3671 force-pushed the user/zhenhuanc/q35-upstream branch from 6906aae to a66ccf8 Compare October 27, 2026 06:44
dc3671 pushed a commit to dc3671/TensorRT-LLM that referenced this pull request Oct 27, 2026
…IA#20815

Ports tekit user/xiaomingc/qwen35-r3-merged f76e4dd5d5 onto the PR head 3ec3d07 in the PR's layout and
style: attention/backends, kernels/blackwell and moe/fused_moe paths, no debug or test hooks, and every new
TRTLLM_Q35_* switch read in a @q35_env.register reader or at call time, so TRTLLM_Q35_PROFILE can set it.

- CP-lite attention: the balanced split's wide plan (33..64 requests) and the two-slot plan with kernel_two
  (65..128), the quad plan for tests, and multi-CTA counter slots sized by the CP-lite batch cap. MAX_BATCH
  stays the PR's 32 here.
- MoE front: route-only launch with clusters of 16 for 257..512 and 513..1024 tokens
  (TRTLLM_Q35_MOE_FRONT_BIG_C16, TRTLLM_Q35_MOE_FRONT_BIG_C16W).
- Communication: CuTe two-shot all-reduce with several tokens per CTA (TRTLLM_Q35_FUSED_AR_TPC) and with an
  E4M3 payload (TRTLLM_Q35_FUSED_AR_FP8); plain all-reduces on the CuTe two-shot
  (TRTLLM_Q35_FUSED_AR_PLAIN_TWOSHOT); MNNVL two-shot all-reduce with an E4M3 payload and a token cap
  (TRTLLM_MNNVL_TWOSHOT_FP8, TRTLLM_MNNVL_TWOSHOT_FP8_MAX_TOKENS).
- GEMMs and MTP draft: explicit cuBLASLt configs for exact FP8 shapes (TRTLLM_CUBLAS_FP8_ALGO); 17..64-row
  draft head passes on a cuBLAS MXFP8 GEMM (TRTLLM_Q35_DRAFT_HEAD_MX_ROWS); argmax of the BF16 draft head in
  one launch (TRTLLM_Q35_DRAFT_ARGMAX_LOGITS).
- Scheduling: TRTLLM_DISAGG_GEN_ADMIT_BEFORE_ALLOC applies the KV-transfer window before KV allocation. The
  gate sits next to DisaggTransferAdmissionController in disaggregation/orchestration/admission.py. On main
  the coordinator bypasses the window for the Python transceiver with KV cache manager V2 and PP1; the switch
  keeps it on, which is how round 3's E46 / E51 GEN ran (max_tokens_in_buffer 4M). The PR's SRPT aging
  (TRTLLM_CTX_SCHED_SRPT_AGE_S / _AGE_ITERS / _AGE_CAP) already equals f76e4dd5d5's.

Not ported: TRTLLM_Q35_GDN_CORE_CONV and TRTLLM_Q35_GDN_BA_SERIAL_MIN_ROWS. No round-3 layout sets them, and
they conflict with the PR's rewrite of the GDN core kernel. Every switch defaults to off.

(cherry picked from commit f76e4dd5d5694443d21d578fc66172232800f2ab)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Zhenhuan Chen <[email protected]>
@dc3671
dc3671 force-pushed the user/zhenhuanc/q35-upstream branch from a66ccf8 to d02a209 Compare October 27, 2026 06:50
dc3671 pushed a commit to dc3671/TensorRT-LLM that referenced this pull request Oct 27, 2026
…IA#20815

Ports tekit user/xiaomingc/qwen35-r3-merged f76e4dd5d5 onto the PR head 3ec3d07 in the PR's layout and
style: attention/backends, kernels/blackwell and moe/fused_moe paths, no debug or test hooks, and every new
TRTLLM_Q35_* switch read in a @q35_env.register reader or at call time, so TRTLLM_Q35_PROFILE can set it.

- CP-lite attention: the balanced split's wide plan (33..64 requests) and the two-slot plan with kernel_two
  (65..128), the quad plan for tests, and multi-CTA counter slots sized by the CP-lite batch cap. MAX_BATCH
  stays the PR's 32 here.
- MoE front: route-only launch with clusters of 16 for 257..512 and 513..1024 tokens
  (TRTLLM_Q35_MOE_FRONT_BIG_C16, TRTLLM_Q35_MOE_FRONT_BIG_C16W).
- Communication: CuTe two-shot all-reduce with several tokens per CTA (TRTLLM_Q35_FUSED_AR_TPC) and with an
  E4M3 payload (TRTLLM_Q35_FUSED_AR_FP8); plain all-reduces on the CuTe two-shot
  (TRTLLM_Q35_FUSED_AR_PLAIN_TWOSHOT); MNNVL two-shot all-reduce with an E4M3 payload and a token cap
  (TRTLLM_MNNVL_TWOSHOT_FP8, TRTLLM_MNNVL_TWOSHOT_FP8_MAX_TOKENS).
- GEMMs and MTP draft: explicit cuBLASLt configs for exact FP8 shapes (TRTLLM_CUBLAS_FP8_ALGO); 17..64-row
  draft head passes on a cuBLAS MXFP8 GEMM (TRTLLM_Q35_DRAFT_HEAD_MX_ROWS); argmax of the BF16 draft head in
  one launch (TRTLLM_Q35_DRAFT_ARGMAX_LOGITS).
- Scheduling: TRTLLM_DISAGG_GEN_ADMIT_BEFORE_ALLOC applies the KV-transfer window before KV allocation. The
  gate sits next to DisaggTransferAdmissionController in disaggregation/orchestration/admission.py. On main
  the coordinator bypasses the window for the Python transceiver with KV cache manager V2 and PP1; the switch
  keeps it on, which is how round 3's E46 / E51 GEN ran (max_tokens_in_buffer 4M). The PR's SRPT aging
  (TRTLLM_CTX_SCHED_SRPT_AGE_S / _AGE_ITERS / _AGE_CAP) already equals f76e4dd5d5's.

Not ported: TRTLLM_Q35_GDN_CORE_CONV and TRTLLM_Q35_GDN_BA_SERIAL_MIN_ROWS. No round-3 layout sets them, and
they conflict with the PR's rewrite of the GDN core kernel. Every switch defaults to off.

(cherry picked from commit f76e4dd5d5694443d21d578fc66172232800f2ab)

Signed-off-by: Zhenhuan Chen <[email protected]>
@dc3671
dc3671 marked this pull request as ready for review October 27, 2026 06:50
@dc3671
dc3671 requested review from a team as code owners October 27, 2026 06:50
@dc3671 dc3671 added the api-compatible Accepted LLM API contract change that is backwards-compatible label Oct 27, 2026
@dc3671
dc3671 merged commit 5d86481 into NVIDIA:main Nov 1, 2026
zhaoyuanh-nvidia added a commit to zhaoyuanh-nvidia/TensorRT-LLM that referenced this pull request Nov 2, 2026
Resolve conflicts with NVIDIA#20815 and NVIDIA#20306 in the decoder graph capture:
keep the confidence guard on the advanced draft-sampling variant and
main's new temperature-only variant (MTP-Eagle only, so never DSpark),
and keep both new imports in the DSpark CUDA-graph runtime test.

Signed-off-by: Zhaoyuan He <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
zhaoyuanh-nvidia added a commit to zhaoyuanh-nvidia/TensorRT-LLM that referenced this pull request Nov 2, 2026
Resolve conflicts with NVIDIA#20815 and NVIDIA#20306 in the decoder graph capture:
keep the confidence guard on the advanced draft-sampling variant and
main's new temperature-only variant (MTP-Eagle only, so never DSpark),
and keep both new imports in the DSpark CUDA-graph runtime test.

Signed-off-by: Zhaoyuan He <[email protected]>
richardhuo-nv added a commit to SemiAnalysisAI/InferenceX that referenced this pull request Nov 2, 2026
…fig fields

TensorRT-LLM 1.4.0rc3 (NVIDIA/TensorRT-LLM#20815) reads none of the
feature-branch TRTLLM_* switches this recipe set. Its Qwen3.5 paths are on
by default, derived from existing config, or explicit LLM-API fields.

- Prefill: shortest-uncached-first context scheduling, breakable prefill
  CUDA graphs on the same buckets without torch.compile, and branch
  snapshots under block_reuse_config. DEP prefill keeps piecewise graphs
  and ages context requests after 30 scheduler iterations (about 8 s at
  its measured 3.8 iterations/s).
- Decode: a replicated embedding table. TEP decode drafts with the MXFP8
  MTP LM head and keeps the GEN KV-transfer window with an explicit
  max_tokens_in_buffer; 3P1D also sends the MNNVL all-reduce payload in
  E4M3.
- Drop the switches rc3 does not read: TRTLLM_Q35_*, SRPT, PREFILL_BCG,
  in-forward snapshot, disaggregated-GEN, spec-sampler, overlap-loop,
  MNNVL FP8 and cuBLAS FP8 tables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-compatible Accepted LLM API contract change that is backwards-compatible ci: full pre-merge approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.