Repository navigation
graph : add precision handling for MELLUM architecture - #30584
Merged
Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
Author
Is this still relevant, given that I already have a few contributions? |
CISC
approved these changes
Oct 15, 2026
Member
No, though you may hit a hard limit at some point. |
taronaeo
approved these changes
Oct 15, 2026
Member
|
I think we should block the merge until tomorrow as @/ggerganov is preparing the next release. See: #30588 (comment) |
Contributor
Author
Member
|
I think its OK to merge now, given that there have been pushes already. CI failures unrelated to PR. Merging. |
Collaborator
|
This pr destroyed performance on CUDA, see #30704 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Overview
Fixes #30579.
For Mellum it sets
GGML_PREC_F32onsrc1forffn_moe_down, which enables thesrc1rescale in the Metalmul_mm_id. The input to Mellum'sffn_moe_downreaches ~2.9e5, while the F16 limit is 65504.Reuses the mechanism from #29029 (follow-up of #26223), same as for Mistral4.
Additional information
Only Metal (Apple M2 Max) and CPU tested.
With
GGML_PREC_F32set CUDA, Vulkan, WebGPU, Hexagon, and OpenCL (with Adreno MoE kernels) return false fromsupports_opforMUL_MAT_ID. It means thatffn_moe_downin all layers of Mellum will run on the CPU. Same trade-off as for Mistral4 (#29029).Perplexity
Prompt and command as in the issue (
-c 2048 -b 2048, -ngl 99 for Metal, -ngl 0 for CPU). Base = masterdf18bee11, fix =b418747f5.2.2062 2.1612 2.35762.2062 2.1612 2.35762.2054 2.1612 2.35832.1771 2.1360 nan2.1771 2.1360 2.31702.1839 2.1340 2.30942.2696 2.2252 nan2.2696 2.2252 2.43022.2640 2.2225 2.43592.2387 2.2290 nan2.2387 2.2290 2.50322.2416 2.2324 2.50942.2803 2.2543 2.47102.2803 2.2543 2.47102.2739 2.2469 2.4555bfloatstaging, power-of-two rescale is exact)Performance (Metal)
llama-bench -ngl 99 -p 512,2048 -n 128 -r 5. ABBA order (base, fix, fix, base), 90 s pause before each pass. Values are t/s, two passes per variant; diff is best fix vs best base.Tests
test-backend-ops test -o MUL_MAT_ID -b MTL0: 883/883 passed on MTL0 vs CPU (including 6 cases withsrc1above F16 andGGML_PREC_F32(amax=100000;q8_0andq4_K; n = 16 / 32 / 64))test-llama-archs -a '^mellum$': 4 tests passedFull local CI (
GG_BUILD_METAL=1 bash ./ci/run.sh <results> <mnt>), all steps passedctest_debug51/51,ctest_release52/52,ctest_with_model_debug/_release5/5 eachtest_backend_ops(all ops, Metal vs CPU): 17604/17604test_llama_archs_models/_tensor_split,embd_bge_small,rerank_tiny,test_scripts,qwen3_0_6b: passedRequirements