ggml-quantization / build.toml
Marc Sun
add mul_mat_id, and compile upstream's kernels as they ship
9534e0b
Raw History Blame Contribute Delete
1.79 kB
# One backend per `[kernel.*]` section, all implementing the same two entry points declared in
# torch-ext/torch_binding.h. Adding Metal means adding a section and a `gguf_metal/` directory —
# no change to the bindings' schema or to the Python API.
#
# `vendor/` is a pinned subset of llama.cpp (revision in vendor/UPSTREAM); refresh it with
# `python vendor.py --rev <sha>`. It holds upstream's Metal kernels as they ship -- no local copy is
# generated from them.
[general]
name = "ggml-quantization"
version = 1
license = "MIT"
# Metal only for now. The cuda kernel and its build section were dropped rather than kept building
# untested -- `git log -- gguf_cuda` has them, and `vendor/` still carries ggml's cuda sources.
backends = ["metal"]
[general.hub]
repo-id = "marcsun13/ggml-quantization"
[torch]
src = [
"torch-ext/torch_binding.cpp",
"torch-ext/torch_binding.h",
]
[kernel.gguf_metal]
backend = "metal"
depends = ["torch"]
# ggml-metal.metal includes "ggml-common.h" from vendor/src, so the shader compile needs it
# on its include path.
include = ["gguf_metal", "torch-ext", "vendor/src", "vendor/src/ggml-metal", "vendor/src/ggml-metal/kernels"]
src = [
"gguf_metal/gguf_metal.cpp",
"gguf_metal/ggml_dispatch.mm",
"gguf_metal/common.h",
# Upstream's Metal kernels, compiled as they ship: one file per operation, so a package
# lists the ones it dispatches.
"vendor/src/ggml-metal/kernels/mul_mv.metal",
"vendor/src/ggml-metal/kernels/mul_mm.metal",
"vendor/src/ggml-metal/kernels/quantize.metal",
"vendor/src/ggml-metal/kernels/common.h",
"vendor/src/ggml-metal/kernels/dequantize.h",
"vendor/src/ggml-metal/kernels/quantize.h",
"vendor/src/ggml-metal/ggml-metal-impl.h",
"vendor/src/ggml-common.h",
]