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
4 of 11 tasks
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 25, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 25, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 26, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 26, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 26, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 26, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 26, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 26, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 26, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 26, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 27, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 27, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 27, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 27, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 27, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 27, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 27, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 27, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 27, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 27, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 29, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 29, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 30, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
This was referenced Oct 30, 2026
edwardyoon
pushed a commit
to edwardyoon/focus-llama
that referenced
this pull request
Oct 30, 2026
…31081) 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)
lukekim
added a commit
to spiceai/llama.cpp
that referenced
this pull request
Oct 30, 2026
…21) Upstream removed handle_pool_1d in ggml-org#31081 (an axis-0 split gives each device only a partial max) and moved GGML_OP_POOL_1D into the generic scalar-only case. The b11984 merge kept the lambda but took upstream's case, so it is never called and GCC's -Werror=unused-but-set-variable fails the ubuntu build. POOL_1D is now handled exactly as upstream b11999 handles it.
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 30, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 30, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 30, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 30, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 30, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 31, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 31, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 31, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 31, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 31, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Oct 31, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Nov 1, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Nov 1, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Nov 1, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Nov 1, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Nov 1, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Nov 1, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Nov 1, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
stew675
pushed a commit
to stew675/llama.cpp
that referenced
this pull request
Nov 1, 2026
… per-device scalar) This block is a LOCAL, TEMPORARY relaxation of upstream behaviour, not a feature of the delivery. It exists so the MoE amax arches (flint, mellum, mistral4) can run -sm tensor today; it is expected to be replaced once upstream lands a real fix, and it can be dropped without touching any other block. Limitations are recorded in patches/README.md (block 14) and GREEDY-PURITY.md; do not treat `-sm relaxed-tensor` as a supported mode. Why upstream refuses today: ggml-org#30861/ggml-org#31081 -- the MoE amax rescale pools a whole matmul row (`pool_1d(abs(cur), MAX, k = s = n_ff_exp)`) to divide `cur` by a power of two and undo it on the down-projection output. Under `-sm tensor` no device holds a complete row, so each one can only compute the max of its own slice. ggml-org#31081 removed the Meta POOL_1D case (which claimed MIRRORED, a false claim) and denied -sm tensor for those three arches. Add a split mode instead of a blanket deny. `-sm relaxed-tensor` places the weights exactly like `-sm tensor` (same Meta wrapper, FA required, expert tables split: 0 extra VRAM) but also admits a replicated tensor whose values differ per device: - ggml: new GGML_BACKEND_SPLIT_AXIS_PER_DEVICE = 12 -- same shape/positions everywhere, per-device values. `handle_pool_1d` produces it for an axis-0 split (whole-row MAX only), `handle_bin_bcast` lets it be consumed elementwise and broadcast, and every copy/gather/read-back path aborts with a message instead of silently returning one device's value. - The delayed-reduce MUL-chain in graph_compute accepts it, so the reduce point stays AFTER the per-device undo: each device applies its own `e` to its own partial and only then is the sum taken. That is what makes the per-device value cancel (`e` is a power of two, so the scaling commutes with the sum), and `e_local <= e_global` means every device keeps at least the reference's f16 headroom. - llama: LLAMA_SPLIT_MODE_RELAXED_TENSOR = 4, `-sm relaxed-tensor`; every "is this the tensor path?" site goes through llm_split_mode_is_tensor_like(). `-sm tensor` keeps upstream's strict behaviour and the deny, but the error now points at the new mode. Measured (Flint Q8_0, 2x R9700): greedy text byte-identical to `-sm layer` and to itself at 3 GPUs; with the amax divisor forced to 1 (so `e` != 1) the POOL_1D pooled max differs across devices on ~half of the ~185 per-run calls and the text still matches `-sm layer` exactly. A non-amax arch (Qwen3.5-4B) is byte-identical under tensor and relaxed-tensor. `ggml_pool_1d` has exactly one producer in the graph, so the relaxed state is unreachable for any other arch. NOT claimed: bit-identity to a single device on a backend whose in-kernel src1 rescale is non-linear (Vulkan's clamp; RDNA/HIP is exact), any behaviour under -ncmoe (the expert arena still refuses tensor-like modes), and mellum/mistral4 at all (enabled by the same change, unvalidated -- no model).
1 task done
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