pub struct LlamaQuantizeParams { /* private fields */ }Expand description
Parameters controlling a quantize run.
Starts from llama_model_quantize_default_params(); the builder methods
override the handful of fields common quantization runs need. ik’s
per-tensor override fields (output_tensor_type, token_embedding_type,
attn_q_type, attn_k_type, attn_v_type, attn_qkv_type,
attn_output_type, ffn_gate_type, ffn_down_type, ffn_up_type,
ffn_gate_inp_type, extra_output_type, per_layer_token_embedding_type)
and the extra flags (only_copy, pure_, keep_split,
ignore_imatrix_rules, only_repack, dry_run, partial_requant) plus the
opaque pointers (imatrix, kv_overrides, custom_quants,
repack_pattern, user_data) keep their default values unless set through
as_raw_mut.
Implementations§
Source§impl LlamaQuantizeParams
impl LlamaQuantizeParams
Sourcepub fn with_ftype(self, ftype: llama_ftype) -> Self
pub fn with_ftype(self, ftype: llama_ftype) -> Self
Target quantization format (e.g. ftype::LLAMA_FTYPE_MOSTLY_Q4_K_M or
an ik SOTA quant like ftype::LLAMA_FTYPE_MOSTLY_IQ4_K).
Sourcepub fn with_n_threads(self, n_threads: i32) -> Self
pub fn with_n_threads(self, n_threads: i32) -> Self
Number of threads to use (0 lets the C side pick a default).
Sourcepub fn with_allow_requantize(self, allow_requantize: bool) -> Self
pub fn with_allow_requantize(self, allow_requantize: bool) -> Self
Allow requantizing tensors that are already quantized (default false).
Sourcepub fn with_quantize_output_tensor(self, quantize_output_tensor: bool) -> Self
pub fn with_quantize_output_tensor(self, quantize_output_tensor: bool) -> Self
Also quantize the output.weight tensor (default false keeps it larger
for quality).
Sourcepub fn as_raw(&self) -> &llama_model_quantize_params
pub fn as_raw(&self) -> &llama_model_quantize_params
Immutable access to the raw params (advanced/escape hatch).
Sourcepub fn as_raw_mut(&mut self) -> &mut llama_model_quantize_params
pub fn as_raw_mut(&mut self) -> &mut llama_model_quantize_params
Mutable access to the raw params, for setting ik’s extended per-tensor
override fields, flags, or the opaque imatrix/kv_overrides pointers
that are not surfaced by dedicated builders.
Trait Implementations§
Source§impl Clone for LlamaQuantizeParams
impl Clone for LlamaQuantizeParams
Source§fn clone(&self) -> LlamaQuantizeParams
fn clone(&self) -> LlamaQuantizeParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more