Skip to content

[https://nvbugs/6423991][fix] Qwen3.5-VL MoE DFlash compatibility - #16090

Closed
amukkara wants to merge 1 commit into
NVIDIA:mainfrom
amukkara:qwen35-vl-dflash-fix
Closed

[https://nvbugs/6423991][fix] Qwen3.5-VL MoE DFlash compatibility#16090
amukkara wants to merge 1 commit into
NVIDIA:mainfrom
amukkara:qwen35-vl-dflash-fix

Conversation

@amukkara

@amukkara amukkara commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai summary

Description

DFlash failed to load on Qwen3.5-35B-A3B with AttributeError: 'Qwen3_5MoeVLModel' object has no attribute 'draft_config'.

model loader looks up draft_config/draft_model/load_draft_weights on the top-level VLM wrapper while they live on the inner SpecDecOneEngineForCausalLM. This PR forwards those three attributes from Qwen3VLModelBase wrapper to self.llm. Qwen3.5-VL MoE was added in #14599.

Test Coverage

TestQwen3_5_35B_A3B::test_fp8_moe_dflash

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.

Signed-off-by: Anurag Mukkara <134339030+amukkara@users.noreply.github.com>
@amukkara
amukkara force-pushed the qwen35-vl-dflash-fix branch from f69e03c to 627596b Compare July 7, 2026 22:55
@amukkara
amukkara marked this pull request as ready for review July 7, 2026 22:56
@amukkara
amukkara requested review from a team as code owners July 7, 2026 22:56
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds speculative decoding forwarding to Qwen3VLModelBase by introducing draft_config and draft_model properties and a load_draft_weights method that delegate to the wrapped inner causal LM instance.

Changes

Draft API Forwarding

Layer / File(s) Summary
Forward draft APIs to inner LM
tensorrt_llm/_torch/models/modeling_qwen3vl.py
Adds draft_config and draft_model properties and a load_draft_weights method to Qwen3VLModelBase that delegate to self.llm.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Related Issues: None specified.

Related PRs: None specified.

Suggested labels: None specified.

Suggested reviewers: None specified.

Poem: A rabbit hops through code so neat, forwarding drafts, a tidy feat. Config and model, weights in tow, delegated onward, watch them flow. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the change and follows the required ticket/type format.
Description check ✅ Passed The description includes the issue, solution, test coverage, and checklist, so it matches the template well.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 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.

🧹 Nitpick comments (1)
tensorrt_llm/_torch/models/modeling_qwen3vl.py (1)

1309-1321: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

LGTM — forwarding matches the established pattern.

The forwarding here mirrors load_draft_weights in modeling_mistral.py, correctly resolving the AttributeError on draft_config/draft_model/load_draft_weights described in the PR.

One nit: none of the three new members has a return type annotation, unlike neighboring properties in this class (mm_token_ids, vocab_size_padded).

♻️ Suggested annotation additions
     `@property`
-    def draft_config(self):
+    def draft_config(self) -> Any:
         return getattr(self.llm, "draft_config", None)

     `@property`
-    def draft_model(self):
+    def draft_model(self) -> Any:
         return getattr(self.llm, "draft_model", None)

-    def load_draft_weights(self, *args, **kwargs):
+    def load_draft_weights(self, *args, **kwargs) -> None:
         return self.llm.load_draft_weights(*args, **kwargs)

As per path instructions, "Always annotate functions with return types (use None if no return); annotate class members and variables when necessary, especially for dataclasses and NamedTuple."

🤖 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/models/modeling_qwen3vl.py` around lines 1309 - 1321, The
new forwarding members in Qwen3VLModel are missing explicit return type
annotations, unlike neighboring properties. Add return annotations to
draft_config and draft_model in the Qwen3VL class, and mark load_draft_weights
as returning None while preserving the existing delegation to self.llm. Use the
established pattern from nearby properties like mm_token_ids and
vocab_size_padded to keep the API consistent.

Source: Path instructions

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

Nitpick comments:
In `@tensorrt_llm/_torch/models/modeling_qwen3vl.py`:
- Around line 1309-1321: The new forwarding members in Qwen3VLModel are missing
explicit return type annotations, unlike neighboring properties. Add return
annotations to draft_config and draft_model in the Qwen3VL class, and mark
load_draft_weights as returning None while preserving the existing delegation to
self.llm. Use the established pattern from nearby properties like mm_token_ids
and vocab_size_padded to keep the API consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 34f358cc-cd32-4cec-8302-b9e65f28a509

📥 Commits

Reviewing files that changed from the base of the PR and between 9208094 and 627596b.

📒 Files selected for processing (1)
  • tensorrt_llm/_torch/models/modeling_qwen3vl.py

@moraxu

moraxu commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

The same change will be merged as part of #15249 - feel free to close?

@amukkara

amukkara commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

#15249

sure, I will close this since #15249 is close to merging.

@amukkara amukkara closed this Jul 7, 2026
@amukkara
amukkara deleted the qwen35-vl-dflash-fix branch July 10, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants