pub struct OpParams {
pub weight_ptr: u64,
pub gamma_ptr: u64,
pub scalar: f32,
pub int_param: u32,
pub weight_qtype: u32,
pub bias_ptr: u64,
pub bias_len: usize,
}Expand description
Operation-specific parameters.
Fields§
§weight_ptr: u64Weight pointer (for MulMat: quantized weights on device)
gamma_ptr: u64Normalization gamma pointer (for RmsNorm)
scalar: f32Scalar parameter (epsilon for RmsNorm, etc.)
int_param: u32Integer parameter (position for RoPE, etc.)
weight_qtype: u32PERF-050 (aprender#2753): GGML quantization type code of weight_ptr.
Without this the graph carried only a pointer, and the dispatcher had no way to know what it pointed at – so it assumed Q4_K for every MulMat. In a q4_k_m model that is right for 170 tensors and wrong for 29: attn_v, ffn_down and the LM head are Q6_K, and dequantizing Q6_K with the Q4_K kernel produced garbage of magnitude ~5e8 with NaNs.
The numeric GGML code is used rather than a Rust enum because this crate must not depend
on the serving crate’s WeightQuantType. 12 = Q4_K, which is also the Default, so
nodes that do not set it behave exactly as before.
bias_ptr: u64PERF-050 (aprender#2769): bias vector applied after a MulMat, 0 when there is none.
The graph had no bias node and no way to express one, so the QKV bias Qwen2.5 models carry was silently dropped on this path while the M=1 path applied it. Defaults to 0, which means “no bias” and reproduces the previous behaviour exactly.
bias_len: usizeLength of bias_ptr in elements; 0 means no bias.