loader, quantize: align GGUF on llama.cpp, conv kernels widened to F16 at load

GGUF norm matches llama.cpp policy: F32 master stays F32, BF16
variant keeps source BF16, K-quants fall back to F16 when kernel
rows do not align. No conv override in pick_type.

Conv kernels widen to F16 at load through gf_load_conv (12 sites).
qwen_load_ctw_f32 accepts BF16 source.

TODO upstream GGML: ggml_conv_1d and ggml_conv_1d_dw force F16 on
their im2col output, while conv_2d picks the kernel dtype. This
crashes F32 and BF16 kernels on CPU (im2col only handles F16) and
BF16 on Vulkan (mul_mat refuses BF16 on the operand the kernel
ends up on). Aligning conv_1d on conv_2d removes the workaround.
This commit is contained in:
Pascal
2026-05-11 12:42:54 +02:00
parent 59fda26827
commit 530eed6ac5
8 changed files with 113 additions and 69 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ static bool qwen_upsample_stage_load(QwenUpsampleStage * stage, const GGUFModel
QwenConvNeXtBlock & cn = stage->convnext[i];
snprintf(name, sizeof(name), "tok_dec.upsample.%d.dwconv.weight", i);
cn.dwconv_w = gf_load_tensor(&wctx, gf, name);
cn.dwconv_w = gf_load_conv(&wctx, gf, name);
snprintf(name, sizeof(name), "tok_dec.upsample.%d.dwconv.bias", i);
cn.dwconv_b = gf_load_tensor(&wctx, gf, name);
snprintf(name, sizeof(name), "tok_dec.upsample.%d.norm.weight", i);