# Repository Briefing: vllm-project/vllm-xpu-kernels
> Source: https://repoforai.com/repo/vllm-project/vllm-xpu-kernels (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/vllm-project/vllm-xpu-kernels
- **Category**: LLMs & Inference (大模型与推理微调)
- **Primary Language**: C++
- **License**: Apache-2.0
- **Engineering Health**: A+ (94/100 · Maintenance 35/35 · Adoption 19/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.1.18 (2026-11-30) — https://github.com/vllm-project/vllm-xpu-kernels/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, GPU
- **Momentum**: 88 ★ total (+0 24h / +2 7d) · 138 forks
- **When to Use**: Best for: Teams self-hosting vLLM on Intel GPUs that can pin the runtime stack and validate kernel coverage for their target models. Skip if: You need a standalone server, deploy only on NVIDIA GPUs, or cannot maintain a compatible PyTorch XPU and Intel runtime stack.

## Overview
```text
### Architecture & Core Mechanics
vllm-xpu-kernels is the Intel GPU operator layer for vLLM, not a serving engine. vLLM imports `vllm_xpu_kernels._C` at startup, registering custom operators with the PyTorch dispatcher. PyTorch then selects their XPU implementations when vLLM executes those operators on Intel GPUs. The integration point is the operator call, not a separate process or API.

Native sources sit under `csrc/`. The kernels are written in SYCL/DPC++ and use oneDNN primitives. Setuptools packages the extension as a Python wheel, while CMake and Ninja support the native build. The build manifest pins `torch==2.15.0+xpu`; the wheel, PyTorch build, and Intel GPU runtime should be treated as a compatibility set.

### Key Capabilities & Differentiators
The kernel set covers RMS norm, fused add-RMS norm, layer norm, gated activations, variable-length Flash Attention, GDN attention, and Xe2 attention variants. Paged KV-cache support includes `_C_cache_ops.cp_gather_cache`, a page-wise context-parallel gather operator with token-level sequence offsets and aligned 16-byte copies.

Beyond attention, the extension provides NeoX and GPT-J rotary layouts, DeepSeek-scaled RoPE, LoRA operators, fused grouped TopK routing, expert remapping, grouped GEMM, and FP8/MxFP4 quantization and GEMM. Default builds target common configurations for Llama, Qwen, and DeepSeek. The two prefill and paged-decode build settings let teams customize that coverage; they are not a guarantee that every model variant, precision, and GPU generation combination is available.

### Trade-offs & Limitations
This extension makes sense when Intel GPUs are the deployment target and vLLM is the serving layer you want to keep. NVIDIA deployments should use vLLM's CUDA path instead. CUDA-aligned behavior in the cache gather operator helps align semantics across backends; it does not make binaries portable or establish performance parity. The extension does not replace vLLM's server or scheduler.

Wheels avoid a local native build, but not the need to align the wheel, PyTorch XPU build, and Intel runtime. Custom prefill and decode presets give teams control over kernel coverage at the cost of another build and validation matrix. Per-kernel scripts under `benchmark/` can isolate regressions; use representative model traffic to judge throughput, latency, and memory headroom. Apache-2.0 permits commercial use, with separate license checks for dependencies and model weights.

### Hardware & Deployment Guide
Install vLLM for XPU first if the goal is serving: it pulls in the kernel wheel automatically. To manage the extension separately, use a PyPI or release-hosted wheel that matches the PyTorch XPU and Intel runtime stack. The source-build baseline is Python 3.12, `torch==2.15.0+xpu` from the PyTorch XPU index, Intel OMIX 0.4 with oneAPI 2026.1 DPC++, CMake ≥ 3.26, and Ninja.

For development, build with `Dockerfile.xpu` and pass the host GPU through with `--device=/dev/dri`, or install `intel-omix-dev` on bare metal and source `/opt/intel/oneapi/setvars.sh` before building. Run `pytest tests/` before load-testing the target model. v0.1.18 expands Xe3P attention coverage and adds GDN prefill checkpoints and virtual memory management for growable device buffers. It also moves MoE weight and scale prepacking out of the constructor: call `prepack_weights()` after loading weights.
```

## Key Capabilities
```text
- Dispatch: Importing `vllm_xpu_kernels._C` registers native XPU operators with PyTorch.
- Native stack: SYCL/DPC++ kernels use oneDNN primitives; the build manifest pins `torch==2.15.0+xpu`.
- KV cache: `_C_cache_ops.cp_gather_cache` uses token-level sequence offsets and aligned 16-byte copies for page-wise context-parallel gather.
- MoE and precision: Softmax and sigmoid TopK routing, fused grouped TopK, grouped GEMM, and FP8/MxFP4 quantization and GEMM.
- Build coverage: Separate `VLLM_CHUNK_PREFILL_CONFIG` and `VLLM_PAGED_DECODE_CONFIG` settings control which kernels are compiled.
- Upgrade compatibility: From v0.1.18, `XpuFusedMoe` callers must invoke `prepack_weights()` after loading weights.
```

## Quick Start / Clone
```bash
pip install --upgrade vllm-xpu-kernels
```
