Skip to content

llama : deny -sm tensor for arches with moe amax rescaling - #31081

Merged
ggerganov merged 1 commit into
masterfrom
gg/split-state-pool-1d
Oct 24, 2026
Merged

ggerganov merged 1 commit into
masterfrom
gg/split-state-pool-1d

Conversation

@ggerganov

Copy link
Copy Markdown
Member

Overview

llm_arch_supports_sm_tensor denies --split-mode tensor per architecture. The MoE amax rescaling from #30861 builds a POOL_1D max reduction with k = s = ne[0], so the pooling window spans the entire matmul row. Under --split-mode tensor the 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. The handle_pool_1d split-state case reported MIRRORED for 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_1D case from the Meta backend, restoring the previous grouping with the conv and pool ops, and adds mellum and flint to the deny list next to mistral4. 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 cur and undoes it on the down-projection output; only the tensor-split path is disabled. test-llama-archs reported NMSE around 9.6e-08 for flint and 9.2e-08 for mellum on the meta backend before this change and now skips both, like every other denied architecture. All 534 cases pass.

Requirements

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)
@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Oct 24, 2026
@ggerganov
ggerganov marked this pull request as ready for review October 24, 2026 08:39
@ggerganov
ggerganov merged commit 3032209 into master Oct 24, 2026
28 of 34 checks passed
@ggerganov
ggerganov deleted the gg/split-state-pool-1d branch October 24, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants