Skip to content

Kyojin: open-source engine that runs 100 GB-class open models (GLM-5.3, Qwen3.8, DeepSeek V4.1) on one desktop machine. AMD Strix Halo, NVIDIA RTX and Apple Mac. OpenAI API, built on ExLlamaV3.

Version 1.9.1: changelog, flag table, README and guide for the Hy4 prefill and decode levers, warm-up clamp and decensor default

YanissAmz99d8b70d0f00
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 13fbb08..cc5dbfa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,8 +1,15 @@
# Changelog
-## Unreleased
+## 1.9.1
+
+Hy4-flash: faster prefill and decode on the same GGUF, decensor preset, warm-up fix. Every lever below ships on and has its own switch: `HY4_<FLAG>=0` in the environment restores the 1.9.0 behaviour of that lever. The flag table is in `doc/env_vars.md`; numbers are in the release notes.
- Decensor preset for Hy4-flash, on by default (`HY4_ABLIT_SPEC=0` switches it off; an explicit path loads another spec): a per-layer run-time edit of the attention and MLP / MoE outputs, no weight change. Files in `presets/hy4-uncensor/`, code in `exllamav3/loader/ablit_hy4.py`.
+- Prefill: lazy layer residual, 3 stream passes per layer (`HY4_PF_HC2`); head-major K / V and Q / O operands for the CK latent-attention core (`HY4_PF_KV_HM`, `HY4_PF_QO_HM`); Q3_K gate-up kernel V2 with packed fp16 decode and aligned dword loads, bit-identical to the old kernel (`HY4_PF_Q3K_V2`; needs the rebuilt MoE extension, which `install_strix.sh` rebuilds; the old kernel runs when the library is older or K / 256 is odd).
+- Decode: Q8_0 output head, one resident copy, the bf16 head is freed (`HY4_HEAD_Q8`); the shared-expert branch runs on a second stream inside the HIP graph (`HY4_GRAPH_FORK`); router mat-vec launch tuning, K block 1024 (`HY4_RG_TUNE`); block-wise absorb kernels, absorb v2 (`HY4_BG_V2`).
+- `HY4_PF_ROUTER16` (fp16 router logits of prefill rows) is shipped on but inactive with the fused router (`HY4_REF_FUSED=1`, the shipped decode path): it changes nothing in the shipped configuration.
+- Warm-up: the start-up warm-up prompt is clamped to the context window, so a small `-c` no longer fails the warm-up; it is skipped, with one log line, when the context is too small to warm anything useful.
+- Test: `tests/test_hy4_shipped_flags.py` checks that every 1.9.1 lever is on in `SHIPPED_ENV`, reads its environment switch with the 1.9.0 behaviour as the code default, and is not overridden when the user sets it.
## 1.9.0: Hy4-flash v1
diff --git a/README.md b/README.md
index b7d9f59..74bf520 100644
--- a/README.md
+++ b/README.md
@@ -41,6 +41,22 @@ python tools/hy4/serve.py --model ./hy4/Hy4-flash-Q3_K-00001-of-00002.gguf --por
At this setting, on a 128 GB machine with nothing else large resident, the server peaked at 102.7 GiB of GTT and kept about 16 GiB of memory free (15 GiB during a 64K prefill); a smaller `-c` leaves more ([doc/hy4.md](doc/hy4.md)). Close other GPU or memory-heavy apps first.
+### New in 1.9.1 (Hy4-flash)
+
+- Prefill: lazy layer residual, head-major attention operands, Q3_K gate-up kernel V2. Decode: Q8_0 output head, shared-expert branch forked inside the HIP graph, router launch tuning, absorb v2.
+- Each lever is on by default and has an environment switch: `HY4_<FLAG>=0` restores the 1.9.0 behaviour ([flag table](doc/env_vars.md), [changelog](CHANGELOG.md)). Rebuild the kernels with `bash tools/hy4/install_strix.sh` after the update.
+- The start-up warm-up now fits any `-c`.
+- The decensor preset is on by default; it edits no weights. Switch it off with `HY4_ABLIT_SPEC=0`.
+
+Served numbers, one Strix Halo machine, shipped settings, seeded prompts, tok/s (speculative decode is the best speculative setting, plain is no speculation, tau is accepted tokens per round):
+
+| depth | prefill 1.9.0 | prefill 1.9.1 | decode spec 1.9.0 | decode spec 1.9.1 | tau 1.9.1 | decode plain 1.9.0 | decode plain 1.9.1 |
+|---|---|---|---|---|---|---|---|
+| 4K | 785 | {{PF4K}} | 22.5 | {{DEC4K}} | {{TAU4K}} | 14.6 | {{PLAIN4K}} |
+| 16K | 869 | {{PF16K}} | 23.7 | {{DEC16K}} | {{TAU16K}} | - | - |
+| 32K | 859 | {{PF32K}} | 22.7 | {{DEC32K}} | {{TAU32K}} | 14.5 | {{PLAIN32K}} |
+| 64K | 842 | {{PF64K}} | 23.9 | {{DEC64K}} | {{TAU64K}} | - | - |
+
RTX 3090 (NVIDIA): build for CUDA once ([tools/cuda/README.md](tools/cuda/README.md)), then Qwen3.8-27B with 245K of context (the served settings, one session), with turboderp's 4.0 bpw pack:
```bash
diff --git a/doc/env_vars.md b/doc/env_vars.md
index ea21198..7e3842d 100644
--- a/doc/env_vars.md
+++ b/doc/env_vars.md
@@ -1063,6 +1063,24 @@ weights. Unset: the preset bundled in the repository is used, from any working d
`false`, `no` and `none` switch it off: no edit is installed. A malformed spec or a missing file stops
the load. The preset is in `presets/hy4-uncensor/`. See [hy4.md](hy4.md).
+#### Hy4-flash 1.9.1 levers (all on by default; `=0` restores 1.9.0)
+
+Hy4-flash server only. `tools/hy4/serve.py` sets these in `SHIPPED_ENV` without overriding a value you set, so `HY4_<FLAG>=0 python tools/hy4/serve.py ...` is the rollback of one lever to the 1.9.0 behaviour. The levers are independent of each other. Guide: [hy4.md](hy4.md).
+
+| flag | default | what | rollback |
+|---|---|---|---|
+| `HY4_PF_HC2` | `1` | prefill: lazy layer residual, 3 stream passes per layer | `HY4_PF_HC2=0` |
+| `HY4_PF_KV_HM` | `1` | prefill: head-major K / V operands of the CK latent-attention core | `HY4_PF_KV_HM=0` |
+| `HY4_PF_QO_HM` | `1` | prefill: head-major Q / O operands of the CK latent-attention core | `HY4_PF_QO_HM=0` |
+| `HY4_PF_Q3K_V2` | `1` | prefill experts: Q3_K gate-up kernel V2 (packed fp16 decode, aligned dword loads, bit-identical output); needs the rebuilt MoE extension, the old kernel runs when the library is older or K / 256 is odd | `HY4_PF_Q3K_V2=0` |
+| `HY4_PF_ROUTER16` | `1` | prefill: fp16 router logits; inactive with the fused router (`HY4_REF_FUSED=1`, the shipped decode path), so no effect in the shipped configuration | `HY4_PF_ROUTER16=0` |
+| `HY4_HEAD_Q8` | `1` | decode: output head as Q8_0, one resident copy (the bf16 head is freed) | `HY4_HEAD_Q8=0` |
+| `HY4_GRAPH_FORK` | `1` | decode: the shared-expert branch runs on a second capture stream inside the HIP graph | `HY4_GRAPH_FORK=0` |
+| `HY4_RG_TUNE` | `1` | decode: router mat-vec with K block 1024 (was 256) | `HY4_RG_TUNE=0` |
+| `HY4_BG_V2` | `1` | decode: block-wise absorb kernels (absorb v2) | `HY4_BG_V2=0` |
+
+The warm-up clamp has no switch. The start-up warm-up prompt (`HY4_WARMUP_TOKENS`, default the smaller of 8493 and `-c` minus 128, also when you set it) is cut to what the context window accepts, and skipped with one log line when that is under 256 tokens. `HY4_WARMUP_TOKENS=0` skips the warm-up.
+
#### `EXL3_ABLIT_TORCH` (default: `0`)
`1` uses the PyTorch projection instead of the Triton kernel. It has no effect when Triton is not
diff --git a/doc/hy4.md b/doc/hy4.md
index f369edc..c33e238 100644
--- a/doc/hy4.md
+++ b/doc/hy4.md
@@ -1,7 +1,7 @@
# Hy4-flash on Strix Halo (GGUF, one machine)
Kyojin loads the public Hy4-flash GGUF (Q3_K split, 2 files, 144 GiB) and serves it on one Strix Halo machine with ROCm. Prefill runs the sparse-attention
-fast path; decode runs a HIP graph with multi-token-prediction (MTP) drafts and prompt-lookup rows. Speed numbers: see the benchmark table in the release notes.
+fast path; decode runs a HIP graph with multi-token-prediction (MTP) drafts and prompt-lookup rows. Speed numbers: see the benchmark table in the README and the release notes.
## Requirements
@@ -46,6 +46,8 @@ curl http://127.0.0.1:8300/v1/chat/completions -H 'content-type: application/jso
-d '{"messages":[{"role":"user","content":"Hello"}],"max_tokens":64}'
```
+The 1.9.1 levers are listed with their rollback switches in the [env_vars.md](env_vars.md) table "Hy4-flash 1.9.1 levers". After updating from 1.9.0 run `bash tools/hy4/install_strix.sh` again (the Q3_K V2 kernel needs the rebuilt MoE extension; without it the old kernel runs).
+
The server speaks the OpenAI API (`/v1/chat/completions`, `/v1/completions`, both with streaming; `/v1/models`, `/health`, `/tokenize`, `/apply-template`).
`tools/hy4/serve.py` runs itself under `tools/strix_halo/env.sh` (the HSA runtime torch needs on gfx1151) and sets the shipped kernel flags (`SHIPPED_ENV` in the file); every one can be overridden from the environment. The main ones:
@@ -65,12 +67,17 @@ The server speaks the OpenAI API (`/v1/chat/completions`, `/v1/completions`, bot
| `HY4_ENGRAM_NPHASH`, `HY4_ENGRAM_PF_WORKERS` | 1, 1 | Engram hash in numpy; one prefetch worker |
| `HY4_ENGRAM_NATIVE_IO` | 1 | Engram row reads in C threads (`pread`, no GIL) |
| `HY4_ENGRAM_FUSED` | 0 | two-launch fused Engram block in decode (opt-in) |
+| `HY4_PF_HC2`, `HY4_PF_KV_HM`, `HY4_PF_QO_HM`, `HY4_PF_Q3K_V2` | 1 | 1.9.1 prefill: lazy layer residual, head-major K / V and Q / O operands of the CK core, Q3_K gate-up kernel V2 (`=0` restores 1.9.0) |
+| `HY4_HEAD_Q8`, `HY4_GRAPH_FORK`, `HY4_RG_TUNE`, `HY4_BG_V2` | 1 | 1.9.1 decode: Q8_0 output head, shared-expert branch on a second graph stream, router mat-vec K block 1024, absorb v2 (`=0` restores 1.9.0) |
+| `HY4_PF_ROUTER16` | 1 | fp16 router logits of prefill rows; inactive with the fused router (`HY4_REF_FUSED=1`, shipped), so no effect |
| `HY4_ABLIT_SPEC` | bundled `presets/hy4-uncensor/edit_spec.json` (on) | path of `edit_spec.json` (tensor file next to it): run-time decensor edit of the attention and MLP / MoE outputs; an explicit path wins; `0`, empty or `off` disables |
Native Engram IO: `exllamav3/loader/engram_io.c` is compiled with `gcc` at first use into `~/.cache/kyojin/engram_io` (`XDG_CACHE_HOME` moves it). When `gcc` is missing or the build fails, the server prints one line and uses the Python reader, which does the same reads more slowly (`HY4_ENGRAM_NATIVE_IO=0` selects it directly).
`--num-draft` is the number of MTP drafts per round (3 by default). Memory: the K buffers are sized by `-c` (about 0.1 MB per position); see Supported context for the measured totals.
+The start-up warm-up prompt is clamped to the context window (and skipped with one log line when the window is too small), so a small `-c` starts normally.
+
## Supported context
64K tokens (`-c 65536`, the command above). Speed and passkey retrieval are measured on the release build at 4K, 16K, 32K and 64K. Longer prompts are refused with a context-length error.
diff --git a/exllamav3/version.py b/exllamav3/version.py
index 0a0a43a..38cf6db 100644
--- a/exllamav3/version.py
+++ b/exllamav3/version.py
@@ -1 +1 @@
-__version__ = "1.9.0"
+__version__ = "1.9.1"