Repository navigation
llama : deny -sm tensor for arches with moe amax rescaling - #31081
Merged
Merged
Conversation
The amax POOL_1D reduction spans the whole matmul row, so a device cannot compute it from an axis-0 split. The Meta split-state case reported MIRRORED, which gives each device a partial max of its own slice. Drop that case and deny -sm tensor for the arches which build the amax graph, see [TAG_MOE_AMAX_SCALE]. Assisted-by: dsh:llama.cpp/ggml-org/Qwen3.8-Flash-Next-GGUF (MacBook, M5 Max, 128GB)
ggerganov
marked this pull request as ready for review
October 24, 2026 08:39
JohannesGaessler
approved these changes
Oct 24, 2026
CISC
approved these changes
Oct 24, 2026
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
llm_arch_supports_sm_tensordenies--split-mode tensorper architecture. The MoE amax rescaling from #30861 builds aPOOL_1Dmax reduction withk = s = ne[0], so the pooling window spans the entire matmul row. Under--split-mode tensorthe MoE intermediate is split along axis 0, which means no device holds a complete row: each one pools over its own slice and gets a partial max. Thehandle_pool_1dsplit-state case reportedMIRROREDfor that input, but the values are not the same per device, so the claim is false and the rescale is not guaranteed to cancel once the partials are summed.This removes the
POOL_1Dcase from the Meta backend, restoring the previous grouping with the conv and pool ops, and addsmellumandflintto the deny list next tomistral4. Both sites carry a shared[TAG_MOE_AMAX_SCALE]marker so the entries can be dropped together when the rescaling goes away.Additional information
The graph still applies the rescaling to
curand undoes it on the down-projection output; only the tensor-split path is disabled.test-llama-archsreported NMSE around9.6e-08forflintand9.2e-08formellumon the meta backend before this change and now skips both, like every other denied architecture. All 534 cases pass.Requirements
dsh:llama.cppMacBook, M5 Max, 128GB◷ 53.2m · ⚙ 5.1m · ↑ 282k · ↓ 111k · ≡ 299 · ⌨ 31