Skip to content

ggml : riscv: add xtheadvector support #13720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xctan
Copy link
Contributor

@xctan xctan commented May 23, 2025

This PR builds upon #12530 to introduce k-quant support for the older RVV v0.7.1 implementation (xtheadvector).

Additionally, it updates zfh extension detection to use the built-in compiler macro, eliminating the need for an extra definition.

Evaluation

Build instruction

mkdir build
cd build
cmake .. -DGGML_RVV=1 -DGGML_XTHEADVECTOR=1 -DGGML_RV_ZFH=0
make -j$(nproc)

Verification

Test model: gemma-3-4b-it-GGUF, Q4_K_M quantization. The results of llama-perplexity are:

#12530 (rvv 1.0) this PR (xtheadvector)
16.7120 +/- 0.16651 16.7120 +/- 0.16651

Performance

Using the same model as above on SG2042.

model size params backend threads test t/s note
gemma3 4B Q4_K - Medium 2.31 GiB 3.88 B CPU 32 pp512 15.73 ± 0.14 xtheadvector
gemma3 4B Q4_K - Medium 2.31 GiB 3.88 B CPU 32 pp512 3.35 ± 0.00 scalar
gemma3 4B Q4_K - Medium 2.31 GiB 3.88 B CPU 32 tg128 5.15 ± 0.00 xtheadvector
gemma3 4B Q4_K - Medium 2.31 GiB 3.88 B CPU 32 tg128 2.44 ± 0.00 scalar

@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ggml changes relating to the ggml tensor library for machine learning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant