diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-03 00:30:12 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-14 08:27:03 +0200 |
| commit | 9d69c13793c4c69c080ed4273bcd36ded69de2bb (patch) | |
| tree | 0797e83999613a327579d60dcf2b422bb7978d60 /pplx_embed_mlx.h | |
| parent | 8d412f8a225f3e337dac271ea2491ac3c1c099af (diff) | |
| download | ffwd-9d69c13793c4c69c080ed4273bcd36ded69de2bb.tar.gz ffwd-9d69c13793c4c69c080ed4273bcd36ded69de2bb.zip | |
mlx: add opt-in 8-bit weight quantization
Diffstat (limited to 'pplx_embed_mlx.h')
| -rw-r--r-- | pplx_embed_mlx.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pplx_embed_mlx.h b/pplx_embed_mlx.h index 2b7164d..9b341e0 100644 --- a/pplx_embed_mlx.h +++ b/pplx_embed_mlx.h @@ -14,11 +14,18 @@ /* Opaque MLX model context */ typedef struct pplx_mlx_ctx pplx_mlx_ctx_t; +typedef struct { + int quantize_bits; /* 0 disables; currently 8 */ + int quantize_group_size; /* default 64 when quantize_bits is set */ +} pplx_mlx_options_t; + /* * Load model into MLX arrays from safetensors + config.json. * Returns NULL on error. */ pplx_mlx_ctx_t *pplx_mlx_load(const char *model_dir); +pplx_mlx_ctx_t *pplx_mlx_load_with_options(const char *model_dir, + const pplx_mlx_options_t *opts); /* * Load one contiguous transformer layer range for distributed execution. @@ -27,6 +34,9 @@ pplx_mlx_ctx_t *pplx_mlx_load(const char *model_dir); */ pplx_mlx_ctx_t *pplx_mlx_load_slice(const char *model_dir, int layer_start, int layer_end); +pplx_mlx_ctx_t *pplx_mlx_load_slice_with_options( + const char *model_dir, int layer_start, int layer_end, + const pplx_mlx_options_t *opts); void pplx_mlx_free(pplx_mlx_ctx_t *ctx); |
