Skip to content

qwen27 metal: opt-in INT8 ANE FFN slices for SenseNova-Loop - #4416

Open
gilby wants to merge 13 commits into
ashhart:mainfrom
gilby:qwen27-metal-ane-int8
Open

gilby wants to merge 13 commits into
ashhart:mainfrom
gilby:qwen27-metal-ane-int8

Conversation

@gilby

@gilby gilby commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

What this changes

Adds strictly opt-in Neural Engine + GPU hybrid prefill FFN slices (TF_ANE_COLUMNS, default_columns = 0 everywhere) and strictly opt-in TF_ANE_INT8=1 W8A8 MIL constexpr_blockwise_shift_scale compilation (false default everywhere via ane_policy.int8 and ane_policy.int8For, including looped checkpoints) for SenseNova-Loop AWQ g128 (ane_awq.zig) and MLX-affine g64 (ane_affine.zig, 4-bit register unpacking restricted to p.bits == 4). Opt-in ANE (TF_ANE_COLUMNS=0, TF_ANE_INT8=false defaults everywhere) targets SenseNova-Loop on Apple M3-M5 (AWQ g128 and MLX-affine g64 via requestedOnGeneration(columns, generation) >= 15) plus dense qwen27 checkpoints on Apple M5 tensor-unit Macs (requestedOnChip(columns, tensorUnits())). Registers q27 ane awq q27_add_ane_bf16 and its planted controls with the Metal kernel contract (zig/src/core/contract/q27_ane_records.zig and zig/tests/contract/metal_q27_ane.zig). Default inference behavior with unset TF_ANE_COLUMNS / TF_ANE_INT8 is unchanged.

Checks on this head

  • Head commit: ad4b96c0817206e461b2860042f5ffad4c9e4cda
  • Lean checker, python3 tools/zig/lean_check.py, on the base and on this head: 552de160c4 (7388 files, 167 problems) -> ad4b96c081 (7392 files, 167 problems), 0 new (tools/zig/lean_new.py and tools/pr_check.py --base 552de160c4: 0 error(s), 1 warning(s)).
  • Tests run, with the command and pass, fail and skip counts:
    • zig fmt --check and git diff --check 552de160c4..HEAD: passed.
    • zig build -j6 dev-tools native tf-kernel-contract -Dcpu=apple_m1: exited 0.
    • Targeted host and contract steps (test-golden 324/337 + 69/69, test-metal-launch-map-host 1164 registered launches, 2 controls, 0 missing, test-kernel-contract, test-qwen27, test-qwen27-ane-policy-host, test-environment-host): exited 0.
    • test-metal-residency-owners-host (including residency_qwen27_tests.zig and residency_qwen27_share_tests.zig): 76/78 passed (only the 2 pre-existing base 1b394565cc GLM e.dflash crashes).
    • Live Apple GPU kernel contract:
      • Apple M3 Ultra (macOS 26.6.2, applegpu_g15, tensor_units=false):
        • tf-kernel-contract --only "q27 ane" (exit 0): SUMMARY 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed; 0 limit problems; gates 18 ms, limits 12 ms.
        • tf-kernel-contract --only q27 (exit 0): SUMMARY 26 kernels: 26 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed; 0 limit problems; gates 21786 ms, limits 5449 ms.
      • Apple M5 Max (applegpu_g17, tensor_units=true):
        • tf-kernel-contract --only "q27 ane" (exit 0): SUMMARY 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed; 0 limit problems; gates 17 ms, limits 421 ms.
        • tf-kernel-contract --only q27 (exit 0): SUMMARY 26 kernels: 26 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed; 0 limit problems; gates 19131 ms, limits 5018 ms.
        • tf-kernel-contract --only sensenova (exit 0): SUMMARY 24 kernels: 24 pass gates 1-4, 0 fail, 0 known findings; 45 controls: 45 red as planted, 0 missed; 0 limit problems; gates 21568 ms, limits 2160 ms.
      • Note: full uncapped tf-kernel-contract stops at pre-existing UnrecordedRotaryCompiler (rotary probes) and --no-gates stops at pre-existing base 1b394565cc glm UnknownLaunch, unrelated to this PR (test-metal-launch-map-host 1164 launches, 0 missing).
    • Remote serving receipts on Apple M3 Ultra (macOS 26.6.2), Apple M5 Pro (64 GiB, macOS 27.2.1), and Apple M5 Ultra (512 GiB): see Receipt below.
  • CI: Triggered upon push of ad4b96c081.
  • Not run, and why: Pre-existing unrelated rotary probes / base glm uncapped tf-kernel-contract items noted above; non-Apple backends untouched.

Receipt

  • Main against branch:
    • Apple M3 Ultra (macOS 26.6.2, applegpu_g15, tensor_units=false), SenseNova-Loop-9B-AWQ-g128 (#4415 vs this PR default-off vs this PR opt-in TF_ANE_COLUMNS=4096 TF_ANE_INT8=1):
      • Default-off startup: requested_columns=0 loaded_columns=0 program_weight_bytes=0 loaded=false exact_output_qualified=false.
      • Opt-in ANE INT8 startup: info: qwen27: ANE AWQ share built layers=32 columns=4096 rem=8192 mode=int8, loaded_columns=4096 program_weight_bytes=3221225472 loaded=true exact_output_qualified=false.
      • #4415 == this PR default-off: 100% exact token_sha & output_sha256 parity across 20/20 bench_openai.py runs and all 5/5 bench_cache.py --require-cold rows (token_sha=eaa68149fc60, first TTFT 3.418s -> 3.421s, repeat [3.380, 3.454]s -> [3.374, 3.377]s).
      • this PR opt-in ANE INT8 (TF_ANE_COLUMNS=4096 TF_ANE_INT8=1) vs this PR default-off (bench_concurrent.py --levels 1,4 --temperatures 0 --tokens 128 --reps 2 --alone --serial): exact token_sha parity (code=339b36c97870, chat=e8723704c2fc), alone 2/2 (c=1) & 8/8 (c=4) 0 unequal/failed, serial 1/1, plain_drafted=0; chat c=4 TTFT median 1.050s -> 0.920s (-12.4%), makespan 4.711s -> 4.590s, agg decode 130.1 -> 131.4 tok/s; code c=4 TTFT median 0.352s -> 0.334s, agg 160.0 -> 162.3 tok/s.
    • Apple M3 Ultra, Qwen3.8-27B-MLX-4bit (#4415 vs this PR default-off vs this PR TF_ANE_COLUMNS=4096 TF_ANE_INT8=1):
      • ANE stays cleanly off on non-looped M3 (requestedOnChip(4096, tensorUnits()=false) -> loaded=false) with 100% exact token_sha & output_sha256 parity across 20/20 bench_openai.py runs, 5/5 bench_cache.py --require-cold rows (token_sha=2bef4621bf99, TTFT 6.198s / 6.189s), and bench_concurrent.py (code=f5c9409cfe40 c=4 175.5/175.6 tok/s, chat=b69b0269917f c=4 147.8/147.7 tok/s, 0 unequal/failed).
    • Apple M5 Pro (64 GiB, macOS 27.2.1), SenseNova-Loop-9B-MLX-Q4-hq (#4415 vs this PR default-off vs this PR opt-in TF_ANE_COLUMNS=6144 TF_ANE_INT8=1):
      • Default-off startup (TF_ANE_COLUMNS & TF_ANE_INT8 unset): requested_columns=0 loaded_columns=0 program_weight_bytes=0 loaded=false exact_output_qualified=false (verified on both SenseNova-Loop-9B-MLX-Q4-hq and Qwen3.8-27B-MLX-4bit).
      • #4415 == this PR default-off on SenseNova-Loop-9B-MLX-Q4-hq: 100% exact token_sha & output_sha256 match across all 20/20 bench_openai.py runs and all 5/5 bench_cache.py --require-cold rows (token_sha=eaa68149fc60, cold TTFT 4.774s vs 4.846s, rep 4.609s / 4.648s vs 4.717s / 4.677s), zero regression.
      • Opt-in ANE INT8 startup (TF_ANE_COLUMNS=6144 TF_ANE_INT8=1): info: qwen27: ANE affine share built layers=32 columns=6144 rem=6144 mode=int8, loaded_columns=6144 program_weight_bytes=4831838208 loaded=true exact_output_qualified=false.
      • this PR opt-in ANE INT8 vs default-off (bench_concurrent.py --levels 1,4 --temperatures 0 --tokens 128 --reps 2 --alone --serial): exact token_sha match (code=b5eabd2f8348, chat=ce0afb1a0d65), 0 failed/unequal (alone 2/2 & 8/8, serial 1/1): code c=1 43.4 / c=4 agg 133.2 tok/s, chat c=1 32.2 / c=4 agg 104.9 tok/s.
    • Apple M5 Pro (64 GiB), Qwen3.8-27B-MLX-4bit:
      • Default-off baseline: bench_cache qualified=True (sha=6a2395ffd378, 5.193s), bench_openai 17.44 tok/s, bench_concurrent c=4 agg 62.3 / 62.6 tok/s (0 unequal).
      • Requesting TF_ANE_COLUMNS=4096 for 27B on a 64 GiB Mac (25.9 GiB kept wired leaving 1564 MiB under the 70% cap) cleanly refuses loading via the admission guard (prompts run on the GPU alone, loaded=false).
    • Apple M5 Ultra (512 GiB), Qwen3.8-27B-MLX-4bit (TF_ANE_COLUMNS & TF_ANE_INT8 unset vs opt-in TF_ANE_COLUMNS=4096 TF_ANE_INT8=1):
      • Default-off startup: requested_columns=0 loaded_columns=0 loaded=false exact_output_qualified=false ([tensorfold] profile: stable; registered overrides: none); bench_cache.py --require-cold (2,571 prompt tokens, qualified=True, sha=6a2395ffd378, rep TTFT 1.356s / 1.362s, decode 47.2 / 45.1 tok/s), bench_openai.py (fib T=0 46.21 tok/s sha=a10c9b848ed9, chat T=0 47.19 tok/s sha=a06fab348fbe).
      • Opt-in TF_ANE_COLUMNS=4096 TF_ANE_INT8=1 on non-looped 27B dispatches the existing FP16 ANE path (loaded=true, program_weight_bytes=8053063680, bench_concurrent c=4 agg 162.0 / 162.7 tok/s, alone 2/2 & 8/8 0 unequal); M5 Ultra tensor units outrun ANE on the 2,571-token prompt (2.04s vs 1.36s GPU), confirming why strict opt-in (TF_ANE_COLUMNS=0, TF_ANE_INT8=false) avoids regressing M5 Ultra while delivering M5 Pro (1.19x-1.30x) and M3 Ultra (-14.1% / -17.1%) SenseNova-Loop opt-in INT8 speedups.
  • Boxes it reaches: Apple Silicon Metal + Apple Neural Engine: SenseNova-Loop on Apple M3-M5 (AWQ g128 and MLX-affine g64 via requestedOnGeneration(columns, generation) >= 15) plus dense qwen27 checkpoints on Apple M5 tensor-unit Macs (requestedOnChip(columns, tensorUnits())), strictly opt-in (TF_ANE_COLUMNS=0, TF_ANE_INT8=false defaults everywhere).
  • New switch? Default, accepted values, profile row:
    • TF_ANE_INT8: flag (0 or 1, false / "0" / unset by default everywhere including looped checkpoints; 1 or "true" enables W8A8 INT8 ANE weight slices when TF_ANE_COLUMNS > 0).
    • Existing TF_ANE_COLUMNS keeps default_columns = 0 everywhere.
  • Environment, with the TensorFold commit, Zig and backend toolchain, machine and GPU, checkpoint and revision: TensorFold ad4b96c0817206e461b2860042f5ffad4c9e4cda, Zig 0.17.0, Apple M3 Ultra (macOS 26.6.2, applegpu_g15, tensor_units=false), Apple M5 Pro (64 GiB, macOS 27.2.1), Apple M5 Ultra (512 GiB), and Apple M5 Max (applegpu_g17, tensor_units=true kernel contract), SenseNova-Loop-9B-AWQ-g128, SenseNova-Loop-9B-MLX-Q4-hq, & Qwen3.8-27B-MLX-4bit.
  • Paths and platforms the change reaches, which I ran and which I could not: qwen27 opt-in ANE prefill path, ANE policy/residency accounting, metal/ane.zig MIL/INT8 compilation, and q27_add_ane_bf16 contract (macOS build/host checks, M3 Ultra GPU tf-kernel-contract & serving, M5 Max GPU tf-kernel-contract, M5 Pro serving & admission-guard, and M5 Ultra 27B default-off/opt-in verification completed; non-Apple backends untouched).
  • Exactness, from tools/bench_concurrent.py --alone --serial or token_sha against "draft": false:
    • Apple M3 Ultra SenseNova-Loop-9B-AWQ-g128: #4415 == this PR default-off 100% exact across 20/20 bench_openai.py runs & 5/5 bench_cache.py --require-cold rows (token_sha=eaa68149fc60); this PR opt-in ANE INT8 (TF_ANE_COLUMNS=4096 TF_ANE_INT8=1) matches token_sha=eaa68149fc60 on bench_cache.py, greedy bench_openai.py (fib=2f1d93533424, chat=6545de7bd9dc), and greedy bench_concurrent.py (code=339b36c97870, chat=e8723704c2fc, 0 unequal/failed; T=1.0 1/5 fib and 3/5 chat seeds differ as expected under exact_output_qualified=false).
    • Apple M3 Ultra Qwen3.8-27B-MLX-4bit: 100% exact token_sha & output_sha256 parity across 20/20 bench_openai.py, 5/5 bench_cache.py --require-cold (2bef4621bf99), and bench_concurrent.py (0 unequal/failed).
    • Apple M5 Pro SenseNova-Loop-9B-MLX-Q4-hq: #4415 == this PR default-off 100% exact across 20/20 bench_openai.py and 5/5 bench_cache.py (token_sha=eaa68149fc60); this PR opt-in ANE INT8 (TF_ANE_COLUMNS=6144 TF_ANE_INT8=1) matches token_sha=eaa68149fc60 across all 5/5 bench_cache.py rows, greedy bench_openai.py (fib=21e104d752ff, chat=6d8124a912ce), and greedy bench_concurrent.py (code=b5eabd2f8348, chat=ce0afb1a0d65, 0 unequal/failed; T=1.0 fib 4/5 and chat 3/5 match GPU under exact_output_qualified=false).
    • Apple M5 Pro Qwen3.8-27B-MLX-4bit: bench_cache (sha=6a2395ffd378), bench_concurrent (0 unequal).
    • Apple M5 Ultra Qwen3.8-27B-MLX-4bit: default-off bench_cache (sha=6a2395ffd378), bench_openai (fib=a10c9b848ed9, chat=a06fab348fbe); opt-in TF_ANE_COLUMNS=4096 bench_concurrent alone 2/2 & 8/8 (0 unequal).
  • Main against this branch, same machine and checkpoint, posted before asking for a run on our machines (or why you can't): qwen27 metal: support SenseNova-Loop MLX-affine g64 checkpoints #4415 vs this PR default-off vs this PR opt-in ANE on Apple M3 Ultra, Apple M5 Pro, and Apple M5 Ultra above.
  • Decode speed before and after, from tools/bench_openai.py:
    • Apple M3 Ultra (SenseNova-Loop-9B-AWQ-g128, this PR default-off -> opt-in TF_ANE_COLUMNS=4096 TF_ANE_INT8=1):
      • T=0.0: fib TTFT 0.1500s -> 0.1397s (prefill 93.33 -> 100.20 tok/s, exact token_sha=2f1d93533424); chat TTFT 0.3280s -> 0.2907s (-11.4%, exact token_sha=6545de7bd9dc).
      • T=1.0: chat TTFT 0.3294s -> 0.2811s (-14.7%).
      • bench_concurrent.py (T=0, c=4): chat agg decode 130.1 -> 131.4 tok/s, code agg decode 160.0 -> 162.3 tok/s.
    • Apple M5 Pro (SenseNova-Loop-9B-MLX-Q4-hq, this PR default-off -> opt-in TF_ANE_COLUMNS=6144 TF_ANE_INT8=1):
      • T=0.0: fib 38.09 -> 40.01 tok/s (sha=21e104d752ff), chat 31.54 -> 32.68 tok/s (sha=6d8124a912ce).
    • Apple M5 Ultra (Qwen3.8-27B-MLX-4bit, default-off): fib T=0 46.21 tok/s (sha=a10c9b848ed9), chat T=0 47.19 tok/s (sha=a06fab348fbe); bench_cache decode 47.2 / 45.1 tok/s.
  • Prompt speed before and after: the cold first request's ttft_s from tools/bench_cache.py --require-cold on a long prompt, or "n/a" with the reason when the change cannot reach prompt processing:
    • Apple M3 Ultra (SenseNova-Loop-9B-AWQ-g128, 2,571 prompt tokens, qualified=true, exact token_sha=eaa68149fc60):
      • #4415 -> this PR default-off: first TTFT 3.418s -> 3.421s, repeat [3.380, 3.454]s -> [3.374, 3.377]s (parity).
      • this PR default-off -> this PR opt-in (TF_ANE_COLUMNS=4096 TF_ANE_INT8=1): cold first TTFT 3.421s -> 2.938s (-14.1%), repeat TTFTs [3.374, 3.377]s -> [2.806, 2.793]s (-17.1%), concurrent makespan 8.389s -> 7.179s (-14.4%), end_to_end_tps 15.259 -> 17.831 (+16.9%).
    • Apple M3 Ultra (Qwen3.8-27B-MLX-4bit): cold TTFT 6.198s / 6.189s (token_sha=2bef4621bf99, unchanged).
    • Apple M5 Pro (SenseNova-Loop-9B-MLX-Q4-hq, 2,571 prompt tokens, qualified=True, exact token_sha=eaa68149fc60 across all 5 rows):
      • #4415 -> this PR default-off: cold TTFT 4.846s -> 4.774s, repeat [4.717, 4.677]s -> [4.609, 4.648]s.
      • this PR default-off -> this PR opt-in (TF_ANE_COLUMNS=6144 TF_ANE_INT8=1): cold first TTFT 4.774s -> 4.026s (1.19x faster), repeat TTFTs 4.609s -> 3.567s (1.29x faster) and 4.648s -> 3.569s (1.30x faster), concurrent streams=2 makespan 10.819s -> 8.462s (1.28x faster, 11.83 -> 15.13 e2e tok/s).
    • Apple M5 Pro (Qwen3.8-27B-MLX-4bit default-off): cold TTFT 5.193s (token_sha=6a2395ffd378).
    • Apple M5 Ultra (Qwen3.8-27B-MLX-4bit, 2,571 prompt tokens, qualified=True): default-off rep TTFT 1.356s / 1.362s (sha=6a2395ffd378) vs opt-in TF_ANE_COLUMNS=4096 2.04s.
  • Licence of any new weights or drafter, or "n/a": Apache-2.0 (sensenova/SenseNova-Loop-9B weights; no new drafter).
Kernel contract, only when a GPU kernel is new or changed
  • Kernels registered with the contract, and the kernel each one replaces: q27 ane awq q27_add_ane_bf16 (zig/src/core/contract/q27_ane_records.zig, probes metal q27 ane awq add ane only and metal q27 ane awq add gpu+ane in zig/tests/contract/metal_q27_ane.zig, both pass nonfinite, repeat, and shapes on Apple M3 Ultra and Apple M5 Max); new residual-add kernel for ANE FP16 plane output + optional BF16 GPU remainder.
  • A planted control for each new kernel, and each one fails as planted: control: q27 ane awq add nonfinite (Q27_ANE_CTL=1, red at nonfinite, as planted) and control: q27 ane awq add row shift (Q27_ANE_CTL=2, red at shapes, as planted).
  • Each backend's SUMMARY line and exit status:
    • Host (test-metal-launch-map-host): 1164 registered launches, 2 controls, 0 missing, exited 0.
    • Apple M3 Ultra (applegpu_g15, tf-kernel-contract --only "q27 ane", exit 0): SUMMARY 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed; 0 limit problems; gates 18 ms, limits 12 ms (Gate 5: PASS limits here q27 ane awq q27_add_ane_bf16: 256 threads launched, the pipeline takes 1024; 0 threadgroup bytes and 0 set (declared at most 0, the GPU's most 32768)).
    • Apple M3 Ultra (applegpu_g15, tf-kernel-contract --only q27, exit 0): SUMMARY 26 kernels: 26 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed; 0 limit problems; gates 21786 ms, limits 5449 ms.
    • Apple M5 Max (applegpu_g17, tensor_units=true, tf-kernel-contract --only "q27 ane", exit 0): SUMMARY 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed; 0 limit problems; gates 17 ms, limits 421 ms (q27_add_ane_bf16 Gate 5 256 threads, 0 tg_memory, 0 limit problems).
    • Apple M5 Max (applegpu_g17, tf-kernel-contract --only q27, exit 0): SUMMARY 26 kernels: 26 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed; 0 limit problems; gates 19131 ms, limits 5018 ms.
    • Apple M5 Max (applegpu_g17, tf-kernel-contract --only sensenova, exit 0): SUMMARY 24 kernels: 24 pass gates 1-4, 0 fail, 0 known findings; 45 controls: 45 red as planted, 0 missed; 0 limit problems; gates 21568 ms, limits 2160 ms.
  • Chips I could not run: Non-Apple GPUs (Metal-only kernel); Apple M3 Ultra (applegpu_g15) and Apple M5 Max (applegpu_g17) both ran and passed.

Checklist

  • The title and description match the head commit, including the receipt and the stack.

  • New tests fail before the change, pass after it, and skip cleanly without their dependency.

  • Comments and docstrings are one line. No measurements or history in the source.

  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.

  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.

  • No precision traded for speed. If the bits change, the description says which sums change and why.

  • Decode and prompt processing are no slower than main at one stream and the widest admitted; with --drafter, no slower than without it, greedy and sampled

@AIFlowML

Copy link
Copy Markdown
Contributor

I checked the stack on main 308d5e1fd. Published heads 5f664cef7 (#4415) and 277865bcb (#4416) each trial-merge into that main individually. Merging the two published heads together conflicts in zig/src/families/qwen27/qwen27.zig and zig/tests/contract/metal_main.zig. The two heads carry the same MTP residency follow-up patch.

I tested a narrower restack in scratch. I merged #4415 into main first, then used git merge-tree --write-tree --merge-base=7579e9008 <trial-parent> 72584d60f to apply just the ANE feature delta. This merged cleanly. On M5 Max with Zig 0.17.0, all five tests in zig build test-qwen27-ane-policy-host test-environment-host -Dcpu=apple_m1 -j4 --summary all for the ANE policy target passed. The environment target reported 31/32 on both the trial and main. Both fail the same Flash Next inventory assertion, which expects 24 switches and finds 25.

Once #4415 lands, replaying the ANE delta onto that parent looks like a clean route. The scratch check covered host policy and the stack shape. Live ANE and device gates would still need receipts on the resulting head.

Igor Lessio - AIFLOW LABS

@ashhart
ashhart force-pushed the qwen27-metal-ane-int8 branch from 277865b to 9be67b2 Compare November 23, 2026 18:45
@ashhart

ashhart commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thanks @gilby for the careful Neural Engine work and for keeping it off by default. We can't take the ANE slices, because TensorFold takes no lossy weight formats and no mode that can change output tokens, even opt-in.

With TF_ANE_INT8=1, quantRows in ane_awq.zig re-quantizes each weight row to int8 on one amax / 127 scale, so the weights no longer match the checkpoint. The fp16 path also rounds the weights and runs the FFN in fp16, and ane_policy.zig marks it as not qualified for exact output.

This does not affect your GPU work. The SenseNova-Loop BF16, AWQ, MLX-affine and native MTP changes stay in #4415, and review can continue there.

  • Synthena

@ashhart

ashhart commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Thanks @gilby for keeping the Neural Engine share off by default. That default and the chip gates are confirmed, but the precision objection remains: INT8 mode creates new row scales and codes, while the FP16 path and fallback add weight and FFN rounding. Neither target mode can land as is, even opt-in. The qualification flag is logged rather than enforced.

There is also a cleanup issue in the new contract collector: if the kernel-list append fails after the owning append, the probe is freed but its pointer remains owned. Please make that transfer transactional. The separate GPU work can continue through its own review.

  • Synthena

@ashhart

ashhart commented Nov 25, 2026

Copy link
Copy Markdown
Owner

@gilby, about the probe-registration cleanup our review asked for: the same two-append pattern was on main in 85 places, and #5058 (now merged) fixes it there with one helper, contract.register. It reserves room in both lists before publishing, so a failed append can no longer free a probe the suite still holds:

errdefer p.deinit(); // with errdefer s.a.destroy(p) after create, as the suite's teardown frees it
try ct.register(s.a, &s.probes, &s.kernels, p, p.kernel());

Using it for this PR's new suites closes that item. zig/src/core/contract/register_test.zig shows the failure cases it covers.

  • Synthena

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants