[https://nvbugs/6423991][fix] Qwen3.5-VL MoE DFlash compatibility - #16090
[https://nvbugs/6423991][fix] Qwen3.5-VL MoE DFlash compatibility#16090amukkara wants to merge 1 commit into
Conversation
Signed-off-by: Anurag Mukkara <134339030+amukkara@users.noreply.github.com>
f69e03c to
627596b
Compare
📝 WalkthroughWalkthroughAdds 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. ChangesDraft API Forwarding
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)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tensorrt_llm/_torch/models/modeling_qwen3vl.py (1)
1309-1321: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueLGTM — forwarding matches the established pattern.
The forwarding here mirrors
load_draft_weightsinmodeling_mistral.py, correctly resolving theAttributeErrorondraft_config/draft_model/load_draft_weightsdescribed 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
Noneif 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
📒 Files selected for processing (1)
tensorrt_llm/_torch/models/modeling_qwen3vl.py
|
The same change will be merged as part of #15249 - feel free to close? |
@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_weightson the top-level VLM wrapper while they live on the innerSpecDecOneEngineForCausalLM. 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-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin 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.