Skip to content

xpu: a Gen12LP server builds without the Qwen3.8-27B runner, and nem_prow gets an 8 x 4 image (stacked on #1673) - #1692

Merged
ashhart merged 3 commits into
ashhart:mainfrom
jschmied:xpu-gen12lp-native
Nov 3, 2026
Merged

ashhart merged 3 commits into
ashhart:mainfrom
jschmied:xpu-gen12lp-native

Conversation

@jschmied

Copy link
Copy Markdown
Contributor

Problem

After #1673, zig build xpu-spirv works for Gen12LP (Iris Xe, DG1), but zig build xpu-native -Dxpu-device=tgllp still fails, on main as well. The Qwen3.8-27B XPU runner is always compiled into the server, and its kernels need DPAS, 2D block loads and the nGEN headers.

Change

  • The Qwen3.8-27B runner: a server built with -Dxpu-dpas=false leaves it out. DPAS builds are unchanged: bmg's xpu-native builds with it, 34.1 MB against 29.3 MB without.
  • nem_prow: gets a Gen12LP prompt image, nem_prow_gen12, with 8 × 4 tiles (-DPO=4).
    • A sweep on Iris Xe at a 1,024-token prompt, 2 runs per cell (prefill tok/s):

      tiles (PR × PO) W 32 W 64 W 128
      8 × 4 73.3 79.2 84.2
      4 × 4 73.3 78.2 81.6
      2 × 4 77.2 81.4 83.3
      8 × 8 35.6 35.5 36.5
    • 8 × 4 at windows of 128 beats 4 × 4 at 64 by 8 % in an interleaved A/B (84.4 / 84.0 / 85.2 against 77.4 / 78.6 / 78.6 tok/s), and the output is byte-equal.

Checks

  • Iris Xe (WSL2): xpu-native -Dxpu-device=tgllp builds; the nem_attn_dec op test passes.
  • bmg: the 14 existing SPIR-V images are byte-equal to main; nem_prow_gen12 is the one new image.
  • Spark: lean reports no new findings; zig build test, the contract, golden, security and fuzz steps pass; git diff --check is clean.

Stacked on #1673.

@ashhart

ashhart commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied. This needs a rebase onto current main, which now serves Gemma 4 E4B on the XPU lane host (gemma4 in
native/xpu.zig's families and its own engine module in build/xpu.zig). Main's build says the Gemma 4 runner
also needs nGEN. In a -Dxpu-dpas=false build, should Gemma 4 be left out like the 27B runner, with the refusal
naming it? And is #1673 meant to land first, so that this PR is only its last two commits?

@jschmied

jschmied commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @ashhart. Rebased onto main and pushed: 6018304a2. With #1672 and #1673 merged, this PR is now its last two commits only:

  • 093df6223 xpu: a server without DPAS leaves the Qwen3.8-27B runner and Gemma 4 E4B out, and nem_prow gets a 4 x 4 tile image for Gen12LP
  • 6018304a2 xpu: the Gen12LP prompt image takes 8 x 4 tiles (nem_prow_gen12)

Gemma 4 without DPAS. Yes, it is left out like the 27B runner. With -Dxpu-dpas=false, build/xpu.zig doesn't import the Gemma 4 engine, native/xpu_nem.zig leaves its spec out, and families lists nemotron_h only. Opening gemma4 or qwen3_5 in that build is refused by name: "this XPU build (no DPAS) serves Nemotron-H (nemotron_h, MLX 4/64), not gemma4: Qwen3.8-27B and Gemma 4 E4B need DPAS (-Dxpu-dpas=true)". The host test draft_sources_xpu_test.zig imports both engines, so its module gets both options set to true.

Checks

  • bmg (-Dxpu-device=bmg): xpu-spirv and xpu-native build. All 14 of main's SPIR-V images are byte-equal; nem_prow_gen12 is the only new one. families is qwen3_5, nemotron_h, gemma4, and a gemma4 config is dispatched to the Gemma 4 engine.
  • tgllp (-Dxpu-device=tgllp -Dxpu-dpas=false): install xpu-spirv xpu-tests xpu-native build. Both refusals read as above.
  • Iris Xe: nem_attn_dec ok, the memory test ok, smoke PASS, and nem_prow_gen12 28/28 bit for bit against the one-row kernels.
  • Spark: zig build test, the contract, golden, security and fuzz steps, and test-draft-xpu-host pass. Lean has 0 new problems, and git diff --check and fmt are clean.

Two things on main, not from this PR:

  • zig build test-slide-xpu-host doesn't compile at 1dfc78c55. Its empty kernel table has no rows, which gemma4/xpu_forward.zig:147 now uses.
  • On a DPAS build, the refusal for an unknown model type still lists only Qwen3.8-27B and Nemotron-H, not Gemma 4.

@ashhart

ashhart commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied, both asks are answered: without DPAS the build leaves out the 27B runner and Gemma 4 E4B, and its refusal names both. It's two commits on main now that #1672 and #1673 are in. This lands now; it's gated and queued, and we've written the changelog line.

jschmied and others added 3 commits November 3, 2026 01:54
…E4B out, and nem_prow gets a 4 x 4 tile image for Gen12LP

The Qwen3.8-27B runner and Gemma 4 E4B need DPAS, 2D block loads and nGEN, so `zig build xpu-native -Dxpu-device=tgllp`
could not build. With -Dxpu-dpas=false the server is built without both, lists only the families it built, and
refuses qwen3_5 and gemma4 naming DPAS; a bmg build is unchanged and still carries them.

nem_prow.cl's PR and PO become overridable; the new image nem_prow_t4 (-DPR=4 -DPO=4) spills about
25 registers on Gen12LP where the 8 x 8 pdense spills about 210. The 14 existing bmg images stay
byte-equal to main.
A sweep of nem_prow's PR and PO over {2, 4, 8} on Iris Xe (LFM3-1.7B prefill, 1,024 tokens, windows of
32, 64 and 128 rows) puts 8 prompt rows by 4 outputs a sub-group first: about 8 % above 4 x 4, while
PO 8 spills (8 x 8: about 210 registers, 4 x 8: about 575) and runs 2 to 10 times slower. The image is
renamed for what it is for; every pdense output sums as before, so the bits do not change. The 14
existing bmg images stay byte-equal to main.
@ashhart
ashhart force-pushed the xpu-gen12lp-native branch from 6018304 to 94a823d Compare November 3, 2026 01:55
@ashhart
ashhart merged commit 94ab30f into ashhart:main Nov 3, 2026
2 of 7 checks passed
@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Landed as 94ab30f. Thanks @jschmied!

@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

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.

2 participants