Skip to content

[Quantization][XPU] Enable int8_w8a8 MoE on the Triton backend for XPU - #53162

Merged
jikunshang merged 6 commits into
vllm-project:mainfrom
afierka-intel:afierka/triton-int8-w8a8-xpu
Sep 18, 2026
Merged

jikunshang merged 6 commits into
vllm-project:mainfrom
afierka-intel:afierka/triton-int8-w8a8-xpu

Conversation

@afierka-intel

@afierka-intel afierka-intel commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #52712 (withdrawn before review; the branch was rebased since, so GitHub would not reopen it).

Bug

int8_w8a8 MoE is unsupported on XPU by omission. TritonExperts._supports_quant_scheme gates every int8 scheme on (is_cuda() and capability >= (7,5)) or is_rocm(), so CUDA and ROCm get both dynamic-activation schemes and XPU gets neither — even though the kernel, the launcher and TritonExperts._supports_current_device() are all already XPU-capable, and oracle/int8.py has no platform branch at all ([TRITON, HUMMING, CPU] everywhere).

Fix

Add or current_platform.is_xpu() to that gate, so XPU declares the same two schemes CUDA and ROCm do. Both activation paths work there: per-token uses the Triton per_token_quant_int8; per-tensor resolves to the XPU branch of ops.scaled_int8_quant (_custom_ops.py, added by #47205), which is plain elementwise arithmetic — what XPU actually lacks is torch.ops._C.static_scaled_int8_quant / dynamic_scaled_int8_quant, which that wrapper doesn't call. A test pins the XPU branch so it cannot be removed silently.

Reproduce

vllm serve soyrsoyr/deepseek-moe-16b-chat-W8A8-GPTQ \
  --quantization compressed-tensors --moe-backend triton --enforce-eager --trust-remote-code

On main, Intel Arc Pro B70: ValueError: Int8 MoE backend TRITON does not support the deployment configuration since kernel does not support quantization scheme QuantKey(i8, scale(f32, static, per_channel), ...).

Config fetched 2026-08-20: weights {num_bits: 8, strategy: channel, group_size: null}, activations {num_bits: 8, strategy: token, dynamic: true}, ignore: ["lm_head"] only — all 64 routed experts carry the scheme. --trust-remote-code is needed for the repo's auto_map; its two remote files are byte-identical (SHA-256) to deepseek-ai/deepseek-moe-16b-chat.

Test

pytest tests/quantization/test_int8_moe_oracle.py — controlled A/B on one tree, only the production diff applied:

platform cap unpatched patched
Intel Arc Pro B70 — 4 skipped 3 passed, 2 skipped
NVIDIA H200 sm90 4 passed 4 passed, 1 skipped
NVIDIA B200 sm100 4 passed 4 passed, 1 skipped

No pre-existing test changes state on either CUDA generation. The B70 row now covers both schemes; the remaining skip is the XPU-only scaled_int8_quant pin, which skips off XPU.

Runtime, B70: engine starts, Using TRITON Int8 MoE backend out of potential backends: ['TRITON', 'HUMMING', 'CPU'], "What is 15 plus 27?" → "15 plus 27 is 42.", and a spy on triton_moe.invoke_fused_moe_triton_kernel counts 918/918 launches with use_int8_w8a8=True.

lm_eval==0.4.12 gsm8k 5-shot, 1319 questions, seed 42, per-token scheme:

flexible-extract strict-match
B70, patched 0.2085 ± 0.0112 0.0000
L40S, stock unpatched v0.27.0 0.2123 ± 0.0113 0.0000

The CUDA row is a control, not an A/B — no A/B is possible on XPU because main cannot start this config. It shows the low score and the zero strict-match come from the checkpoint (its tokenizer emits raw BPE markers, breaking the #### N format), not from XPU.

pre-commit green including mypy-3.10; ruff 0.14.0 clean.

Gaps

  • No perf number.
  • The per-tensor scheme has no model-level run: measured numerically sane on B70 through fused_experts_impl (max rel err 0.0265 against a bf16-dequant reference, versus 0.0175 for per-token), but no published MoE checkpoint uses weights.strategy: tensor — of 115 compressed-tensors / W8A8 MoE candidates on the Hub, 32 are strategy: channel and none is strategy: tensor. It is enabled for parity with CUDA/ROCm rather than for a checkpoint I can point at.
  • The B70 runs used a build 171 commits behind the branch parent.

Duplicate check

No open PR touches TritonExperts._supports_quant_scheme. Nearest related work is #45776, which makes the same widening for XPU FP8 in XPUExpertsFp8._supports_quant_scheme; #51515 touches TritonWNA16Experts.apply, no overlap. Re-checked 2026-09-07 against origin/main at 58ad1f3b: still no competing PR, diff still applies with no drift, _supports_current_device()/oracle/int8.py unchanged.


AI assistance was used (Claude Code); every changed line reviewed, all numbers produced on Intel Arc Pro B70, NVIDIA H200, NVIDIA B200 and NVIDIA L40S on 2026-08-20/21.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify mergify Bot added the intel-gpu Related to Intel GPU label Aug 20, 2026
@afierka-intel afierka-intel changed the title [Kernel][XPU] Enable int8_w8a8 per-token MoE on the Triton backend for XPU [Quantization][XPU] Enable int8_w8a8 per-token MoE on the Triton backend for XPU Aug 20, 2026
@mergify mergify Bot added the quantization label Aug 20, 2026
@afierka-intel
afierka-intel force-pushed the afierka/triton-int8-w8a8-xpu branch 2 times, most recently from c774080 to 3d996a7 Compare August 24, 2026 06:32
…r XPU

`TritonExperts._supports_quant_scheme` gated every int8_w8a8 scheme on
`(is_cuda() and cap >= 7.5) or is_rocm()`, so XPU was excluded by omission even
though it reaches the same `fused_moe_kernel`: `TritonExperts` already reports
`_supports_current_device()` true for XPU, and `oracle/int8.py`'s priority list
has no platform branch at all. The int8 dequant path in the kernel is plain
Triton (`tl.load` of the scales, then `tl.dot`), so nothing in it is CUDA-specific.

Only the per-token scheme is enabled. Its activation quantization is a Triton
kernel (`per_token_quant_int8`), whereas the per-tensor schemes go through
`ops.scaled_int8_quant`, a custom op with no XPU implementation -- enabling those
would fail later, in the prepare step, so the oracle should keep refusing them.

Validated on Intel Arc Pro B70 (triton-xpu 3.7.2):
- before: both int8 pairs raise (`auto` -> NotImplementedError,
  `--moe-backend triton` -> ValueError)
- after:  per-token selects TRITON/TritonExperts; per-tensor still refused
- numerics: 2/2 kernel launches with `use_int8_w8a8=True`, max relative error
  1.6e-2 vs a dequantized bf16 reference, no NaN/Inf -- i.e. Triton-XPU int8
  `tl.dot` is correct, which was the open question behind the original gate
- `tests/quantization/test_int8_moe_oracle.py`: 2 passed / 4 skipped on XPU

No CUDA regression: same file on an H200 goes 4 passed -> 5 passed (the extra
one is the new cross-device test), with the XPU-specific case skipped.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Artur Fierka <artur.fierka@intel.com>
@afierka-intel
afierka-intel force-pushed the afierka/triton-int8-w8a8-xpu branch from 3d996a7 to 31452a6 Compare August 24, 2026 06:45
@afierka-intel afierka-intel changed the title [Quantization][XPU] Enable int8_w8a8 per-token MoE on the Triton backend for XPU [Quantization][XPU] Enable int8_w8a8 MoE on the Triton backend for XPU Aug 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 4470b7eb-7648-44c0-9e81-26f2a68941b7

📥 Commits

Reviewing files that changed from the base of the PR and between 5e6f6a8 and c583d1e.

📒 Files selected for processing (2)
  • tests/quantization/test_int8_moe_oracle.py
  • vllm/model_executor/layers/fused_moe/experts/triton_moe.py

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features

    • Added Intel XPU support for INT8 Mixture-of-Experts quantization.
    • Enabled both per-token and per-tensor INT8 activation quantization paths on XPU.
  • Tests

    • Added XPU coverage for INT8 MoE support.
    • Added validation for scaled INT8 quantization on XPU.

Walkthrough

The change enables Intel XPU for Triton INT8 MoE quantization. The oracle tests now select the active device, include XPU in support checks, identify parameterized schemes, and validate XPU scaled INT8 quantization.

Changes

XPU INT8 MoE support

Layer / File(s) Summary
Enable XPU INT8 scheme support
vllm/model_executor/layers/fused_moe/experts/triton_moe.py
TritonExperts now treats XPU as an INT8-capable platform for dynamic activation quantization.
Extend INT8 MoE oracle coverage
tests/quantization/test_int8_moe_oracle.py
The oracle uses the active device, includes XPU in its support gate, adds parameter IDs, and validates ops.scaled_int8_quant on XPU.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to c583d

This enables XPU INT8 Triton MoE support and updates its oracle coverage without an identified correctness, runtime, or compatibility issue.

Suggested reviewers: bnellnm

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: enabling int8_w8a8 MoE support on the Triton backend for XPU.
Description check ✅ Passed The description directly explains the XPU support gap, the code change, test coverage, validation results, and known gaps.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jikunshang

Copy link
Copy Markdown
Member

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #89488 for commit 23ab36ba27da.

@afierka-intel

Copy link
Copy Markdown
Contributor Author

/ci retry

@github-actions

Copy link
Copy Markdown

✅ Queued 1 failed job(s) for retry in Buildkite CI #89488.

@afierka-intel

Copy link
Copy Markdown
Contributor Author

@jikunshang CI is green now and ready for merge. Thanks!

@jikunshang
jikunshang merged commit 1cdf168 into vllm-project:main Sep 18, 2026
157 checks passed
michael-gpu pushed a commit to practical-inference/vllm-ampere-extended that referenced this pull request Oct 20, 2026
vllm-project#53162)

Signed-off-by: Artur Fierka <artur.fierka@intel.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

intel-gpu Related to Intel GPU quantization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants