[PR #2349] [CLOSED] moe_mm_parity: the default tile that did not exist, and --v3's v1 arg… #3995

Closed
opened 2026-11-07 15:32:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2349
Author: @demetree
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: f-mac-moe-test


📝 Commits (1)

  • 1d5e457 moe_mm_parity: the default tile that did not exist, and --v3's v1 argument list

📊 Changes

1 file changed (+5 additions, -5 deletions)

View changed files

📝 metal/tests/moe_mm_parity.cpp (+5 -5)

📄 Description

…ument list

Two stale defaults, both of which kept the test from covering what the engine ships.

The default tile was TM 16 TN 64 TK 16, but the v1 kernel set only instantiates TK 64: the default run died at pipeline creation on any GPU (measured on an M1 Max: "mtl: no function mm_gu_42_16_64_16_2"). TK is now 64, which both the v1 and the v2 sets instantiate, so the default run and --v2 both work; the engine's v2 tile for Q2_0 (16,64,16,2) stays reachable with --tile.

--v3 bound the v1 kernels' argument list ({W, x, H, stok, tiles, ma}) to the v3 kernels: tiles was read as the sorted-token buffer and MmArgs as raw int2 pairs, so every stride, n_embd and expert id was garbage. On the M1 Max that is a deterministic GPU command-buffer error in the GEMM pass; with the right arguments the v3 kernels run, and a separate M1 limit shows (≥40 threadgroups of mm_gu3 fault, 35 pass, data-independent) that the engine does not hit: gu_v3 = dn_v3 = coop_k4, which is false on the M1. v3 now binds {W, XS, HS, tiles, ma} as the engine does, fills XS for v3 too (v3 is v2's gather plus the register-operand GEMMs), and binds HS - not H - to down3 with DSG simdgroups.

Measured on an M1 Max (macOS 26.6.2, Q2_0, T 256, 64 experts): default (v1) PASS, rel L2 2.53e-06 vs the fp16-operand reference and 2.37e-04 vs exact; --v2 PASS, 4.42e-06 and 2.37e-04, also with the engine's tile (16,64,16,2).

Leaves alone: no kernel, engine or other test change.

Title

Issue: Resolves #

Summary

What changed

Extra Notes


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2349 **Author:** [@demetree](https://github.com/demetree) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `f-mac-moe-test` --- ### 📝 Commits (1) - [`1d5e457`](https://github.com/Niko1221/Strata/commit/1d5e457e3d53082ad3967637f34b4e75b72bf4d6) moe_mm_parity: the default tile that did not exist, and --v3's v1 argument list ### 📊 Changes **1 file changed** (+5 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `metal/tests/moe_mm_parity.cpp` (+5 -5) </details> ### 📄 Description …ument list Two stale defaults, both of which kept the test from covering what the engine ships. The default tile was TM 16 TN 64 TK 16, but the v1 kernel set only instantiates TK 64: the default run died at pipeline creation on any GPU (measured on an M1 Max: "mtl: no function mm_gu_42_16_64_16_2"). TK is now 64, which both the v1 and the v2 sets instantiate, so the default run and --v2 both work; the engine's v2 tile for Q2_0 (16,64,16,2) stays reachable with --tile. --v3 bound the v1 kernels' argument list ({W, x, H, stok, tiles, ma}) to the v3 kernels: tiles was read as the sorted-token buffer and MmArgs as raw int2 pairs, so every stride, n_embd and expert id was garbage. On the M1 Max that is a deterministic GPU command-buffer error in the GEMM pass; with the right arguments the v3 kernels run, and a separate M1 limit shows (≥40 threadgroups of mm_gu3 fault, 35 pass, data-independent) that the engine does not hit: gu_v3 = dn_v3 = coop_k4, which is false on the M1. v3 now binds {W, XS, HS, tiles, ma} as the engine does, fills XS for v3 too (v3 is v2's gather plus the register-operand GEMMs), and binds HS - not H - to down3 with DSG simdgroups. Measured on an M1 Max (macOS 26.6.2, Q2_0, T 256, 64 experts): default (v1) PASS, rel L2 2.53e-06 vs the fp16-operand reference and 2.37e-04 vs exact; --v2 PASS, 4.42e-06 and 2.37e-04, also with the engine's tile (16,64,16,2). Leaves alone: no kernel, engine or other test change. ## Title <!-- If Applicable, reference the GitHub issue --> Issue: Resolves # ## Summary <!-- Quick Summary of changes --> ## What changed <!-- Specifics on files changed, and what changes were made there --> ## Extra Notes <!-- Any extra notes, delete if there are none --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:32:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3995
No description provided.