[CPU][RISC-V] Enable oneDNN W8A8 INT8 to run on RISC-V#44478
Merged
Conversation
Signed-off-by: velonica0 <like@mail.nankai.edu.cn>
bigPYJ1151
approved these changes
Jun 9, 2026
wcynb1023
pushed a commit
to wcynb1023/vllm
that referenced
this pull request
Jun 11, 2026
…44478) Signed-off-by: velonica0 <like@mail.nankai.edu.cn>
Saddss
pushed a commit
to Saddss/vllm
that referenced
this pull request
Jun 14, 2026
…44478) Signed-off-by: velonica0 <like@mail.nankai.edu.cn>
vivek8123
pushed a commit
to odh-on-pz/vllm-upstream
that referenced
this pull request
Jun 18, 2026
…44478) Signed-off-by: velonica0 <like@mail.nankai.edu.cn>
divineearthly
pushed a commit
to divineearthly/vllm
that referenced
this pull request
Jun 19, 2026
…44478) Signed-off-by: velonica0 <like@mail.nankai.edu.cn> Signed-off-by: divineearthly <divineearthly@gmail.com>
tunglinwood
pushed a commit
to tunglinwood/vllm
that referenced
this pull request
Jun 22, 2026
…44478) Signed-off-by: velonica0 <like@mail.nankai.edu.cn>
nkzhenhua
pushed a commit
to nkzhenhua/vllm
that referenced
this pull request
Jun 24, 2026
…44478) Signed-off-by: velonica0 <like@mail.nankai.edu.cn>
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.
Purpose
Problem
vLLM's CPU W8A8 dispatcher (vllm/model_executor/kernels/linear/scaled_mm/cpu.py:40-55) has two branches: an x86-only SGL fast path, and an oneDNN path for everyone else.
On RISC-V the else is unconditional. But oneDNN itself isn't compiled in on RISC-V: cmake/cpu_extension.cmake doesn't gate it on, and csrc/cpu/torch_bindings.cpp doesn't register the ops behind __riscv_v. Result: loading any compressed-tensors W8A8 model on RISC-V crashes immediately
What does
Make the existing oneDNN dispatcher reachable on RISC-V. Four minimum-necessary changes, each on the dependency chain from "user loads a W8A8 model" down to "GEMM kernel exists"
Test Plan
dnnl_kernels.cppand registers the ops on a RISC-V target.Test Result
Hardware: Spacemit X100 (RISC-V, RVA23 + RVV 1.0, VLEN=256), 16 cores (SoC: K3 / BananaPi BPI-F3 class).
Software: GCC 15.2, PyTorch 2.12.0a0+git0d62256 (RISC-V build), oneDNN v3.10 fetched by cmake.
dnnl_kernels.cppcompiles, ops registertorch.ops._Ctest_onednn_gemm(3a)test_onednn_int8_scaled_gemm(3b)vllm bench latency(4)Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.