Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/serve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,12 @@ Launch launch_for(const Options& o, const std::string& device, int child_port) {
"-m", o.model, "--host", "127.0.0.1", "--port", std::to_string(child_port),
"--device", device == "hrx" ? "HRX0" : "Vulkan0", "-ngl", "99", "--jinja"};
if (o.ctx_size > 0) { argv.push_back("-c"); argv.push_back(std::to_string(o.ctx_size)); }
else if (device == "hrx" && !split) {
// HRX0's flash attention takes at most 32768 KV tokens. At a model's full context
// (262144 for Qwen3-Coder-30B-A3B) HRX0 declines it, llama.cpp turns flash attention
// off for the whole model, and HRX0's path without it fails on MoE graphs (#95)
argv.insert(argv.end(), {"-c", "32768"});
}
if (split) {
argv.insert(argv.end(), {"-fa", "on"});
env.push_back("ONEBIT_PREFILL_DEVICE=HRX0");
Expand Down
2 changes: 1 addition & 1 deletion docs/PORTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Each step below is one PR (or a short series) that builds and runs on Strix Halo
| 3x | **35B MoE on the NPU (experimental, closed source).** Qwen3.6-35B-A3B on the NPU | the private `1bit-MONSTER/npu-kernels` repository | **landed as a private add-on** ([docs/npu.md](npu.md#private-routes)): built into `1bit` with `-DONEBIT_NPU_PRIVATE`; parity against the fp64 reference passes (3 positions, argmax 846 / 198 / 3710), 16.3-16.5 tok/s decode, and `1bit serve --device npu` answers "The capital of France is Paris." Without the add-on, `serve` says the route is not part of the build |
| + | **Linux kernel.** The kernel that provides `amdxdna` and `amdgpu`, pinned to upstream | `torvalds/linux` release tags; config from the Strix Halo kernel of 2026-09-23 | **pinned** ([docs/kernel.md](kernel.md)): v7.3-rc4 builds into Debian packages with `amdxdna` in-tree; kept current by `bump-linux.yml`. Installing it on Strix Halo is a separate, deliberate step |
| 4 | **Laya router.** A non-autoregressive scorer that picks where each request runs | `src/laya_scorer.cpp`, `include/laya_scorer.h` on `backup/laya-and-results-2026-09-22`; model at `~/models/laya` | **landed, opt-in** ([docs/laya.md](laya.md)): source `NandhaKishorM/laya` + the three HF checkpoints pinned, hash-verified fetch, `bump-laya.yml` (#18); the C++ scorer matches the Python reference on the root and `typed-decisions/` checkpoints (max logit diff 8.6e-6, same argmax) and `1bit serve --device auto --laya-model <dir>` routes each request (#90). Load 2.8 s once, then 0.38 s per decision (was 8.75 s, #91). Next: `multilingual/` (mmBERT-base) |
| 5 | **Every HF model, kept current.** The architecture registry and the daily HF census that finds new architectures and ranks the unmapped ones by model count (1bit-MONSTER's registry mapped 2,030 HF arch strings to its own kernels; here the backends' pinned code decides) | `src/model_registry*.cpp`, `Testing/census_*.py` and `.json`, `.github/workflows/census-{watch,sweep,autopr}.yml` | **landed** ([docs/registry.md](registry.md)): `registry/architectures.json` generated from the pinned llama.cpp, HRX fork and ZINC (265 HF architectures); `census.yml` sweeps HF daily. First sweep: 415,414 text-generation models, mapped 93.28%, checked 64.18% of those with an architecture (reported separately). HRX fails Qwen3-Coder-30B-A3B and GLM-4.7-Flash with a compute error |
| 5 | **Every HF model, kept current.** The architecture registry and the daily HF census that finds new architectures and ranks the unmapped ones by model count (1bit-MONSTER's registry mapped 2,030 HF arch strings to its own kernels; here the backends' pinned code decides) | `src/model_registry*.cpp`, `Testing/census_*.py` and `.json`, `.github/workflows/census-{watch,sweep,autopr}.yml` | **landed** ([docs/registry.md](registry.md)): `registry/architectures.json` generated from the pinned llama.cpp, HRX fork and ZINC (265 HF architectures); `census.yml` sweeps HF daily. First sweep: 415,414 text-generation models, mapped 93.28%, checked 64.18% of those with an architecture (reported separately). HRX fails GLM-4.7-Flash (#95) |
| 6 | **ZINC (NVIDIA and more).** Upstream `zolotukhin/zinc`, a Zig GGUF engine with Vulkan, ROCm, CUDA and Metal backends; its CUDA backend reaches NVIDIA GPUs (Ada `sm_89`, Blackwell `sm_120`) | not in 1bit-MONSTER; pinned from upstream `main` | **pinned** ([docs/zinc.md](zinc.md)): `scripts/build-zinc.sh` builds it privately; the Vulkan build gives 12095 (" Paris") at 295 tok/s on Strix Halo; the CUDA build answers " Paris." at 167–173 tok/s on an RTX 5090 (Qwen3.5-9B); kept current by `bump-zinc.yml`. `1bit serve --device zinc` runs it (`-DONEBIT_ZINC=ON`, e2e passes) |

## How the pieces fit
Expand Down
14 changes: 9 additions & 5 deletions docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,24 @@ At the current pins: 265 HF architectures, vulkan 265, hrx 246, zinc 44, npu 1.
`registry/check_models.tsv` and records the result in `registry/checked.json`, failures
included. The architecture recorded is the one the backend loads: the GGUF
`general.architecture`, or the NPU directory's `model_type`. Checked on Strix Halo
2026-09-25, engine `8c2805d`:
2026-09-25, engine `8c2805d` (hrx rows at `c19b066`):

| GGUF architecture | Model | vulkan | hrx | zinc | npu |
|---|---|---|---|---|---|
| `qwen3` | Qwen3-0.6B | pass | pass | pass | pass |
| `qwen2` | Qwen2.5-7B-Instruct | pass | pass | fails: no answer | |
| `qwen3moe` | Qwen3-Coder-30B-A3B | pass | fails: compute error | pass | |
| `qwen3moe` | Qwen3-Coder-30B-A3B | pass | pass | pass | |
| `qwen35moe` | Qwen3.6-35B-A3B Q8_0 | pass | pass | pass | |
| `deepseek2` | GLM-4.7-Flash | pass | fails: compute error | not mapped | |
| `minicpm` | MiniCPM4-8B | pass | pass | not mapped | |
| `llama` | MiniCPM5-1B | pass | pass | fails: no answer | |

The two HRX compute errors reproduce on a second run. Both are MoE models, and the chat
request itself fails with HTTP 500 "Compute error."
GLM-4.7-Flash on HRX fails with HTTP 500 "Compute error." (#95). Its attention heads (576)
are wider than HRX0's flash attention takes (512), so llama.cpp runs the model without flash
attention, a path HRX0 cannot compute. HRX0 also claims the model's sigmoid MoE router
nodes, which only its softmax top-8 router dispatch can run. Qwen3-Coder-30B-A3B failed the
same way until `--device hrx` defaulted the context to 32768: at the model's full 262144,
HRX0 declines flash attention too.

## The census

Expand All @@ -81,7 +85,7 @@ The first full sweep, 2026-09-25:
| Backend | Mapped | Checked |
|---|---|---|
| vulkan | 93.28% | 64.18% |
| hrx | 93.19% | 63.39% |
| hrx | 93.19% | 63.91% |
| zinc | 69.69% | 10.28% |
| npu | 9.29% | 9.29% |

Expand Down
5 changes: 5 additions & 0 deletions docs/serve.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ PM4-emulation probe, and then HRX registers no device. `serve` sets
`IREE_HAL_AMDGPU_LIBHSA_PATH` itself unless you did. It uses `--hrx-libhsa`,
else the build's copy, else the first one under `/opt/rocm-therock`.

Without `--ctx-size`, `--device hrx` runs with a 32768-token context. HRX0's flash
attention takes at most 32768 KV tokens. At a model's full context, HRX0 declines it and
llama.cpp turns flash attention off for the whole model. HRX0 cannot compute that path on
MoE models (Qwen3-Coder-30B-A3B failed with "Compute error.", #95).

The child binaries default to this build's (`-DONEBIT_HRX`, `-DONEBIT_ZINC`),
then `$ONEBIT_LLAMA_SERVER` / `$ONEBIT_ZINC`, then `llama-server` / `zinc` on PATH.

Expand Down
4 changes: 2 additions & 2 deletions registry/census.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
},
"hrx": {
"mapped": 309915,
"checked": 210820,
"checked": 212535,
"mapped_pct": 93.19,
"checked_pct": 63.39
"checked_pct": 63.91
},
"zinc": {
"mapped": 231768,
Expand Down
24 changes: 10 additions & 14 deletions registry/checked.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"hrx: streams (1 chunks)"
],
"date": "2026-09-25",
"engine": "8c2805d977eb"
"engine": "c19b0665dec9"
},
{
"backend": "vulkan",
Expand All @@ -32,7 +32,7 @@
"said": "The capital of France is Paris.",
"failed": [],
"date": "2026-09-25",
"engine": "8c2805d977eb"
"engine": "c19b0665dec9"
},
{
"backend": "vulkan",
Expand Down Expand Up @@ -65,7 +65,7 @@
"said": "Paris",
"failed": [],
"date": "2026-09-25",
"engine": "8c2805d977eb"
"engine": "c19b0665dec9"
},
{
"backend": "vulkan",
Expand All @@ -85,7 +85,7 @@
"said": "Paris",
"failed": [],
"date": "2026-09-25",
"engine": "8c2805d977eb"
"engine": "c19b0665dec9"
},
{
"backend": "vulkan",
Expand Down Expand Up @@ -121,7 +121,7 @@
"said": "Paris.",
"failed": [],
"date": "2026-09-25",
"engine": "8c2805d977eb"
"engine": "c19b0665dec9"
},
{
"backend": "npu",
Expand Down Expand Up @@ -161,7 +161,7 @@
"said": "Paris",
"failed": [],
"date": "2026-09-25",
"engine": "8c2805d977eb"
"engine": "c19b0665dec9"
},
{
"backend": "vulkan",
Expand All @@ -187,15 +187,11 @@
"backend": "hrx",
"model": "Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf",
"arch": "qwen3moe",
"passed": false,
"said": "<no content: {\"error\":{\"code\":500,\"message\":\"Compute error.\",\"type\":\"server_error\"}}>",
"failed": [
"hrx: answers Paris",
"hrx: reply names e2e-model",
"hrx: streams (3 chunks)"
],
"passed": true,
"said": "Paris",
"failed": [],
"date": "2026-09-25",
"engine": "8c2805d977eb"
"engine": "c19b0665dec9"
},
{
"backend": "vulkan",
Expand Down
Loading