bugfix: propagate is_hybrid_linear_attention for Qwen3.5 VLM graph capture#1844
bugfix: propagate is_hybrid_linear_attention for Qwen3.5 VLM graph capture#1844maojunx99 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds the is_hybrid_linear_attention method to the Qwen3VLForConditionalGenerationBase class to check if the underlying language model uses hybrid linear attention. The reviewer suggested marking this new method as const to ensure const-correctness, as it is a read-only query.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| bool is_hybrid_linear_attention() { | ||
| if constexpr (detail::has_is_hybrid_linear_attention< | ||
| LanguageModel>::value) { | ||
| return language_model_->is_hybrid_linear_attention(); | ||
| } | ||
| return false; | ||
| } |
There was a problem hiding this comment.
The is_hybrid_linear_attention method is a read-only query that does not modify the state of the model. It should be marked const to ensure const-correctness and allow it to be called on const instances of Qwen3VLForConditionalGenerationBase.
| bool is_hybrid_linear_attention() { | |
| if constexpr (detail::has_is_hybrid_linear_attention< | |
| LanguageModel>::value) { | |
| return language_model_->is_hybrid_linear_attention(); | |
| } | |
| return false; | |
| } | |
| bool is_hybrid_linear_attention() const { | |
| if constexpr (detail::has_is_hybrid_linear_attention< | |
| LanguageModel>::value) { | |
| return language_model_->is_hybrid_linear_attention(); | |
| } | |
| return false; | |
| } |

Description
Qwen3VLForConditionalGenerationBase was missing is_hybrid_linear_attention(), this made AclGraphExecutorImpl skip all Qwen3.5 hybrid-specific graph capture initialization (graph_task_context_, qwen3.5 query_start_loc handling, attention mask) when running with --backend=vlm, crashing in npu_fused_sigmoid_gating_delta_rule_update with: "initial_state_indices size must equal cu_seqlens size - 1"
Change Type
Pull Request Checklist
Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.
Build and Test Coverage
python setup.py build testhas passed on a CUDA machine.python setup.py build testhas passed on an NPU machine.python setup.py build testhas passed on an MLU machine.