Repository navigation
metal : gate mul_mm_id src1 rescale behind ggml_prec - #29029
Conversation
Assisted-by: Claude Fable 5.1
ggerganov
left a comment
There was a problem hiding this comment.
Thanks! We expect some backends to fail the new tests now - let's see.
|
@mdegans We should now update the @ggml-org/ggml-cuda @ggml-org/ggml-vulkan @ggml-org/ggml-webgpu fyi |
I will take care of that tomorrow, no problem. |
|
I was already looking into this for Vulkan, will open a PR soon. |
I was about to tackle this but will hold off in this case. @ggerganov and @0cc4m please let me know which bits you want me to handle, if any. |
Will do tomorrow along with the rest of the backends unless anybody objects by then. |
You can update supports_op here for failing cases, I'll open a follow-up PR with fixes for Vulkan. |
Will do. Cherry picking WebGPU as asked and fixing |
fix `supports_op` to return false for failing backends when the specified src1 precision is f32 Assisted-by: Claude Fable 5.1
FYI, Intel CIs are down ATM. |
Thanks for the heads-up but I had not looked at the causes of the failures on Intel. I think they're unrelated. So it's fine even if it runs now. Vulkan passes locally on macOS and Linux. CUDA passes on Linux. WebGPU I am assuming is workign based on @yomaytk but I will run locally as well to confirm. Edit: Confirmed on macOS. |
* metal : gate mul_mm_id src1 rescale behind ggml_prec Assisted-by: Claude Fable 5.1 * ggml-webgpu: reject MUL_MAT_ID when src1 precision is F32 * cuda/vulkan: reject MUL_MAT_ID in supports_op when src1 prec is F32 fix `supports_op` to return false for failing backends when the specified src1 precision is f32 Assisted-by: Claude Fable 5.1 --------- Co-authored-by: yomaytk <yoshimura.masashi.frbs@gmail.com>
* metal : gate mul_mm_id src1 rescale behind ggml_prec Assisted-by: Claude Fable 5.1 * ggml-webgpu: reject MUL_MAT_ID when src1 precision is F32 * cuda/vulkan: reject MUL_MAT_ID in supports_op when src1 prec is F32 fix `supports_op` to return false for failing backends when the specified src1 precision is f32 Assisted-by: Claude Fable 5.1 --------- Co-authored-by: yomaytk <yoshimura.masashi.frbs@gmail.com> (cherry picked from commit 0f8a414)
* metal : gate mul_mm_id src1 rescale behind ggml_prec Assisted-by: Claude Fable 5.1 * ggml-webgpu: reject MUL_MAT_ID when src1 precision is F32 * cuda/vulkan: reject MUL_MAT_ID in supports_op when src1 prec is F32 fix `supports_op` to return false for failing backends when the specified src1 precision is f32 Assisted-by: Claude Fable 5.1 --------- Co-authored-by: yomaytk <yoshimura.masashi.frbs@gmail.com> (cherry picked from commit 0f8a414)
Same supports_op gate CUDA, Vulkan and WebGPU got in ggml-org#29029: SYCL quantizes src1 to q8_1 or converts it to f16, so activations beyond the f16 range turn into NaN (MUL_MAT_ID q8_0 n_mats=8 n_used=2 n=64 amax=1e5). Assisted-by: Claude Opus 5.5
297 upstream commits. Conflicts and how they were resolved: - ggml ops: upstream added GGML_OP_TOP_K_MASK next to the fork's GGML_OP_TURBO_WHT; both are kept, upstream's first, GGML_OP_COUNT 103. - MoE down projection: upstream replaced the MISTRAL4 F32 src1 precision hint (its own, ggml-org#29029) with a per-row amax rescale (ggml-org#30861) for MISTRAL4 and MELLUM. It now sits in build_moe_ffn_exps, so every tiered call (hot, cold, each arena window) rescales its own rows; rows skipped by a partial mul_mat_id are zero, so their scale is 1. - MoE post_exp_norm (new upstream): applied in build_moe_ffn after the hot/cold merge and before the router weights; the two halves fill disjoint expert slots, so the norm sees whole rows. - build_lora_mm_id: upstream's Hadamard input transform (prism) after the fork's partial/slots assert. Expert tensors split by LLAMA_MOE_HOT are not in the Hadamard map, so prism and tiering do not stack on one layer. - kv-cache attention rotation: the fork's default (off unless LLAMA_ATTN_ROT_DISABLE=0) is kept; upstream's llama_model_set_attn_rot can still turn it off per model. - model loader: hugetlb per-tensor populate kept before upstream's multi-buffer lookup of the mmap buffer. - llama-model: MoE arena setup and upstream's load_tensors_hadamard both run at the end of load_tensors. - qwen4exp: turbo Q pre-rotation kept; the selection mask is now `sel`. - server: upstream added draft-token logprobs (ggml-org#27196) read back from the batch logits, without post_sampling_probs. The fork's on_sample path, which records them during verification and covers post_sampling_probs, is kept; upstream's test_draft_token_probs passes with it. Upstream's local spec_i_batch is taken. - mmq: fork's IQ1_M MMQ gains upstream's prec_src1 parameter. - fattn-tile: the fork's D=640 case and HIP guard kept, upstream's default-case style. - argsort.cu: upstream's CCCL guard; the fork's hipcub arm was dead since HIP does not define GGML_CUDA_USE_CUB. - tests/CMakeLists.txt: fork tests kept, upstream's LINK and consolidated test-llama-context taken. Tested on gfx1100: ctest 78/80 (the two failures are environmental: the ggml-vocabs clone has git-lfs pointers, and system python has no jinja2). All fork tests pass (turbo-kv x8, moe-tier, fattn-turbo4, fattn-long-kv, mmvq-src1-cache, fusions, mul-mat-f16-range, top-k-graph-capture, op-offload-devices). test-llama-archs 390/390. Server test_speculative.py 10/10, completion/probs pytests 14/14. Needle at 20.5k tokens, Qwen3.8-27B IQ4_NL, turbo4 K/V: correct, prefill 925 tok/s vs 909 before the merge (single run).
Overview
This is a follow-up to #26223 per request from @ggerganov to use ggml_prec....
Details
master4ff829e against this branch, eight passes in ABBA BAAB order, median of per-case medians, negative means this branch is faster.Please note that N >= 1024 are local cases only and not committed.
Additional information
which will likely break on CUDA, Vulkan and WebGPU(now likely fixed).Let me know if these should be commented out. My guess is they should be, but that putting the test change in a seperate commit might be desirable. Please advise.Requirements