Open
Conversation
Signed-off-by: mayuyuace <qiming1.zhang@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for an alternate QKVZ/BA input layout (Qwen 3.5) to the XPU GDN attention path by threading a reorder_input flag through the Torch op binding, C++ interface, and SYCL kernels, and updating the unit test to validate both layouts.
Changes:
- Extend
gdn_attentionTorch op signature + C++ interface to acceptreorder_input. - Update causal-conv1d (native + XE2 chunk) kernels to interpret inputs in either legacy (Qwen Next) or reordered (Qwen 3.5) layout.
- Expand the GDN attention unit test to run with
reorder_input=True/Falseand reorder the reference inputs accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/gdn_attn/test_gdn_attn.py |
Adds reorder_input parametrization and reference-side input reshaping to validate both layouts. |
csrc/xpu/torch_bindings.cpp |
Updates the Torch library schema for gdn_attention to include reorder_input. |
csrc/xpu/ops.h |
Extends the C++ op declaration with the reorder_input flag. |
csrc/xpu/gdn_attn/gdn_attn_interface.cpp |
Wires reorder_input through to causal-conv1d (native + XE2) launch paths. |
csrc/xpu/gdn_attn/causal_conv1d.hpp |
Adds compile-time specialization for reordered layout and dispatch based on reorder_input. |
csrc/xpu/gdn_attn/xe_2/chunk_causal_conv1d_xe2.hpp |
Adds reordered-layout specialization and runtime dispatch to the XE2 chunk kernels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: mayuyuace <qiming1.zhang@intel.com>
d3656d2 to
1ef51cc
Compare
Signed-off-by: mayuyuace <qiming1.zhang@intel.com>
abd8797 to
fa04083
Compare
jikunshang
reviewed
Mar 12, 2026
| ref_ssm_state[state_id], | ||
| atol=atol, | ||
| rtol=rtol) | ||
| if num_actual_tokens != 8192: |
Collaborator
There was a problem hiding this comment.
add below at the test case entry?
if num_actual_tokens == 8192:
pytest.skip("FIXME, skip because of random error")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qwen3 Next and Qwen 3.5 have different inputs layouts, modify the kernel to support qwen 3.5.
The UT also is updated.
vllm-xpu PR:
https://github.com/intel-innersource/applications.ai.gpu.vllm-xpu/pull/161
bash run-lm-eval-gsm-vllm-baseline.sh -m Qwen/Qwen3.5-9B,dtype=bfloat16 -b 20 -l 250 -f 5 -t 2
triton gdn:

sycl gdn:
