llama.cpp
27530a04 - llama_moe_cache : run the MoE cache kernels through a CUDA kernel op

Commit
21 days ago
llama_moe_cache : run the MoE cache kernels through a CUDA kernel op - ggml-cuda: a GGML_OP_CUSTOM node can run a kernel of the user, see ggml_cuda_kernel in ggml-cuda.h. The backend loads the PTX module with the driver API and launches the kernel, on a side stream until a join if asked - ggml-cuda: ggml_backend_cuda_mul_mat_id_skip_max_batch gives the most tokens for which MUL_MAT_ID skips negative ids - the kernels of the MoE cache move from ggml-cuda to src/llama-moe-cpu-misses.cu, nvcc compiles them to PTX and libllama embeds it (llama_embed_ptx, scripts/xxd.cmake) - src/llama-moe-cpu-misses.h is shared by the kernels and llama-moe-cache.cpp, ggml has no copy of it and there is no version to match - the copy and the bookkeeping of a publish are nodes of their own, with two passes they run on side streams and the join node waits for them - the host experts are device readable when they are in the host buffer type of the device, the requests use a buffer of this type - tests: test-cuda-kernel-op runs kernels with a parameter struct, dynamic shared memory, pinned host memory and side streams, also without CUDA graphs and with a graph cut at each node
Author
Parents
Loading