Skip to content

Speculative Decoding support for intel_xpu attention backend on XPU target - #30548

Draft
ANSHUMAN87 wants to merge 10 commits into
sgl-project:mainfrom
ANSHUMAN87:jh-spec-intel-xpu-attn
Draft

Speculative Decoding support for intel_xpu attention backend on XPU target#30548
ANSHUMAN87 wants to merge 10 commits into
sgl-project:mainfrom
ANSHUMAN87:jh-spec-intel-xpu-attn

Conversation

@ANSHUMAN87

@ANSHUMAN87 ANSHUMAN87 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This PR enables Speculative Decoding to run with intel_xpu attention backend for XPU targets.

NOTE: Currently only topk=1 is supported.

JH...!


CI States

Latest PR Test (Base): ❌ Run #29554133821
Latest PR Test (Extra): ❌ Run #32336227677
Latest PR Test (AMD ROCm 7.2): ➖ No AMD PR run found for this commit.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@ANSHUMAN87
ANSHUMAN87 force-pushed the jh-spec-intel-xpu-attn branch 3 times, most recently from 12e32ea to 38dbf85 Compare July 15, 2026 06:11
@ANSHUMAN87

Copy link
Copy Markdown
Contributor Author

@mingfeima @Valentine233 please help review. Thanks!

@Valentine233 Valentine233 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.

  1. Why not support topk>1 in this PR? This is essential to all tree-based methods.
  2. Could you provide the SD perf results with intel_xpu attention backend?
  3. Please also modify the hard-coded attention backend in test/registered/spec/eagle/test_spec_eagle_parity.py.

Comment thread test/registered/xpu/test_spec_eagle_intel_xpu.py
Comment thread python/sglang/srt/layers/attention/xpu_backend.py
@ANSHUMAN87

Copy link
Copy Markdown
Contributor Author
  1. Why not support topk>1 in this PR? This is essential to all tree-based methods.
  2. Could you provide the SD perf results with intel_xpu attention backend?
  3. Please also modify the hard-coded attention backend in test/registered/spec/eagle/test_spec_eagle_parity.py.
  1. Topk > 1 leads to unexpected behavior from flash attention with kv cache kernel. Hence I did not add this support yet.
  2. @mingfeima should we add one more test for intel_xpu attention backend in test/registered/spec/eagle/test_spec_eagle_parity.py, currently only triton is present. IMO, we should keep UTs to catch any regressions for both Triton and intel_xpu attention backend. Please share your views.

@ANSHUMAN87
ANSHUMAN87 force-pushed the jh-spec-intel-xpu-attn branch from 5d07314 to bdf55ad Compare July 17, 2026 04:09
@Valentine233

Copy link
Copy Markdown
Contributor

Could you please provide the SD perf results with intel_xpu attention backend?

@ANSHUMAN87

Copy link
Copy Markdown
Contributor Author

Could you please provide the SD perf results with intel_xpu attention backend?

Currently the speedup is only 1.3x . I am checking if it can be improved.

@Valentine233

Copy link
Copy Markdown
Contributor

Could you please provide the SD perf results with intel_xpu attention backend?

Currently the speedup is only 1.3x . I am checking if it can be improved.

What is the detailed config for benchmark? Could you compare the perf of these three: cuda/xpu with triton backend/xpu with intel_xpu backend?

@Valentine233

Copy link
Copy Markdown
Contributor

For topk>1, please validate with the fixing PR: sgl-project/sgl-kernel-xpu#330.

), "XPUAttentionBackend XPU graph only supports decode / target-verify / draft-extend modes"
assert not (
(is_verify or is_draft_decode or is_draft_extend) and self.topk > 1
), "XPUAttentionBackend XPU graph spec decoding supports topk <= 1 only"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so only greedy mode supported?

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.

When topk=1, draft tree becomes draft chain.

@Valentine233

Copy link
Copy Markdown
Contributor

Generally LGTM. As topk>1 needs more time to be supported in sgl-kernel-xpu, I suggest to land this PR firstly. Please make sure all CIs good.

@Valentine233

Copy link
Copy Markdown
Contributor

@ANSHUMAN87 Please try to land this ASAP, thanks!

)
from sglang.test.server_fixtures.spec_eagle_fixture import Eagle3Base, EagleLlama2Base

register_xpu_ci(est_time=480, suite="nightly-xpu-1-gpu", nightly=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is not in the pr test?

@mingfeima mingfeima added intel xpu intel gpu with device `torch.xpu` run-ci labels Aug 20, 2026
@mingfeima

Copy link
Copy Markdown
Collaborator

@ANSHUMAN87 is this one ready?

@ANSHUMAN87

Copy link
Copy Markdown
Contributor Author

@ANSHUMAN87 is this one ready?

@mingfeima yes this PR is ready for review. Except currently topk=1 is supported. topk>1 is facing some hang issue @Valentine233 is working on it. I will raise separate PR for topk>1 support once @Valentine233 is ready with sgl-kernel-xpu changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

intel run-ci speculative-decoding xpu intel gpu with device `torch.xpu`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants