]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
CUDA: Add mul_mat_id support for the mmf kernel (llama/15767)
authorAman Gupta <redacted>
Tue, 9 Sep 2025 06:38:02 +0000 (14:38 +0800)
committerGeorgi Gerganov <redacted>
Sat, 20 Sep 2025 10:33:50 +0000 (13:33 +0300)
commit0ac013c9d9d05c7be80570f786fbd445dd95a406
treec1b85e1855a135ffb41f10bd64e8f06b178df2a7
parent827ed2cbb5f820fd47343cf4d9a3721befbf2ac9
CUDA: Add mul_mat_id support for the mmf kernel (llama/15767)

* CUDA: Add mul_mat_id support the mmf

Add support for mul_mat_id for bs < 16

* Review: use warp_size, fix should_use_mmf condition

* Launch one block per expert, stride along n_expert_used

* templatize mul_mat_id

* Pad shmem to 16 bytes, add helper function mul_mat_f_switch_ids

* Reduce compile times by dividing mmf into f16, bf16 and f32 variants

* Divide mmf by ncols_dst

* Add missing files

* Fix MUSA/HIP builds
23 files changed:
src/ggml-cuda/CMakeLists.txt
src/ggml-cuda/ggml-cuda.cu
src/ggml-cuda/mma.cuh
src/ggml-cuda/mmf.cu
src/ggml-cuda/mmf.cuh
src/ggml-cuda/template-instances/generate_cu_files.py
src/ggml-cuda/template-instances/mmf-instance-ncols_1.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_10.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_11.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_12.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_13.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_14.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_15.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_16.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_2.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_3.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_4.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_5.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_6.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_7.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_8.cu [new file with mode: 0644]
src/ggml-cuda/template-instances/mmf-instance-ncols_9.cu [new file with mode: 0644]
tests/test-backend-ops.cpp