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.
Python amdapple-siliconcudadeepseekexl3exllamav3glminferencellmllm-inferencelocal-llmnvidiaopenai-apiquantizationqwenrocmstrix-halo
Hy4 serve: apply the TunableOp results, the start-up warm-up and the Q5_K draft head by default
YanissAmzf4105e0ebc6a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 39e5f5a..d66117c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,5 +9,6 @@ Hy4-flash (GGUF Q3_K) on one Strix Halo machine. Numbers: see the benchmark tabl- Long-context decode: exact top-k sparse attend (`HY4_LC_SPARSE`), draft-cache fill with the same selection.- Prefill: fused dequant GEMMs, WMMA expert kernels shared with the GGUF MoE path, CK latent-attention core, dense GEMMs split in pieces of 8192 rows above 8192 rows.- Decode: static-buffer graph step, MTP head from a Q5_K copy of the output head, n-gram rows on top of the drafts, Engram rows prefetched by row.+- The server applies the frozen TunableOp results (`tools/hy4/tunableop_gfx1151.csv`) and a start-up warm-up request by default (`HY4_TUNABLEOP_FILE`, `HY4_WARMUP_TOKENS=0` to skip it), and picks up `head_q5_k.bin` next to the GGUF.- Generic GGUF loader (`EXL3_GGUF_GENERIC=1`, off by default) and its CPU tests.- Context: 128K tokens. Single user (`--slots` is experimental). Greedy decoding only.diff --git a/doc/hy4.md b/doc/hy4.mdindex e3adffd..1eedf74 100644--- a/doc/hy4.md+++ b/doc/hy4.md@@ -34,9 +34,10 @@ Optional: a Q5_K copy of the output head for the MTP drafts (0.255 GB instead of```bashGGML_LIB=/path/to/libggml-base.so python tools/hy4/make_head_bin.py ./hy4/Hy4-flash-Q3_K-00001-of-00002.gguf ./hy4/head_q5_k.bin-export HY4_MTP_HEAD_BIN=$PWD/hy4/head_q5_k.bin```+The server finds `head_q5_k.bin` by itself when it sits next to the GGUF (`HY4_MTP_HEAD_BIN` names another place). The measured line uses this head: without the file the drafts run on the Q8_0 head, a little slower.+## Run```bashdiff --git a/tools/hy4/serve.py b/tools/hy4/serve.pyindex 19d478b..b8452e6 100644--- a/tools/hy4/serve.py+++ b/tools/hy4/serve.py@@ -71,10 +71,18 @@ def check_kernels() -> None:print(f"hy4 serve: WARNING {path} is missing: {what}. Build it with: bash tools/hy4/install_strix.sh", file=sys.stderr, flush=True)-def apply_env(ctx: int) -> None:+def apply_env(ctx: int, model: str = "") -> None:for k, v in SHIPPED_ENV.items():os.environ.setdefault(k, v)os.environ.setdefault("HY4_NOSYNC_CAP", str(((ctx + 64 + 511) // 512) * 512)) # K buffers / token history: fixed for the life of the process+ # the measured line also runs with frozen TunableOp results for the prefill GEMMs and a start-up request that compiles the prefill kernels and captures the decode graphs+ tune = os.path.join(TREE, "tools", "hy4", "tunableop_gfx1151.csv")+ if os.path.isfile(tune):+ os.environ.setdefault("HY4_TUNABLEOP_FILE", tune)+ os.environ.setdefault("HY4_WARMUP_TOKENS", str(min(8493, max(ctx - 128, 0))))+ head = os.path.join(os.path.dirname(os.path.abspath(model)), "head_q5_k.bin") if model else ""+ if os.path.isfile(head): # Q5_K draft head made by tools/hy4/make_head_bin.py, kept next to the GGUF+ os.environ.setdefault("HY4_MTP_HEAD_BIN", head)class State:@@ -381,7 +389,7 @@ def main(argv=None):ap.add_argument("--slots", type=int, default=1, help="concurrent sessions decoded in ONE batched step (1 = the single-request engine behind the lock)")ap.add_argument("--sched-chunk", type=int, default=1024, help="prefill rows per scheduler turn with --slots > 1 (a decode round of the other sessions runs between chunks)")args = ap.parse_args(argv)- apply_env(args.max_ctx)+ apply_env(args.max_ctx, args.model)check_kernels()st = State(args)app = build_app(st)