Skip to content

ggml-cpu: extend RVV quantization vec dot to higher VLENs#10

Open
taimur-10x wants to merge 61 commits intomasterfrom
10x/riscv-quant-vec-dot-vlens
Open

ggml-cpu: extend RVV quantization vec dot to higher VLENs#10
taimur-10x wants to merge 61 commits intomasterfrom
10x/riscv-quant-vec-dot-vlens

Conversation

@taimur-10x
Copy link
Copy Markdown
Collaborator

@taimur-10x taimur-10x commented Feb 13, 2026

Summary

This PR adds RVV implementations for quantized vector dot kernels (for VLENs 512-bit and 1024-bit).

Key Changes

  • Added the following RVV kernels:
Kernel VLEN
ggml_vec_dot_q3_K_q8_K 512, 1024
ggml_vec_dot_q6_K_q8_K 512, 1024
ggml_vec_dot_iq1_s_q8_K 512, 1024
ggml_vec_dot_iq1_m_q8_K 512, 1024
ggml_vec_dot_iq2_s_q8_K 512, 1024 and above
ggml_vec_dot_iq2_xs_q8_K 512 and above
ggml_vec_dot_iq2_xxs_q8_K 512 and above
ggml_vec_dot_iq3_s_q8_K 512 and above
ggml_vec_dot_iq3_xxs_q8_K 512, 1024 and above
ggml_vec_dot_iq4_xs_q8_K 512, 1024
ggml_vec_dot_tq1_0_q8_K 512 and above
  • Each kernel that is VLEN-dependent has its own separate function call now, for example ggml_vec_dot_tq1_0_q8_K_vl512.

Testing

Kernels were functionally tested through test-quantize-fns for VLENs 512-bit and 1024-bit with QEMU, using test-quantize-fns.

@taimur-10x taimur-10x marked this pull request as draft February 13, 2026 15:52
@github-actions github-actions Bot added the ggml label Feb 13, 2026
@taimur-10x taimur-10x changed the base branch from master to 10x/riscv-quant-vec-dot-128b March 4, 2026 11:48
@taimur-10x taimur-10x force-pushed the 10x/riscv-quant-vec-dot-vlens branch from 86ffc7e to bd69a20 Compare March 4, 2026 17:10
@taimur-10x taimur-10x marked this pull request as ready for review March 4, 2026 17:11
@rehan-10xengineer rehan-10xengineer force-pushed the 10x/riscv-quant-vec-dot-128b branch 2 times, most recently from f83ddf7 to c7c6abc Compare March 16, 2026 10:55
@taimur-10x taimur-10x force-pushed the 10x/riscv-quant-vec-dot-128b branch 3 times, most recently from cf95828 to 05a5425 Compare March 18, 2026 12:47
@rehan-10xengineer rehan-10xengineer force-pushed the 10x/riscv-quant-vec-dot-128b branch from 05a5425 to 80c0ac3 Compare April 14, 2026 11:37
@taimur-10x taimur-10x changed the base branch from 10x/riscv-quant-vec-dot-128b to master April 24, 2026 12:14
@taimur-10x taimur-10x force-pushed the 10x/riscv-quant-vec-dot-vlens branch from bd69a20 to aa171a2 Compare April 24, 2026 14:54
reeselevine and others added 11 commits April 29, 2026 10:59
* Fix flashattention support check for devices that don't support subgroups

* set path to none if kv_tile doesn't fit
…2317)

* ggml-cpu: cmake: append xsmtvdotii march for SpacemiT IME

When GGML_CPU_RISCV64_SPACEMIT=ON is set, ime1_kernels.cpp contains
inline asm for the vmadot family which requires the xsmtvdotii custom
extension.(problem can see in some blogs and make sure in K3 platform)
The current CMakeLists does not include xsmtvdotii, so any toolchain
that honours the explicit -march (tested with SpacemiT GCC 15.2) fails
at the assembler stage:

  Error: unrecognized opcode `vmadot v16,v14,v0',
         extension `xsmtvdotii' required

Append _xsmtvdotii to MARCH_STR when GGML_CPU_RISCV64_SPACEMIT is
enabled so the IME path can actually build with a capable toolchain.
No effect on builds that leave GGML_CPU_RISCV64_SPACEMIT off.

toolchain from https://www.spacemit.com/community/resources-download/Tools

* Update ggml/src/ggml-cpu/CMakeLists.txt

Co-authored-by: alex-spacemit <jinghui.huang@spacemit.com>

---------

Co-authored-by: alex-spacemit <jinghui.huang@spacemit.com>
* ggml-cuda: refactor fusion code

* apply formatting + make env variable truthy
…gml-org#22293)

* ggml-cpu : disable tiled matmul on AIX to fix page boundary segfault

vec_xst operations in the tiled path crash on AIX when writing
near 4KB page boundaries due to strict memory protection. Fall
back to mnpack implementation on AIX for stable execution.

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>

* Update ggml/src/ggml-cpu/llamafile/sgemm.cpp

Co-authored-by: Aaron Teo <taronaeo@gmail.com>

* Update sgemm.cpp

* Update sgemm.cpp

---------

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
Co-authored-by: Aaron Teo <taronaeo@gmail.com>
* webui: instant mic stop, race-free recorder restart

* webui: faster WAV PCM encode via hoisted channels and Int16Array

* chore: update webui build output

* webui: drop setTimeout(0) hack and harden cancelRecording

* chore: update webui build output
Co-authored-by: Rehan Qasim <rehan.qasim@10xengineers.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.