Repository navigation
[Fix] [XPU] baichuan: Apply ALiBi slopes on intel_xpu - #45999
Open
desmond-intel wants to merge 1 commit into
Open
desmond-intel wants to merge 1 commit into
desmond-intel wants to merge 1 commit into
Conversation
desmond-intel
requested review from
Fridge003,
HaiShaw,
Qiaolin-Yu,
hebiao064,
ispobock and
merrymercy
as code owners
October 23, 2026 06:36
Baichuan-13B / Baichuan2-13B use ALiBi and skip RoPE, but the slopes were passed to attention only on NPU, so on XPU the model ran with no position information and degenerated. Pass them on XPU too (fp32), and have the XPU attention backend forward them as alibi_slopes to flash_attn_with_kvcache, next to sinks. Needs sgl-project/sgl-kernel-xpu#573. Verified on intel_xpu tp2 (Arc Pro B60), Baichuan2-13B-Chat gsm8k 5-shot: 0.00 -> 0.52 on 50 docs; full 1319 flexible-extract 0.5474, strict-match 0.5459.
This branch has not been deployed
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.
Motivation
Baichuan2-13B / Baichuan-13B use ALiBi and skip RoPE.
baichuan.pypasses the ALiBi slopes to attention only on NPU, so on XPU the model runs with no position information and degenerates (0 0 0 ...). Baichuan2-13B-Chat gsm8k is 0.00 on B60 (vLLM RTX 6000 Blackwell: 53.5).Modifications
models/baichuan.py: passslopeson XPU too, as fp32.layers/attention/xpu_backend.py:forward_extend/forward_decodeacceptslopesand forward it asalibi_slopestoflash_attn_with_kvcache, next to the existingsinkskwarg.Other models and backends are unchanged. On XPU with
--attention-backend triton, Baichuan-13B now raises at the first forward (triton takes noslopes) instead of running without position information.Depends on sgl-project/sgl-kernel-xpu#573 (
alibi_slopesin the FMHA kernels) and the sgl-kernel-xpu pin bump that follows it.Accuracy Tests
Baichuan2-13B-Chat, tp2,
--attention-backend intel_xpu, gsm8k 5-shot, B60:Reference: vLLM RTX 6000 Blackwell 53.5, paper 56.8 (4-shot).
Speed Tests and Profiling
No speed impact on other models; the slopes are only passed for ALiBi Baichuan on XPU.
Checklist
test_alibi_attention, and the model-level change is covered by the accuracy run above.CI States
Latest PR Test (Base): ❌ Run #39912544389
Latest PR Test (Extra): ❌ Run #39912544313
Latest PR Test (AMD ROCm 10): ❌ Run #39912544319