feat: add Intel GPU (XPU) support via auto-round-lib dispatch#375
Open
luoyu-intel wants to merge 3 commits into
Open
feat: add Intel GPU (XPU) support via auto-round-lib dispatch#375luoyu-intel wants to merge 3 commits into
luoyu-intel wants to merge 3 commits into
Conversation
- Updated README with installation instructions for Intel GPU (XPU). - Enhanced core.py to include XPU dispatch via auto-round-lib. - Modified setup.py to skip CUDA compilation on XPU. - Introduced bench_xpu.py for benchmarking SageAttention on XPU.
luoyu-intel
marked this pull request as ready for review
July 7, 2026 03:48
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.
Summary
Adds XPU support to SageAttention by detecting Intel GPUs and dispatching
sageattn()andsageattn_varlen()to the ARK kernel backend (auto-round-lib). No CUDA compilation is required on XPU systems. The dispatch is transparent — users callsageattn()as usual and it automatically routes to the correct backend.Changes
3 files, 85 insertions, 10 deletions
auto-round-libsageattention/core.pysageattn(): XPU dispatch with head_dim auto-padding (<64→64, 64-128→128), bool mask → FP32 conversion.sageattn_varlen(): XPU dispatch with head_dim auto-padding. CUDA quant imports guarded withtry/exceptfor XPU-only environments.Design Decisions
auto-round-lib(ARK) as an external dependency, installed viapip install auto-round-lib. No SYCL code is added to this repository.sageattn(q, k, v, ...)works identically on CUDA and XPU. The same parameters are accepted.torch.boolattention masks are auto-converted to FP32 additive masks for ARK compatibility.Test Results
Same as ARK PR above (the fork routes to ARK, so performance is identical). Verified on Intel Arc Pro B60:
Installation (XPU)
Performance (TOPS)
FLOPs = 4 × B × Hq × Sq × Sk × D (non-causal attention) · GPU: Intel Arc Pro B60 (BMG-G21) · FP16, non-causal
BMG theoretical peak: ~197 TOPS (INT8) / ~98 TFLOPS (FP16).