Skip to content

[None][chore] Remove is_first_draft dead code - #19867

Merged
mikeiovine merged 7 commits into
NVIDIA:mainfrom
mikeiovine:remove-first-draft
Oct 16, 2026
Merged

mikeiovine merged 7 commits into
NVIDIA:mainfrom
mikeiovine:remove-first-draft

Conversation

@mikeiovine

@mikeiovine mikeiovine commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Remove is_first_draft attribute and all related code paths (dead code now that 2-model spec dec is removed).

Test Coverage

Existing tests.

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.

Dev Engineer Review

The available working-tree diff reformats imports in cuda_graph_runner.py and five test files. It does not remove is_first_draft or change runtime behavior. The diff does not show the stated PR objective, so verify that the intended functional changes are included.

QA Engineer Review

Five test files changed: test_pytorch_model_engine.py, test_modeling_llama.py, test_modeling_llama_min_latency.py, test_modeling_mixtral.py, and test_modeling_mllama.py. The changes only reformat imports; no test functions, IDs, selectors, or assertions changed. These are unit tests, so integration test-list inclusion does not apply. Test results are not established. Coverage verdict: needs follow-up because the available diff does not cover the stated removal.

Per-File QA Perspective

  • tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py: Import formatting only. No observable behavior change appears in the diff.
  • tests/unittest/_torch/executor/test_pytorch_model_engine.py: Import formatting only; test behavior is unchanged. Integration test-list inclusion does not apply.
  • tests/unittest/_torch/modeling/test_modeling_llama.py: Import formatting only; test behavior is unchanged. Integration test-list inclusion does not apply.
  • tests/unittest/_torch/modeling/test_modeling_llama_min_latency.py: Import formatting only; test behavior is unchanged. Integration test-list inclusion does not apply.
  • tests/unittest/_torch/modeling/test_modeling_mixtral.py: Import formatting only; test behavior is unchanged. Integration test-list inclusion does not apply.
  • tests/unittest/_torch/modeling/test_modeling_mllama.py: Import formatting only; test behavior is unchanged. Integration test-list inclusion does not apply.

@mikeiovine

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/TensorRT-LLM/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 6b3c2849-a4d6-4780-9d96-b5ad9996d74f
📥 Commits

Reviewing files that changed from the base of the PR and between 75d93b8 and bcb51f0.

📒 Files selected for processing (16)
  • tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py
  • tensorrt_llm/_torch/pyexecutor/engine/runners/decoder/runner.py
  • tensorrt_llm/_torch/pyexecutor/llm_request.py
  • tensorrt_llm/_torch/speculative/eagle3.py
  • tests/unittest/_torch/executor/test_cuda_graph_capture_replay.py
  • tests/unittest/_torch/executor/test_pytorch_model_engine.py
  • tests/unittest/_torch/modeling/test_modeling_exaone_moe.py
  • tests/unittest/_torch/modeling/test_modeling_llama.py
  • tests/unittest/_torch/modeling/test_modeling_llama_min_latency.py
  • tests/unittest/_torch/modeling/test_modeling_mistral.py
  • tests/unittest/_torch/modeling/test_modeling_mixtral.py
  • tests/unittest/_torch/modeling/test_modeling_mllama.py
  • tests/unittest/_torch/modeling/test_modeling_multimodal.py
  • tests/unittest/_torch/modeling/test_modeling_nemotron.py
  • tests/unittest/_torch/modeling/test_modeling_qwen3vl.py
  • tests/unittest/_torch/modeling/test_modeling_qwen3vl_moe.py
💤 Files with no reviewable changes (2)
  • tensorrt_llm/_torch/speculative/eagle3.py
  • tensorrt_llm/_torch/pyexecutor/llm_request.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Walkthrough

The changes remove the is_first_draft request flag and its separate decoder handling. CUDA graph keys and their callers now use the remaining fields. Related tests update graph keys, request expectations, and padding scenarios.

Changes

First-draft request handling

Layer / File(s) Summary
Request and graph-key contracts
tensorrt_llm/_torch/pyexecutor/llm_request.py, tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py, tensorrt_llm/_torch/speculative/eagle3.py
The request constructor and KeyType no longer include the first-draft flag. Eagle3 no longer initializes or resets it. The graph runner uses the remaining sequence-length rules.
Decoder routing and graph eligibility
tensorrt_llm/_torch/pyexecutor/engine/runners/decoder/runner.py
The decoder removes first-draft promotion exclusions and the separate request collection and packing loop. Generation-token counts, cached-token logging, and cache eligibility no longer treat first-draft requests as a separate group.
Updated routing and graph-key tests
tests/unittest/_torch/executor/test_pytorch_model_engine.py, tests/unittest/_torch/executor/test_cuda_graph_capture_replay.py, tests/unittest/_torch/modeling/test_modeling_*.py
Tests remove the first-draft graph-key field and related fallback cases. The padding test removes the separate first-draft batch. CUDA graph capture and replay tests use two-field keys.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Refactor

Suggested reviewers: juney-nvidia

Merge Risk: ⚪ Minimal · up to bcb51

No actionable issue is established in the reviewed changes. The reported CI failures still need their usual investigation before merge.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 41.18% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 51 functions across 15 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title follows the required format and clearly identifies the removal of the obsolete is_first_draft code.
Description check Passed The description explains the reason for the change, identifies the solution, includes test coverage, and includes the required checklist. The test coverage entry is brief but sufficient for a cleanup …
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #76262 [ run ] triggered by Bot. Commit: 80e0915 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #76262 [ run ] completed with state FAILURE. Commit: 80e0915
/LLM/main/L0_MergeRequest_PR pipeline #62877 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

@mikeiovine

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #76396 [ run ] triggered by Bot. Commit: 51f415a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #76396 [ run ] completed with state FAILURE. Commit: 51f415a
/LLM/main/L0_MergeRequest_PR pipeline #62991 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

@mikeiovine

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #76409 [ run ] triggered by Bot. Commit: 51f415a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #76409 [ run ] completed with state FAILURE. Commit: 51f415a
/LLM/main/L0_MergeRequest_PR pipeline #63003 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Either:

  • Wait for the PR to be fully approved — the label is added automatically once approval is complete. Having unresolved open comments is fine, or
  • If needed, ask a member of NVIDIA/trt-llm-ci-approvers to add the label manually.
    Then re-trigger CI with the same bot command (no rebase needed).

⚠️ 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

@lori-ren lori-ren 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.

LGTM

@mikeiovine

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #76559 [ run ] triggered by Bot. Commit: 51f415a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #76559 [ run ] completed with state SUCCESS. Commit: 51f415a
/LLM/main/L0_MergeRequest_PR pipeline #63133 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

@mikeiovine

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #76607 [ run ] triggered by Bot. Commit: 51f415a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #76607 [ run ] completed with state SUCCESS. Commit: 51f415a
/LLM/main/L0_MergeRequest_PR pipeline #63172 completed with status: 'UNSTABLE'

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

mikeiovine and others added 2 commits October 8, 2026 16:50
Signed-off-by: Mike Iovine <[email protected]>
@mikeiovine

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #77817 [ run ] triggered by Bot. Commit: 2245634 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #77817 [ run ] completed with state SUCCESS. Commit: 2245634
/LLM/main/L0_MergeRequest_PR pipeline #64153 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

@mikeiovine

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #77901 [ run ] triggered by Bot. Commit: 2245634 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

@mikeiovine

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #78210 [ run ] triggered by Bot. Commit: 2245634 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #78210 [ run ] completed with state SUCCESS. Commit: 2245634
/LLM/main/L0_MergeRequest_PR pipeline #64464 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

@mikeiovine

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #78511 [ run ] triggered by Bot. Commit: 2245634 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #78511 [ run ] completed with state SUCCESS. Commit: 2245634
/LLM/main/L0_MergeRequest_PR pipeline #64712 completed with status: 'SUCCESS'

CI Report

Link to invocation

@mikeiovine
mikeiovine merged commit c226e2d into NVIDIA:main Oct 16, 2026
@mikeiovine
mikeiovine deleted the remove-first-draft branch October 16, 2026 18:57
vsabavat added a commit to vsabavat/TensorRT-LLM that referenced this pull request Oct 16, 2026
Resolve the runner.py conflict by taking main's removal of the first-draft input path (NVIDIA#19867), and drop the three references this branch added to the removed API: the first_draft_requests term in the previous-batch offset zeroing condition and the is_first_draft KeyType field in two executor tests.

Signed-off-by: Vasanth Sabavat <[email protected]>
lori-ren added a commit to lori-ren/TensorRT-LLM that referenced this pull request Oct 18, 2026
Resolve the overlap with NVIDIA#19867 and drop draft_model_engine
from the Whisper cache-reuse guard added in NVIDIA#19302.

Signed-off-by: Lori Ren <[email protected]>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Oct 19, 2026
…d duplicated helpers

A cleanup pass over the feature and perf commits; nothing the target computes changes.

Dead code:
- ops/hc: the Triton qwen4_exp_hc_decode_first / _decode_mix / _decode_mix_fp4 entries and
  qwen4_exp_hc_gate_mean, with their tests. The forward never reached them: one-row decode sites
  run the CuTe pair, larger batches the fused up projection. The CuTe entries now own the
  references and checks they borrowed; their NVFP4 reference is catalog fp4_quantize's.
- DecodeTarget: the _HC_FUSED_UP_MIN_ROWS / _HC_TC_FIRST_MIN_ROWS branches that
  _HC_DECODE_GEMV_MAX_ROWS = 1 left unreachable (with the fp4_quantize fallback), the
  inputs_embeds branch begin_step already refuses, and the unread `pos` / `qsl_long` fields of
  the decode step tuples.
- qsa_sparse_gqa_rowtile: the Triton bitmap and row-tile passes and their launch knobs. The entry
  now refuses what the CuTe pass cannot take (non-bf16, non-SM103, head_dim != 256, misaligned
  rows) instead of falling back; the fp16 / fp8 pool cells and the Triton comparison test go.
- gdn_prefill_conv_post: the Triton conv pass the CuTe pass always replaced; an unmet
  precondition is now an assertion.
- catalog/ssm/gated_delta_rule_decode_pretranspose and its test: no forward path launched it.
  Its fp64 recurrence moved to gdn_decode_gated_norm_pdl._recurrence_reference, and the decode
  tests compare against FlashInfer's kernel directly.
- The decoder runner's first-draft mRoPE refusal and its tests: nothing sets py_is_first_draft
  since NVIDIA#19867.

Reuse:
- The local TRTLLM_ENABLE_PDL gates call flashinfer_utils.get_env_enable_pdl.
- qsa_paged_sparse_gqa_nvfp4 imports the QSA backend's split-K config and PDL policy instead of
  copying them.
- qsa_topk_expand_decode.supports() replaces the width checks restated at its two call sites.
- The CuteDSL FC2 entry uses FC1's unswizzle / dequant reference helpers, and
  gdn_decode_rows_gated_norm's reference delegates to gdn_decode_gated_norm_pdl's.

Less work:
- gdn_decode_gated_norm_pdl and gdn_in_proj_conv1d_pdl compile from the call's operands instead
  of dummies spanning the whole coalesced state pool, a transient of every layer's state for
  every slot during decode graph capture.
- PrefillTarget._gdn_core_generic reads q|k|v as the projection's column view and lets the
  chunked delta rule write `out` directly: two copies fewer per GDN layer on verify and
  bf16-state steps.

Comments no longer cite campaign scratch files.

Signed-off-by: Wanli Jiang <[email protected]>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Oct 19, 2026
…d duplicated helpers

A cleanup pass over the feature and perf commits; nothing the target computes changes.

Dead code:
- ops/hc: the Triton qwen4_exp_hc_decode_first / _decode_mix / _decode_mix_fp4 entries and
  qwen4_exp_hc_gate_mean, with their tests. The forward never reached them: one-row decode sites
  run the CuTe pair, larger batches the fused up projection. The CuTe entries now own the
  references and checks they borrowed; their NVFP4 reference is catalog fp4_quantize's.
- DecodeTarget: the _HC_FUSED_UP_MIN_ROWS / _HC_TC_FIRST_MIN_ROWS branches that
  _HC_DECODE_GEMV_MAX_ROWS = 1 left unreachable (with the fp4_quantize fallback), the
  inputs_embeds branch begin_step already refuses, and the unread `pos` / `qsl_long` fields of
  the decode step tuples.
- qsa_sparse_gqa_rowtile: the Triton bitmap and row-tile passes and their launch knobs. The entry
  now refuses what the CuTe pass cannot take (non-bf16, non-SM103, head_dim != 256, misaligned
  rows) instead of falling back; the fp16 / fp8 pool cells and the Triton comparison test go.
- gdn_prefill_conv_post: the Triton conv pass the CuTe pass always replaced; an unmet
  precondition is now an assertion.
- catalog/ssm/gated_delta_rule_decode_pretranspose and its test: no forward path launched it.
  Its fp64 recurrence moved to gdn_decode_gated_norm_pdl._recurrence_reference, and the decode
  tests compare against FlashInfer's kernel directly.
- The decoder runner's first-draft mRoPE refusal and its tests: nothing sets py_is_first_draft
  since NVIDIA#19867.

Reuse:
- The local TRTLLM_ENABLE_PDL gates call flashinfer_utils.get_env_enable_pdl.
- qsa_paged_sparse_gqa_nvfp4 imports the QSA backend's split-K config and PDL policy instead of
  copying them.
- qsa_topk_expand_decode.supports() replaces the width checks restated at its two call sites.
- The CuteDSL FC2 entry uses FC1's unswizzle / dequant reference helpers, and
  gdn_decode_rows_gated_norm's reference delegates to gdn_decode_gated_norm_pdl's.

Less work:
- gdn_decode_gated_norm_pdl and gdn_in_proj_conv1d_pdl compile from the call's operands instead
  of dummies spanning the whole coalesced state pool, a transient of every layer's state for
  every slot during decode graph capture.
- PrefillTarget._gdn_core_generic reads q|k|v as the projection's column view and lets the
  chunked delta rule write `out` directly: two copies fewer per GDN layer on verify and
  bf16-state steps.

Comments no longer cite campaign scratch files.

Signed-off-by: Wanli Jiang <[email protected]>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Oct 19, 2026
…d duplicated helpers

A cleanup pass over the feature and perf commits; nothing the target computes changes.

Dead code:
- ops/hc: the Triton qwen4_exp_hc_decode_first / _decode_mix / _decode_mix_fp4 entries and
  qwen4_exp_hc_gate_mean, with their tests. The forward never reached them: one-row decode sites
  run the CuTe pair, larger batches the fused up projection. The CuTe entries now own the
  references and checks they borrowed; their NVFP4 reference is catalog fp4_quantize's.
- DecodeTarget: the _HC_FUSED_UP_MIN_ROWS / _HC_TC_FIRST_MIN_ROWS branches that
  _HC_DECODE_GEMV_MAX_ROWS = 1 left unreachable (with the fp4_quantize fallback), the
  inputs_embeds branch begin_step already refuses, and the unread `pos` / `qsl_long` fields of
  the decode step tuples.
- qsa_sparse_gqa_rowtile: the Triton bitmap and row-tile passes and their launch knobs. The entry
  now refuses what the CuTe pass cannot take (non-bf16, non-SM103, head_dim != 256, misaligned
  rows) instead of falling back; the fp16 / fp8 pool cells and the Triton comparison test go.
- gdn_prefill_conv_post: the Triton conv pass the CuTe pass always replaced; an unmet
  precondition is now an assertion.
- catalog/ssm/gated_delta_rule_decode_pretranspose and its test: no forward path launched it.
  Its fp64 recurrence moved to gdn_decode_gated_norm_pdl._recurrence_reference, and the decode
  tests compare against FlashInfer's kernel directly.
- The decoder runner's first-draft mRoPE refusal and its tests: nothing sets py_is_first_draft
  since NVIDIA#19867.

Reuse:
- The local TRTLLM_ENABLE_PDL gates call flashinfer_utils.get_env_enable_pdl.
- qsa_paged_sparse_gqa_nvfp4 imports the QSA backend's split-K config and PDL policy instead of
  copying them.
- qsa_topk_expand_decode.supports() replaces the width checks restated at its two call sites.
- The CuteDSL FC2 entry uses FC1's unswizzle / dequant reference helpers, and
  gdn_decode_rows_gated_norm's reference delegates to gdn_decode_gated_norm_pdl's.

Less work:
- gdn_decode_gated_norm_pdl and gdn_in_proj_conv1d_pdl compile from the call's operands instead
  of dummies spanning the whole coalesced state pool, a transient of every layer's state for
  every slot during decode graph capture.
- PrefillTarget._gdn_core_generic reads q|k|v as the projection's column view and lets the
  chunked delta rule write `out` directly: two copies fewer per GDN layer on verify and
  bf16-state steps.

Comments no longer cite campaign scratch files.

Signed-off-by: Wanli Jiang <[email protected]>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Oct 19, 2026
…d duplicated helpers

A cleanup pass over the feature and perf commits; nothing the target computes changes.

Dead code:
- ops/hc: the Triton qwen4_exp_hc_decode_first / _decode_mix / _decode_mix_fp4 entries and
  qwen4_exp_hc_gate_mean, with their tests. The forward never reached them: one-row decode sites
  run the CuTe pair, larger batches the fused up projection. The CuTe entries now own the
  references and checks they borrowed; their NVFP4 reference is catalog fp4_quantize's.
- DecodeTarget: the _HC_FUSED_UP_MIN_ROWS / _HC_TC_FIRST_MIN_ROWS branches that
  _HC_DECODE_GEMV_MAX_ROWS = 1 left unreachable (with the fp4_quantize fallback), the
  inputs_embeds branch begin_step already refuses, and the unread `pos` / `qsl_long` fields of
  the decode step tuples.
- qsa_sparse_gqa_rowtile: the Triton bitmap and row-tile passes and their launch knobs. The entry
  now refuses what the CuTe pass cannot take (non-bf16, non-SM103, head_dim != 256, misaligned
  rows) instead of falling back; the fp16 / fp8 pool cells and the Triton comparison test go.
- gdn_prefill_conv_post: the Triton conv pass the CuTe pass always replaced; an unmet
  precondition is now an assertion.
- catalog/ssm/gated_delta_rule_decode_pretranspose and its test: no forward path launched it.
  Its fp64 recurrence moved to gdn_decode_gated_norm_pdl._recurrence_reference, and the decode
  tests compare against FlashInfer's kernel directly.
- The decoder runner's first-draft mRoPE refusal and its tests: nothing sets py_is_first_draft
  since NVIDIA#19867.

Reuse:
- The local TRTLLM_ENABLE_PDL gates call flashinfer_utils.get_env_enable_pdl.
- qsa_paged_sparse_gqa_nvfp4 imports the QSA backend's split-K config and PDL policy instead of
  copying them.
- qsa_topk_expand_decode.supports() replaces the width checks restated at its two call sites.
- The CuteDSL FC2 entry uses FC1's unswizzle / dequant reference helpers, and
  gdn_decode_rows_gated_norm's reference delegates to gdn_decode_gated_norm_pdl's.

Less work:
- gdn_decode_gated_norm_pdl and gdn_in_proj_conv1d_pdl compile from the call's operands instead
  of dummies spanning the whole coalesced state pool, a transient of every layer's state for
  every slot during decode graph capture.
- PrefillTarget._gdn_core_generic reads q|k|v as the projection's column view and lets the
  chunked delta rule write `out` directly: two copies fewer per GDN layer on verify and
  bf16-state steps.

Comments no longer cite campaign scratch files.

Signed-off-by: Wanli Jiang <[email protected]>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Oct 20, 2026
…d duplicated helpers

A cleanup pass over the feature and perf commits; nothing the target computes changes.

Dead code:
- ops/hc: the Triton qwen4_exp_hc_decode_first / _decode_mix / _decode_mix_fp4 entries and
  qwen4_exp_hc_gate_mean, with their tests. The forward never reached them: one-row decode sites
  run the CuTe pair, larger batches the fused up projection. The CuTe entries now own the
  references and checks they borrowed; their NVFP4 reference is catalog fp4_quantize's.
- DecodeTarget: the _HC_FUSED_UP_MIN_ROWS / _HC_TC_FIRST_MIN_ROWS branches that
  _HC_DECODE_GEMV_MAX_ROWS = 1 left unreachable (with the fp4_quantize fallback), the
  inputs_embeds branch begin_step already refuses, and the unread `pos` / `qsl_long` fields of
  the decode step tuples.
- qsa_sparse_gqa_rowtile: the Triton bitmap and row-tile passes and their launch knobs. The entry
  now refuses what the CuTe pass cannot take (non-bf16, non-SM103, head_dim != 256, misaligned
  rows) instead of falling back; the fp16 / fp8 pool cells and the Triton comparison test go.
- gdn_prefill_conv_post: the Triton conv pass the CuTe pass always replaced; an unmet
  precondition is now an assertion.
- catalog/ssm/gated_delta_rule_decode_pretranspose and its test: no forward path launched it.
  Its fp64 recurrence moved to gdn_decode_gated_norm_pdl._recurrence_reference, and the decode
  tests compare against FlashInfer's kernel directly.
- The decoder runner's first-draft mRoPE refusal and its tests: nothing sets py_is_first_draft
  since NVIDIA#19867.

Reuse:
- The local TRTLLM_ENABLE_PDL gates call flashinfer_utils.get_env_enable_pdl.
- qsa_paged_sparse_gqa_nvfp4 imports the QSA backend's split-K config and PDL policy instead of
  copying them.
- qsa_topk_expand_decode.supports() replaces the width checks restated at its two call sites.
- The CuteDSL FC2 entry uses FC1's unswizzle / dequant reference helpers, and
  gdn_decode_rows_gated_norm's reference delegates to gdn_decode_gated_norm_pdl's.

Less work:
- gdn_decode_gated_norm_pdl and gdn_in_proj_conv1d_pdl compile from the call's operands instead
  of dummies spanning the whole coalesced state pool, a transient of every layer's state for
  every slot during decode graph capture.
- PrefillTarget._gdn_core_generic reads q|k|v as the projection's column view and lets the
  chunked delta rule write `out` directly: two copies fewer per GDN layer on verify and
  bf16-state steps.

Comments no longer cite campaign scratch files.

Signed-off-by: Wanli Jiang <[email protected]>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Oct 21, 2026
…d duplicated helpers

A cleanup pass over the feature and perf commits; nothing the target computes changes.

Dead code:
- ops/hc: the Triton qwen4_exp_hc_decode_first / _decode_mix / _decode_mix_fp4 entries and
  qwen4_exp_hc_gate_mean, with their tests. The forward never reached them: one-row decode sites
  run the CuTe pair, larger batches the fused up projection. The CuTe entries now own the
  references and checks they borrowed; their NVFP4 reference is catalog fp4_quantize's.
- DecodeTarget: the _HC_FUSED_UP_MIN_ROWS / _HC_TC_FIRST_MIN_ROWS branches that
  _HC_DECODE_GEMV_MAX_ROWS = 1 left unreachable (with the fp4_quantize fallback), the
  inputs_embeds branch begin_step already refuses, and the unread `pos` / `qsl_long` fields of
  the decode step tuples.
- qsa_sparse_gqa_rowtile: the Triton bitmap and row-tile passes and their launch knobs. The entry
  now refuses what the CuTe pass cannot take (non-bf16, non-SM103, head_dim != 256, misaligned
  rows) instead of falling back; the fp16 / fp8 pool cells and the Triton comparison test go.
- gdn_prefill_conv_post: the Triton conv pass the CuTe pass always replaced; an unmet
  precondition is now an assertion.
- catalog/ssm/gated_delta_rule_decode_pretranspose and its test: no forward path launched it.
  Its fp64 recurrence moved to gdn_decode_gated_norm_pdl._recurrence_reference, and the decode
  tests compare against FlashInfer's kernel directly.
- The decoder runner's first-draft mRoPE refusal and its tests: nothing sets py_is_first_draft
  since NVIDIA#19867.

Reuse:
- The local TRTLLM_ENABLE_PDL gates call flashinfer_utils.get_env_enable_pdl.
- qsa_paged_sparse_gqa_nvfp4 imports the QSA backend's split-K config and PDL policy instead of
  copying them.
- qsa_topk_expand_decode.supports() replaces the width checks restated at its two call sites.
- The CuteDSL FC2 entry uses FC1's unswizzle / dequant reference helpers, and
  gdn_decode_rows_gated_norm's reference delegates to gdn_decode_gated_norm_pdl's.

Less work:
- gdn_decode_gated_norm_pdl and gdn_in_proj_conv1d_pdl compile from the call's operands instead
  of dummies spanning the whole coalesced state pool, a transient of every layer's state for
  every slot during decode graph capture.
- PrefillTarget._gdn_core_generic reads q|k|v as the projection's column view and lets the
  chunked delta rule write `out` directly: two copies fewer per GDN layer on verify and
  bf16-state steps.

Comments no longer cite campaign scratch files.

Signed-off-by: Wanli Jiang <[email protected]>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Oct 22, 2026
…d duplicated helpers

A cleanup pass over the feature and perf commits; nothing the target computes changes.

Dead code:
- ops/hc: the Triton qwen4_exp_hc_decode_first / _decode_mix / _decode_mix_fp4 entries and
  qwen4_exp_hc_gate_mean, with their tests. The forward never reached them: one-row decode sites
  run the CuTe pair, larger batches the fused up projection. The CuTe entries now own the
  references and checks they borrowed; their NVFP4 reference is catalog fp4_quantize's.
- DecodeTarget: the _HC_FUSED_UP_MIN_ROWS / _HC_TC_FIRST_MIN_ROWS branches that
  _HC_DECODE_GEMV_MAX_ROWS = 1 left unreachable (with the fp4_quantize fallback), the
  inputs_embeds branch begin_step already refuses, and the unread `pos` / `qsl_long` fields of
  the decode step tuples.
- qsa_sparse_gqa_rowtile: the Triton bitmap and row-tile passes and their launch knobs. The entry
  now refuses what the CuTe pass cannot take (non-bf16, non-SM103, head_dim != 256, misaligned
  rows) instead of falling back; the fp16 / fp8 pool cells and the Triton comparison test go.
- gdn_prefill_conv_post: the Triton conv pass the CuTe pass always replaced; an unmet
  precondition is now an assertion.
- catalog/ssm/gated_delta_rule_decode_pretranspose and its test: no forward path launched it.
  Its fp64 recurrence moved to gdn_decode_gated_norm_pdl._recurrence_reference, and the decode
  tests compare against FlashInfer's kernel directly.
- The decoder runner's first-draft mRoPE refusal and its tests: nothing sets py_is_first_draft
  since NVIDIA#19867.

Reuse:
- The local TRTLLM_ENABLE_PDL gates call flashinfer_utils.get_env_enable_pdl.
- qsa_paged_sparse_gqa_nvfp4 imports the QSA backend's split-K config and PDL policy instead of
  copying them.
- qsa_topk_expand_decode.supports() replaces the width checks restated at its two call sites.
- The CuteDSL FC2 entry uses FC1's unswizzle / dequant reference helpers, and
  gdn_decode_rows_gated_norm's reference delegates to gdn_decode_gated_norm_pdl's.

Less work:
- gdn_decode_gated_norm_pdl and gdn_in_proj_conv1d_pdl compile from the call's operands instead
  of dummies spanning the whole coalesced state pool, a transient of every layer's state for
  every slot during decode graph capture.
- PrefillTarget._gdn_core_generic reads q|k|v as the projection's column view and lets the
  chunked delta rule write `out` directly: two copies fewer per GDN layer on verify and
  bf16-state steps.

Comments no longer cite campaign scratch files.

Signed-off-by: Wanli Jiang <[email protected]>
Wanli-Jiang added a commit to Wanli-Jiang/TensorRT-LLM that referenced this pull request Oct 22, 2026
…d duplicated helpers

A cleanup pass over the feature and perf commits; nothing the target computes changes.

Dead code:
- ops/hc: the Triton qwen4_exp_hc_decode_first / _decode_mix / _decode_mix_fp4 entries and
  qwen4_exp_hc_gate_mean, with their tests. The forward never reached them: one-row decode sites
  run the CuTe pair, larger batches the fused up projection. The CuTe entries now own the
  references and checks they borrowed; their NVFP4 reference is catalog fp4_quantize's.
- DecodeTarget: the _HC_FUSED_UP_MIN_ROWS / _HC_TC_FIRST_MIN_ROWS branches that
  _HC_DECODE_GEMV_MAX_ROWS = 1 left unreachable (with the fp4_quantize fallback), the
  inputs_embeds branch begin_step already refuses, and the unread `pos` / `qsl_long` fields of
  the decode step tuples.
- qsa_sparse_gqa_rowtile: the Triton bitmap and row-tile passes and their launch knobs. The entry
  now refuses what the CuTe pass cannot take (non-bf16, non-SM103, head_dim != 256, misaligned
  rows) instead of falling back; the fp16 / fp8 pool cells and the Triton comparison test go.
- gdn_prefill_conv_post: the Triton conv pass the CuTe pass always replaced; an unmet
  precondition is now an assertion.
- catalog/ssm/gated_delta_rule_decode_pretranspose and its test: no forward path launched it.
  Its fp64 recurrence moved to gdn_decode_gated_norm_pdl._recurrence_reference, and the decode
  tests compare against FlashInfer's kernel directly.
- The decoder runner's first-draft mRoPE refusal and its tests: nothing sets py_is_first_draft
  since NVIDIA#19867.

Reuse:
- The local TRTLLM_ENABLE_PDL gates call flashinfer_utils.get_env_enable_pdl.
- qsa_paged_sparse_gqa_nvfp4 imports the QSA backend's split-K config and PDL policy instead of
  copying them.
- qsa_topk_expand_decode.supports() replaces the width checks restated at its two call sites.
- The CuteDSL FC2 entry uses FC1's unswizzle / dequant reference helpers, and
  gdn_decode_rows_gated_norm's reference delegates to gdn_decode_gated_norm_pdl's.

Less work:
- gdn_decode_gated_norm_pdl and gdn_in_proj_conv1d_pdl compile from the call's operands instead
  of dummies spanning the whole coalesced state pool, a transient of every layer's state for
  every slot during decode graph capture.
- PrefillTarget._gdn_core_generic reads q|k|v as the projection's column view and lets the
  chunked delta rule write `out` directly: two copies fewer per GDN layer on verify and
  bf16-state steps.

Comments no longer cite campaign scratch files.

Signed-off-by: Wanli Jiang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants