Repository navigation
Description
I would like to contribute an experimental Intel GPU backend and want to agree the gates before opening pull requests.
What exists
A Linux build, zig build -Dxpu, that runs OpenCL C kernels compiled to SPIR-V (ocloc) through Level Zero on an Intel Arc Pro B70
(Battlemage, 32 GB), using the matrix engine for prompt GEMMs and attention. It is built on the 1.0.2 tree (f8fe17d) and adds no
code under zig/src/lanes/ or to the other families. Results so far, all for one checkpoint (Nemotron 3.5 Lightning 30B-A3B,
MLX 4-bit) on one card:
- Decode 174.8 tok/s from the CLI and 172.5 tok/s through the native server (greedy).
- Cold prefill through the server, exact token arrays, prompt cache off: 0.66 s at 2k, 11.3 s at 32k, 57.4 s at 128k tokens.
- Concurrent replies equal their solo runs (12 of 12 at four streams); drafted/resumed checks do not apply, since no drafts are offered.
- Teacher-forced against the CUDA reference of the same checkpoint: top-1 98.7% over 1,440 positions, every miss listed with margins.
The plan is three stacked pull requests, each with its own receipts:
- The runtime, the Nemotron engine, the
tensorfold-xpuCLI and the checks (no server code). - The
xpulane backend fortensorfold-native serve(registration plus one backend; no scheduler beside the engine). - Qwen3.8-27B in MLX 4-bit, EXL3 and GGUF on the same runtime (its receipts are not finished yet).
Questions
1. The prompt-path versus decode-path arithmetic seam. The contract in CONTRIBUTING.md asks that resumed equals fresh and that
chunks and decode are checked at seams. On this backend a window of up to 16 rows is bit-identical to the same rows decoded
one at a time, and prompt chunk sizes from 32 to 512 rows give bit-identical results and byte-identical recurrent state and KV. The
prefill GEMMs, which use the matrix engine, accumulate in a different order from the single-row decode kernels, so a prompt
prefilled in windows and then decoded differs at rounding scale from the same prompt run row by row (after 640 tokens: worst
conv-state difference 0.68 against a magnitude of 33, next decode steps up to 0.94 in logit, same top-1 on real text). The
reference engine shows the same kind of sensitivity between its own prefill and decode paths. I report this with an independent
FP64 reference per projection class (decode, window and prefill kernels separately). Is that the form of evidence you want for a
seam that is not bit-exact, or should the prompt path be held to the single-row kernels (an 8k prompt takes 51 s token by token against 2.65 s in 512-row windows)?
2. zig/kernels/xpu/ggml_tables.h and the lean checker. The tree adds exactly one problem over the 512 of v1.0.2: a 632-line
generated lookup table (the IQ and K quantization tables of ggml, written by a generator). Could it be added to the generated-file
exemptions in lean_check.py next to unicode_data.zig? If not, a patch that splits it under 600 lines is ready and I will include
it in the third pull request; the compiled output is identical either way.
3. The standard-server baseline. For the receipts I used llama.cpp (build 9c2e0e491, Vulkan, Mesa 25.2.8) on the same card with a
Q4_0 GGUF of the same model, since I have not run mlx_lm or vLLM on this card. Cold prefill 2k to 128k and decode after it are in
the recipe (for example 32k: 41.8 s against 11.3 s here; 128k: 432 s against 57 s). The quantizations differ. Is llama.cpp Vulkan
the baseline you want, or would you rather see llama.cpp SYCL or OpenVINO, which I have not measured?
4. Packaging. The Intel build is opt-in (-Dxpu, Linux, xe driver). It needs the Level Zero loader and the Intel compute runtime
at run time and ocloc at build time; none of them are bundled, and the notices say so. Would you want it in release artifacts, as
a separate build, or only as a documented source build? There is no Intel GPU in CI, so the receipts come from one machine; the host
tests (zig build test) pass except direct_io, which fails on an unmodified 1.0.2 checkout on that machine as well.
5. Shutdown error text. When the server is stopped during a generation, the running stream ends with an error event whose message
is the core's raw name ShuttingDown, while a queued request gets the sentence "the server is shutting down". The raw name comes
from the round-time error path in lane_host.zig. I left it alone so the pull requests do not touch the lane core; would you accept
a small separate change that maps it to the same sentence?
What I will attach
Per pull request: lean count against the pinned baseline, host test counts, before/after tables on one machine with commit, GPU,
OS, checkpoint revision and prompt ids, the failing receipts of the changes that fixed a real failure, memory receipts (host RSS peak
and device allocations), and a scan of the whole tree and history for private paths and identities. Third-party notices cover ggml and
llama.cpp, ExLlamaV3 and MLX. The small reference files are measurements of TensorFold 0.6.4 on CUDA and slices of public text
(wikitext-2, CC BY-SA 3.0); no weight slices are shipped, and the tests skip cleanly when the generated fixtures are absent.
Not claimed: any other card, 16 GB cards (the weights alone are 17.3 GiB), drafts or exact widths above 1 on this backend.
Activity
ashhart commentedon Oct 10, 2026
Thank you, @BHCC2025, for agreeing the gates first and for the teacher-forced receipts. Answers to your five questions:
ggml_tables.h. It's generated from llama.cpp's source, which we don't take (more in Qwen3.8-27B on Intel Arc: MLX 4-bit, EXL3 and GGUF (experimental) #550).-Dxpuonly, marked experimental, and not in the release archives, since nothing in our gates can run it.ShuttingDownerror. If a stopped generation still ends with a raw error name after the rebase, a small separate PR that maps it to the sentence is welcome.The plan continues in #523, #547 and #550, so we'll close this issue as answered.