Skip to content

[Fix] [XPU] baichuan: Apply ALiBi slopes on intel_xpu - #45999

Open
desmond-intel wants to merge 1 commit into
sgl-project:mainfrom
desmond-intel:xpu/baichuan-alibi
Open

desmond-intel wants to merge 1 commit into
sgl-project:mainfrom
desmond-intel:xpu/baichuan-alibi

Conversation

@desmond-intel

@desmond-intel desmond-intel commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Baichuan2-13B / Baichuan-13B use ALiBi and skip RoPE. baichuan.py passes 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: pass slopes on XPU too, as fp32.
  • layers/attention/xpu_backend.py: forward_extend / forward_decode accept slopes and forward it as alibi_slopes to flash_attn_with_kvcache, next to the existing sinks kwarg.

Other models and backends are unchanged. On XPU with --attention-backend triton, Baichuan-13B now raises at the first forward (triton takes no slopes) instead of running without position information.

Depends on sgl-project/sgl-kernel-xpu#573 (alibi_slopes in 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:

docs flexible strict
main 50 0.00 0.00
this PR 50 0.52 0.52
this PR 1319 0.5474 0.5459

Reference: vLLM RTX 6000 Blackwell 53.5, paper 56.8 (4-shot).

python -m sglang.launch_server --model-path baichuan-inc/Baichuan2-13B-Chat --trust-remote-code \
  --attention-backend intel_xpu --tp-size 2

Speed Tests and Profiling

No speed impact on other models; the slopes are only passed for ALiBi Baichuan on XPU.

Checklist


CI States

Latest PR Test (Base): ❌ Run #39912544389
Latest PR Test (Extra): ❌ Run #39912544313
Latest PR Test (AMD ROCm 10): ❌ Run #39912544319

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

No deployments
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