quant : allow quantization for LFM3-Audio codec decoder (#31386)
* quantize : quantize the LFM3-Audio codec decoder, it is Q4_0 QAT * quantize : drop the QAT note from the LFM3-Audio comment
This commit is contained in:
1 parent
1ab23c33b7
commit
889f2ec96d
2 files changed
+2
-5
No files matched your search
@@ -453,9 +453,6 @@ class LFM3AudioMmprojModel(MmprojModel):
|
||||
def tensor_force_quant(self, name, new_name, bid, n_dims):
|
||||
if new_name.startswith("a.conv1d.") or "conv_dw" in new_name or new_name.startswith("a.gen.wav.quant."):
|
||||
return gguf.GGMLQuantizationType.F32
|
||||
# the codec decoder is small and its log-magnitude/phase output does not survive quantization
|
||||
if new_name.startswith("a.gen.wav."):
|
||||
return gguf.GGMLQuantizationType.F16
|
||||
return super().tensor_force_quant(name, new_name, bid, n_dims)
|
||||
|
||||
def generate_extra_tensors(self) -> Iterable[tuple[str, Tensor]]:
|
||||
|
||||
+2
-2
@@ -352,10 +352,10 @@ static bool tensor_allows_quantization(const llama_model_quantize_params * param
|
||||
// do not quantize LFM3-VL's depthwise conv kernels, CONV_2D_DW takes F32 kernels
|
||||
quantize &= name.find("conv2d_spatial.weight") == std::string::npos;
|
||||
|
||||
// do not quantize LFM3-Audio's encoder convs and codec, the codec output does not survive quantization
|
||||
// do not quantize LFM3-Audio's encoder convs, depthwise convs and the codec FSQ
|
||||
quantize &= name.rfind("a.conv1d.", 0) != 0;
|
||||
quantize &= name.find("conv_dw") == std::string::npos;
|
||||
quantize &= name.rfind("a.gen.wav.", 0) != 0;
|
||||
quantize &= name.rfind("a.gen.wav.quant.", 0) != 0;
|
||||
|
||||
// do not quantize MiniMax's indexer projection weights, they are tiny
|
||||
quantize &= name.find("indexer.k_proj.weight") == std::string::npos;
|
||||
|
||||
Reference in new issue
Block a user