Commit 53a392c
committed
fix(§METAL-RETILE): MSL-compile the sub_chunks=2 retile body (Psc1 frag-drain) + compile-check
The §METAL-RETILE sub_chunks=2 body lowered through TIR but FAILED MSL codegen:
'assigning to float4 from incompatible type simdgroup_float8x8' on the direct
T.copy(dchunk_sc1, Psc1[hh, 0:headdim, 0:dstate]) — a fragment -> 3D-shared-slice
copy mis-vectorizes the simdgroup matrix. Fix: drain the sc1 dchunk partial via
the 2D store_f32 staging (the same vectorizable copy the main dchunk uses) then
scatter store_f32 -> Psc1[hh] band with an element-wise T.Parallel copy.
After the fix BOTH Metal prims MSL-compile (codegen-only, NO Apple-GPU dispatch
this run per the watchdog mandate):
- main_retile (sub_chunks=2, L=32,L_sub=16,P=N=32,HPC=1,threads=32): MSL 44090 B
- legacy main (sub_chunks=1, HPC=2): MSL 37795 B (barrier-fix path lowers clean)
scratch/compile_check_metal_retile.py is the CPU-only lower/codegen harness (guards
the prod-L=64 32KB NO-GO assertion + lowers both prims). z3 driver green:
ALL_POSITIVES_PROVED_AND_NON_VACUOUS (5 metal_subchunk positives UNSAT/partition +
5 paired negatives sat/miss).
HONEST NO-GO: prod L=64 via this retile is 68096 B (HPC=1) / 99328 B (HPC=2),
both >> Apple 32768 B — the build gate RAISES (no over-budget launch, RULE #1).
The body is exercisable only at small in-budget bounded dims (compile-check). No
Apple-GPU numeric measurement this run (watchdog-safety).1 parent 58684f3 commit 53a392c
2 files changed
Lines changed: 80 additions & 1 deletion
File tree
- cppmega_mlx/nn/_tilelang
- scratch
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3744 | 3744 | | |
3745 | 3745 | | |
3746 | 3746 | | |
3747 | | - | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
| 3753 | + | |
| 3754 | + | |
| 3755 | + | |
3748 | 3756 | | |
3749 | 3757 | | |
3750 | 3758 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
0 commit comments