Skip to content

Vulkan out, stage 1: HRX is the default GPU route, long documents go to ROCm, Windows runs on the CPU - #270

Merged
bong-water-water-bong merged 1 commit into
mainfrom
vulkan-out
Oct 1, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
vulkan-out

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

This is stage 1 of taking Vulkan out of the engine. RFC #213's decode gates passed (HRX is within 10% of Vulkan on all four gate models), and this follows the owner's decisions of 2026-10-01.

What changes

  • --device auto for a .gguf now picks HRX in builds that have it. A few features still keep Vulkan under auto until stage 2: --moe-slots, and --parallel on gated delta-net models (Qwen3.5/3.8/Next). Builds without HRX, such as CI, keep Vulkan.
  • Laya:
    • The candidates are now HRX, the lean ROCm build and ZINC, where the build has them.

    • The built-in policy sends code, prose and short replies to HRX, and long documents to ROCm.

    • The long-document row rests on today's llama-bench run of Qwen3.8-27B UD-Q4_K_XL:

      Route pp512 pp2048
      ROCm 365-368 tok/s 351-354 tok/s
      HRX 97-99 tok/s 97-99 tok/s
  • New --device cpu: llama-server with no GPU layers.
  • Windows:
    • auto picks cpu, and the Windows package ships a CPU-only llama-server.exe.
    • The build no longer fetches the Vulkan headers, loader export list or SPIR-V headers, and no longer needs glslc.
    • Tested under Wine 11: no vulkan-1.dll import, auto chose cpu, and Qwen3-0.6B Q4_K_M answered correctly at 70-73 tok/s. Nothing was left running after stopping.
  • ONNX: the WebGPU build (Dawn over Vulkan) is removed: build-onnx.sh, the Dawn entry in NOTICE, and docs/onnx.md.

Tests

  • New tests/device_route.sh: --device cpu runs with no GPU layers and no device flag, and auto picks HRX0 in an HRX build and Vulkan0 otherwise.
  • All 16 tests that need no GPU pass.

What comes next

  • Stage 2 ports to HRX, or drops, everything that still needs Vulkan:
    • --moe-slots;
    • --parallel on delta-net models;
    • --adaptive;
    • the RAG embed/rerank servers;
    • --long-model's short side;
    • --lean ROCmFP4.
  • Stage 3 removes the Vulkan build and its pin.

🤖 Generated with Claude Code

…to ROCm, Windows runs on the CPU

RFC #213's decode gates passed (HRX within 10% of Vulkan on the four gate
models). Following the owner's decisions of 2026-10-01:

- `--device auto` for a .gguf means HRX in a build with HRX. What HRX does
  not run yet keeps Vulkan under auto until stage 2 ports or drops it:
  --moe-slots, and --parallel on gated delta-net models. A build without HRX
  (CI) keeps Vulkan.
- Laya: the candidates are HRX, the lean ROCm build and ZINC where the build
  has them. The built-in policy sends code/prose/short to HRX and long_doc to
  ROCm: Qwen3.8-27B UD-Q4_K_XL, llama-bench, 2026-10-01, ROCm 365-368 tok/s
  pp512 and 351-354 pp2048, HRX 97-99.
- New `--device cpu`: llama-server with no GPU layers. It is the Windows
  package's route (auto there). scripts/build-windows.sh builds a CPU-only
  llama-server.exe and no longer fetches Vulkan-Headers, the loader export
  list or SPIRV-Headers; glslc is no longer needed. Tested under Wine 11: no
  vulkan-1.dll import, auto -> cpu, Qwen3-0.6B Q4_K_M answers at 70-73 tok/s.
- The ONNX Runtime WebGPU build (Dawn over Vulkan) goes: build-onnx.sh,
  NOTICE (Dawn), docs/onnx.md.
- tests/device_route.sh (ctest device_route): --device cpu argv, and auto =
  HRX0 with HRX, Vulkan0 without. All 16 no-GPU tests pass.
- Docs: serve.md, hrx.md, laya.md, windows.md, onnx.md, README.

Stage 2: --moe-slots, --parallel on delta-net models, --adaptive, the RAG
embed/rerank servers, --long-model's short side and --lean ROCmFP4 still use
Vulkan; each gets ported to HRX or dropped. Stage 3 removes the Vulkan build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@context7

context7 Bot commented Oct 1, 2026

Copy link
Copy Markdown

Docs7 for 1bit-monster/engine

Result Status Action
Deployment ➖ Not used —
Content review ➖ Did not run. This site has no agent runs available this month. Wait for the monthly reset or check your Docs7 plan. —

Commit 4579039

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect Device Handling for --prefill-device

The logic for handling --prefill-device hrx with --device cpu is flawed. When --device cpu is used, the code throws an error if --prefill-device hrx is also specified, but this check is placed after the device selection logic, which means it can be bypassed in some cases. This could lead to unexpected behavior or incorrect device assignments.

if (device == "cpu") {
    if (split) throw std::runtime_error("--prefill-device hrx works with --device vulkan");
    argv.insert(argv.end(), {"-ngl", "0", "--jinja"});
Potential Incorrect Default Device on Windows

On Windows, the auto_gguf_device function returns "cpu" unconditionally, which is correct for the current build. However, if future builds introduce HRX support for Windows, this code path will need to be updated to properly detect and use HRX when available, otherwise it will always default to CPU.

#if defined(_WIN32)
    (void)o;
    return "cpu";  // no GPU route on Windows yet (docs/windows.md)
#elif defined(ONEBIT_HRX_SERVER)
Missing Vulkan Dependency Check

The Windows build script no longer fetches Vulkan headers, loader export list, or SPIR-V headers, and no longer needs glslc. However, the script does not explicitly verify that these dependencies are not needed in the current build context, which could lead to confusion if someone tries to build a Vulkan-enabled version later.

# from the llama.cpp pin (third_party/llama.cpp-vulkan, until it is renamed), <out-dir>/llama-server.exe
# on the CPU; and from third_party/ryzenai-server, <out-dir>/ryzenai-server.exe with Microsoft's ONNX
# Runtime GenAI and ONNX Runtime DLLs (--device onnx, CPU). 1bit.exe finds its backends beside it.
# The Windows package has no GPU route for now: the engine's GPU route is HRX, which has no Windows
# build yet, and Vulkan is leaving the engine (RFC #213, docs/hrx.md). Everything it downloads is
# pinned and checked against its sha256: llvm-mingw (clang 23: the engine is C++26) and PCRE2 (the

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

BLOCKING (PR-Agent duty): please don't merge until the first point is fixed. GitHub won't record "request changes" here, because every session shares one account.

The direction is right (RFC #213 decode gates passed, and the owner's call), and the CPU route for Windows and the ONNX removal are clean.

Blocker: --device auto must not send an architecture HRX can't run to HRX.
auto_gguf_device() returns hrx for every .gguf except the --moe-slots and delta-net --parallel cases. But registry/architectures.json maps 23 of its 323 architectures to Vulkan and not HRX, including two showcase families:

  • Qwen4ExpForCausalLM / Qwen4ExpForConditionalGeneration (Qwen3.8-Flash-Next, the MTP and reduced-draft-vocabulary showcase);
  • ZambaForCausalLM, Zamba2ForCausalLM, Zamba2_VLForConditionalGeneration, BlackMambaForCausalLM (Zyphra's family, from our fork).

The others: BailingMoeV3, Dots3Note (x3), GraniteMoeSWA, GraniteSWA, GraniteSwitch, HYV4, HrmText, KimiK3, Maple, MiniMaxM1, MiniMaxText01, MuseGlimmer, PocketTTS, Qwen3TTS, Spark2_5.

With this PR, the default auto on a Flash-Next or Zamba2 GGUF launches HRX0 for a model it can't load, where today it runs on Vulkan.

Fix: in auto_gguf_device, read the file's architecture and fall back to vulkan when the registry entry's backends lacks hrx. Add a tests/device_route.sh case (a stamped qwen4exp or zamba2 GGUF -> Vulkan0). That's stage 1's own promise: "what HRX does not run yet keeps Vulkan under auto".

Regressions to state in the PR and docs (not blockers, given the owner's decision):

  1. --mtp under auto now runs on HRX, at 65-78% of Vulkan's speed (27B: 22.5/17.7/19.0 vs 34.6/24.3/24.5 tok/s, wiki). Either keep --mtp / --dflash on Vulkan under auto like --moe-slots, or say so in serve.md.
  2. Prompt processing on HRX is about 99 tok/s pp512 for the 27B until fork q4nx: document the two Q8 code layouts behind one chunk size #55 (pp512 99.7 -> 340.7) is pinned. Without Laya, long prompts under auto go to HRX at that speed. Pin q4nx: document the two Q8 code layouts behind one chunk size #55 first or together.
  3. --mmproj (vision) on HRX is one of RFC RFC: HRX (Loom) + NPU, and Vulkan out once HRX meets the gates #213's still-open gates. If HRX can't serve a projector yet, auto with --mmproj should keep Vulkan.

@bong-water-water-bong
bong-water-water-bong merged commit b47e388 into main Oct 1, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the vulkan-out branch October 1, 2026 21:00
bong-water-water-bong added a commit that referenced this pull request Oct 1, 2026
… --mtp and --mmproj (#271)

Follow-up to #270. auto_gguf_device() returned hrx for every .gguf, but
registry/architectures.json maps 17 GGUF architectures (23 HF classes) to
the Vulkan build and not HRX, among them Qwen3.8-Flash-Next (qwen4exp) and
Zyphra Zamba, Zamba2 and BlackMamba. auto now keeps those on Vulkan
(hrx_missing_arch), and keeps --mtp (HRX drafts at 65-78% of Vulkan) and
--mmproj (an open RFC #213 gate) on Vulkan too.

tests/device_route.sh: auto keeps a qwen4exp file, --mtp and --mmproj on
Vulkan0, and serve.cpp's list matches the registry. It passes on this
build (no HRX) and on one compiled with ONEBIT_HRX_SERVER defined (plain
file -> HRX0, the rest -> Vulkan0). ctest -LE gpu: 19/19.

docs/serve.md states the auto exceptions and the HRX prompt speed until
llama.cpp fork #55 is pinned.

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Oct 1, 2026
#270 made HRX the --device auto GPU route in builds with HRX, but four
route tests still expected Vulkan0. They pass in CI (no HRX) and fail on
an HRX build, which is what the Sunday release builds and tests: the
2026-10-01 weekly rehearsal stopped at ctest with hadamard_route,
prism_route, long_route and laya_gguf_route failing.

Each test now reads the build's CMake cache the way device_route.sh does:
HRX0 with ONEBIT_HRX=ON, Vulkan0 without. In laya_gguf_route the test
policy's vulkan rows fall back to hrx, the first candidate of an HRX
build. All four pass against the rehearsal's HRX build on Strix Halo.

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 10, 2026
…to the pool, with a ledger test (#1935)

Moves third_party/llama.cpp 5514ebea4 -> 2d62cc7af (4 fork commits, all ahead):

  e26d574ff  cli: name the backend that registered no device (#273, engine #1766)
  03bee0f73  host staging buffers are charged to the pool (#270, engine #1711)
  92cb7eb2c  the unbounded (default) host-weight path is charged too (#275, engine #1823)
  2d62cc7af  a ledger test for the host-weight arena's charge (#276, engine #1856)

registry/architectures.json: only the recorded source pin moves. None of the
four commits touches the converter, gguf-py constants, llama-arch.cpp or
llama-model.cpp, which are the files the registry is generated from.

Fixes #1856
Fixes #1823

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Fable 5.2 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant