Skip to content

bugfix: propagate is_hybrid_linear_attention for Qwen3.5 VLM graph capture#1844

Open
maojunx99 wants to merge 1 commit into
jd-opensource:mainfrom
maojunx99:main
Open

bugfix: propagate is_hybrid_linear_attention for Qwen3.5 VLM graph capture#1844
maojunx99 wants to merge 1 commit into
jd-opensource:mainfrom
maojunx99:main

Conversation

@maojunx99

Copy link
Copy Markdown
Contributor

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

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor
  • Documentation
  • Test
  • Build or CI

Pull Request Checklist

Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.

Build and Test Coverage

  • Tests have been added or updated as needed.
  • CUDA: python setup.py build test has passed on a CUDA machine.
  • NPU: python setup.py build test has passed on an NPU machine.
  • MLU: python setup.py build test has passed on an MLU machine.

@gemini-code-assist gemini-code-assist 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.

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.

Comment on lines +210 to +216
bool is_hybrid_linear_attention() {
if constexpr (detail::has_is_hybrid_linear_attention<
LanguageModel>::value) {
return language_model_->is_hybrid_linear_attention();
}
return false;
}

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.

high

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.

Suggested change
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;
}

@maojunx99

Copy link
Copy Markdown
Contributor Author
image

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.

1 participant