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.

Hy4 serve: ship the five Strix decode levers on (HY4_DENSE_V2, HY4_MOE_V2, HY4_DRAFT_MOE_TILES, HY4_DRAFT_MLA_BG, HY4_DRAFT_IX_GV)

YanissAmz6c0111a83ff7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a07675f..09b7491 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,7 @@
## Unreleased (1.9.3)
-- Decode levers, all opt-in (`=1` to enable, code default `0`), each with a fires counter printed after the load warm-up (`FIRES <name> {...}`, `loader/lever_fires.py`) and a CPU test (`tests/test_hy4_seta_levers_cpu.py`):
+- Decode levers, shipped on in `SHIPPED_ENV` (`HY4_<FLAG>=0` restores 1.9.2; code default `0`), each with a fires counter printed after the load warm-up (`FIRES <name> {...}`, `loader/lever_fires.py`) and a CPU test (`tests/test_hy4_seta_levers_cpu.py`):
`HY4_DENSE_V2` (column-tiled few-row Q8_0 dense GEMV, `gm_dense_q8`, bit-identical to the stock kernel; rebuild `exl3_gm_ext` with `tools/hy4/install_strix.sh`),
`HY4_MOE_V2` (routed experts through the HIP code object `moe_dec.co`, built by `install_strix.sh` step 2b, `MOE_DEC_CO` overrides the path),
`HY4_DRAFT_MOE_TILES`, `HY4_DRAFT_MLA_BG`, `HY4_DRAFT_IX_GV` (draft MTP layer: int8 expert tile retune, Q8 absorb matrices, indexer mat-vec).
diff --git a/doc/env_vars.md b/doc/env_vars.md
index 43c81e5..110cbc7 100644
--- a/doc/env_vars.md
+++ b/doc/env_vars.md
@@ -1079,15 +1079,15 @@ Hy4-flash server only. `tools/hy4/serve.py` sets these in `SHIPPED_ENV` without
| `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` |
-Hy4-flash 1.9.3 decode levers: all five are opt-in (code default `0`, not in `SHIPPED_ENV`). Each one has a fires counter (`loader/lever_fires.py`), printed as one `FIRES <name> {...}` line after the load warm-up; a flagged lever that shows no hit, or any fallback reason, is not in effect (counters are python-side: they count graph capture and eager call sites).
+Hy4-flash 1.9.3 decode levers: all five are shipped on in `SHIPPED_ENV` (the code default of each module stays `0`; `HY4_<FLAG>=0` restores 1.9.2). `HY4_DENSE_V2` and `HY4_MOE_V2` need the rebuilt kernels (`install_strix.sh`), else they fall back and the fires line shows why. Each one has a fires counter (`loader/lever_fires.py`), printed as one `FIRES <name> {...}` line after the load warm-up; a flagged lever that shows no hit, or any fallback reason, is not in effect (counters are python-side: they count graph capture and eager call sites).
| Flag | Default | Effect | Fires counter |
|---|---|---|---|
-| `HY4_DENSE_V2` | `0` | decode: 2..16 rows with K <= 8192 through the column-tiled Q8_0 GEMV `gm_dense_q8` (bit-identical to `fq_gemv_q8_0`); needs `exl3_gm_ext.so` rebuilt by `tools/hy4/install_strix.sh` | `dense_v2 {v2, stock: {reason: n}}` |
-| `HY4_MOE_V2` | `0` | decode: routed experts (16 per row, K = 1536, Q3_K / Q4_K gate-up) through the HIP code object `moe_dec.co` (bit-equal to the shipped grouped kernels); built by `install_strix.sh` step 2b, path override `MOE_DEC_CO` | `moe_v2 {calls, fallback: {reason: n}}` |
-| `HY4_DRAFT_MOE_TILES` | `0` | draft layer: int8 expert tile retune (gate-up 8 x 512, 8 warps; down 16 x 512, 4 warps) | `draft_moe_tiles {calls}` |
-| `HY4_DRAFT_MLA_BG` | `0` | draft layer: absorb matrices `wk_b` / `wv_b` as int8 + fp16 block scales on the batched mat-vec (needs `HY4_MLA_BG=1` and `HY4_MTP_FAST=1`, both shipped on) | `draft_mla_bg {calls}` |
-| `HY4_DRAFT_IX_GV` | `0` | draft layer: indexer fp32 matrices on the router mat-vec (needs `HY4_MTP_FAST=1`) | `draft_ix_gv {gv, gemm: {reason: n}}` |
+| `HY4_DENSE_V2` | `1` | decode: 2..16 rows with K <= 8192 through the column-tiled Q8_0 GEMV `gm_dense_q8` (bit-identical to `fq_gemv_q8_0`); needs `exl3_gm_ext.so` rebuilt by `tools/hy4/install_strix.sh` | `dense_v2 {v2, stock: {reason: n}}` |
+| `HY4_MOE_V2` | `1` | decode: routed experts (16 per row, K = 1536, Q3_K / Q4_K gate-up) through the HIP code object `moe_dec.co` (bit-equal to the shipped grouped kernels); built by `install_strix.sh` step 2b, path override `MOE_DEC_CO` | `moe_v2 {calls, fallback: {reason: n}}` |
+| `HY4_DRAFT_MOE_TILES` | `1` | draft layer: int8 expert tile retune (gate-up 8 x 512, 8 warps; down 16 x 512, 4 warps) | `draft_moe_tiles {calls}` |
+| `HY4_DRAFT_MLA_BG` | `1` | draft layer: absorb matrices `wk_b` / `wv_b` as int8 + fp16 block scales on the batched mat-vec (needs `HY4_MLA_BG=1` and `HY4_MTP_FAST=1`, both shipped on) | `draft_mla_bg {calls}` |
+| `HY4_DRAFT_IX_GV` | `1` | draft layer: indexer fp32 matrices on the router mat-vec (needs `HY4_MTP_FAST=1`) | `draft_ix_gv {gv, gemm: {reason: n}}` |
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.
diff --git a/tests/test_hy4_shipped_flags.py b/tests/test_hy4_shipped_flags.py
index dbcc88c..fc24715 100644
--- a/tests/test_hy4_shipped_flags.py
+++ b/tests/test_hy4_shipped_flags.py
@@ -18,6 +18,11 @@ FLAGS = {
"HY4_GRAPH_FORK": ("exllamav3/loader/hy4_forward.py", "1"),
"HY4_RG_TUNE": ("exllamav3/loader/router_gemv.py", "1"),
"HY4_BG_V2": ("exllamav3/loader/mla_bgemv.py", "1"),
+ "HY4_DENSE_V2": ("exllamav3/loader/hy4_forward.py", "1"),
+ "HY4_MOE_V2": ("exllamav3/loader/hy4_forward.py", "1"),
+ "HY4_DRAFT_MOE_TILES": ("exllamav3/loader/moe_i8.py", "1"),
+ "HY4_DRAFT_MLA_BG": ("exllamav3/loader/mtp_head.py", "1"),
+ "HY4_DRAFT_IX_GV": ("exllamav3/loader/mtp_head.py", "1"),
}
diff --git a/tools/hy4/serve.py b/tools/hy4/serve.py
index 36a6b0d..c63510a 100644
--- a/tools/hy4/serve.py
+++ b/tools/hy4/serve.py
@@ -60,6 +60,7 @@ SHIPPED_ENV = {
"HY4_PF_KV_HM": "1", "HY4_PF_QO_HM": "1", "HY4_PF_HC2": "1", "HY4_PF_ROUTER16": "1", # prefill set 3 (1.9.1): head-major CK attention operands, lazy layer residual (3 stream passes per layer), fp16 router logits of prefill rows (only on the HY4_REF_FUSED=0 router path)
"HY4_PF_Q3K_V2": "1", # Q3_K prefill gate-up kernel with packed fp16 decode + aligned dword loads (bit-identical to the old kernel, -0.26 s per 8K chunk; needs the rebuilt gm_ext, else falls back; old kernel when K / 256 is odd)
"HY4_HEAD_Q8": "1", "HY4_GRAPH_FORK": "1", "HY4_RG_TUNE": "1", "HY4_BG_V2": "1", # decode bundle 1 (1.9.1): Q8_0 output head (one resident copy, bf16 freed: -1.8 ms per step), shared-expert branch on a second capture stream (-1.7 ms per round), router mat-vec K block 1024, block-wise absorb kernels; quality gate: full bundle dNLL -0.0029 +- 0.011 vs noise null 0.0156
+ "HY4_DENSE_V2": "1", "HY4_MOE_V2": "1", "HY4_DRAFT_MOE_TILES": "1", "HY4_DRAFT_MLA_BG": "1", "HY4_DRAFT_IX_GV": "1", # decode levers (1.9.3, the Strix lane set; =0 restores 1.9.2): few-row dense Q8_0 GEMV, HIP code object for the routed experts (needs moe_dec.co, else falls back and the FIRES line says so), draft layer int8 tiles / Q8 absorb / indexer mat-vec
"HY4_PF_WOT": "0", "HY4_MOE_HIP": "2", "HY4_PF_CK": "1", "HY4_PF_FUSE": "1", # prefill set 2: shared gm_ext WMMA experts (HY4_GM_EXT), CK MLA core (EXL3_CKMLA_SO), one-pass hc / norm / indexer kernels
}