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
qualify: backend paths and eval suite come from the environment or the repo, not fixed host paths
YanissAmz8b7e0d0a4c66
diff --git a/scripts/nanb-dflash-bench.py b/scripts/nanb-dflash-bench.pyindex 7e4ec05..bd97365 100644--- a/scripts/nanb-dflash-bench.py+++ b/scripts/nanb-dflash-bench.py@@ -6,7 +6,7 @@ and a drafted greedy decode on the same rendered prompt, then the token-by-tokenwith the plain path's top-2 logit gap there (a near-tie is the documented caveat of R-row verify numerics).PYTHONPATH=$PWD python scripts/nanb-dflash-bench.py -m ~/models/nanbeige43-33b-exl3-4.0 \- -dm ~/models/drafters/nanb-dflash2-exl3br --template <duel chat_template.jinja> --out /tmp/nanb_dflash.json+ -dm ~/models/drafters/nanb-dflash2-exl3br --template <chat_template.jinja> --out /tmp/nanb_dflash.json"""from __future__ import annotationsdiff --git a/tools/bigconv/DESIGN.md b/tools/bigconv/DESIGN.mdindex a57a082..6b22461 100644--- a/tools/bigconv/DESIGN.md+++ b/tools/bigconv/DESIGN.md@@ -63,4 +63,4 @@ the routing recorder callback is only a hook. `min_expert_tokens` is tested on lWrite volume of the memmap design (printed by the sheet): h is rewritten each layer, X once, Y once to (topk+1) times.DS4.1 at 2M tokens: 246-492 GB per layer, 10-20 TB over 40 layers, footprint 246 GB. The next model trades the 117 GB RAM peak for-a disk-write cliff (box NVMe QLC: about 140 GB sustained). Mitigation, not built: process tokens in blocks so X/Y blocks fit in RAM.+a disk-write cliff (QLC NVMe drives: about 140 GB sustained). Mitigation, not built: process tokens in blocks so X/Y blocks fit in RAM.diff --git a/tools/bigconv/sheet.py b/tools/bigconv/sheet.pyindex 36e7737..a4a3dce 100644--- a/tools/bigconv/sheet.py+++ b/tools/bigconv/sheet.py@@ -229,7 +229,7 @@ def write_line(s: dict, disk_free_gb: float = None) -> str:r = (f"capture writes {lo:.0f}-{hi:.0f} GB per layer, {lo * layers / 1000:.1f}-{hi * layers / 1000:.1f} TB over {layers} MoE layers "f"(footprint {cd['total_gb']:.0f} GB)")if hi > 140:- r += "; above the ~140 GB sustained-write cliff of the box NVMe (QLC): run it on a drive without that cliff or chunk X/Y rows"+ r += "; above the ~140 GB sustained-write cliff of QLC NVMe drives: run it on a drive without that cliff or chunk X/Y rows"return rdiff --git a/tools/qualify/AUTOTUNE.md b/tools/qualify/AUTOTUNE.mdindex 416a725..147fa8f 100644--- a/tools/qualify/AUTOTUNE.md+++ b/tools/qualify/AUTOTUNE.md@@ -20,7 +20,7 @@ Prior work (grep of `git log --all`, REPORT.md, pr_bundles, LEADS 26/10): the ru| MLX (Mac) | Metal | no: module constants (`DENSE_FUSED_MAX` 128->1024, `ROWS_NAX`, `NAX_SMALL_WEIGHTS`, `pick_cfg`, S6 tile per expert count) set per model class in macair24/26 | - | rows / expert count | Mac stage is a profile in `backends.py` when the Ultra arrives; same cache idea (file next to the pack) |Gap: the GEMM cache is **global and untied from the pack**. Every new shape is timed live (stall inside the first requests, or in graph-capture), and there is no way to ship the result: a pack tuned on the author's box tunes again on every other box.+capture), and there is no way to ship the result: a pack tuned on one machine tunes again on every other machine.## 2. Designdiff --git a/tools/qualify/DESIGN.md b/tools/qualify/DESIGN.mdindex 7b64f61..1f5973b 100644--- a/tools/qualify/DESIGN.md+++ b/tools/qualify/DESIGN.md@@ -1,10 +1,9 @@# qualify — one command per backend: converted pack -> verdict + qualify.json-NORTH STAR pillar 2. `python tools/qualify/qualify.py --backend cuda|rocm --pack DIR [--ref BF16_DIR]`+`python tools/qualify/qualify.py --backend cuda|rocm --pack DIR [--ref BF16_DIR]`(MLX later: same stage list, another `backends.py` profile). Zero hand flags: everything comes from the pack.-Prior work reused (copied with attribution, not redone): nanb `ref_stream/kv_kl/mk_docs/bench/agent`, rel174c3 `srch2/drv/bench_n`-(max-ctx search, greedy sha, N=1..4), `gdrv.py` (sha set), `lane-kv-conformance.py` (template rule 1), `startup_health` (/health),-`hermes_opt/eval` (Hermes smoke), drill 0 gap list (NORTH_STAR_ENGINE.md).+Builds on the existing tools: streamed BF16 reference, KV KL, max-context search, greedy sha, N=1..4 bench, the template rule of+`lane-kv-conformance.py`, `/health` start-up checks and a scripted Hermes eval suite.## Stages (each = one resumable unit, `<out>/<stage>.json`, skipped when done and its input fingerprint is unchanged)| # | stage | needs GPU | what | drill-0 gap |@@ -18,8 +17,8 @@ Prior work reused (copied with attribution, not redone): nanb `ref_stream/kv_kl/| 7 | `smoke` | yes (same server) | `--smoke-tasks` hermes_opt/eval tasks through the real Hermes CLI (`run_arm.sh ... --allow-local --jobs 1`); fallback: the nanb scripted tool loop (`smoke_agent.py`) when the eval suite is absent | 6 || 8 | `report` | no | `REPORT.md` + `qualify.json` (schema 1) | - |-Stages 6 and 7 share one server (duel rule: one load per model). Stages 3-7 are grouped in GPU **jobs** by the planner; each job takes-the backend locks (cuda: `rtx1/gpu3090.lock`; rocm: `strix-bench/gpu.lock` then `strixfix/kigpu.lock`, one holder, flock waits), checks+Stages 6 and 7 share one server (one load per model). Stages 3-7 are grouped in GPU **jobs** by the planner; each job takes+the optional lock files of `QUALIFY_LOCKS` (in order, one holder, flock waits), checksMemAvailable >= 4 GiB (and >= the pack's stated host peak for conversions; none here), and releases between jobs. Servers are started andkilled by PID only; readiness = `GET /health` == 200 (never a port check); the server log is scanned for OOM.@@ -54,5 +53,4 @@ GDN/MoE/MLA reference adapters (only dense Llama), MLX profile, Strix real run,- Servers run with `PYTHONPATH=<engine checkout>` (the built extension lives there): `--repo` is that checkout, not the qualify tree.- `standard_cal_data` is also the quantizer's calibration source: the domain docs use late offsets (held-out in practice, not by construction). A trulyheld-out set is a v2 item.-- The hermes_opt/eval copy under duel_src lacks `lib/taskdefs.py`; the duel's copy (pr_bundles/duel/harness/eval) is complete and is found automatically- (`QUALIFY_EVAL_DIR` overrides).+- The Hermes smoke needs an eval suite with `lib/taskdefs.py`: point `QUALIFY_EVAL_DIR` at it.diff --git a/tools/qualify/backends.py b/tools/qualify/backends.pyindex 392ac57..4175226 100644--- a/tools/qualify/backends.py+++ b/tools/qualify/backends.py@@ -1,21 +1,24 @@"""Backend profiles: where the python, the engine, the locks and the GPU counters live. One entry point per backend, same stages.-MLX: add a profile with its own server/lock when the Ultra arrives (stages and report are backend-neutral)."""+MLX: add a profile with its own server and lock (stages and report are backend-neutral)."""from __future__ import annotationsimport os+import sysfrom pathlib import Path-H = Path.home() / "hermes-work"+REPO = Path(__file__).resolve().parents[2]+PYTHON = os.environ.get("QUALIFY_PYTHON", sys.executable)+ENGINE = os.environ.get("QUALIFY_ENGINE", str(REPO))+# Optional GPU lock files (os.pathsep-separated), taken in this order before each server start+LOCKS = [p for p in os.environ.get("QUALIFY_LOCKS", "").split(os.pathsep) if p]PROFILES = {"cuda": dict(- python=str(H / "rtx1/venv/bin/python"), engine=str(H / "rtx1/engine"),- locks=[str(H / "rtx1/gpu3090.lock")], env={"EXL3_CUDA_GRAPH": "1"},- gpu_used_mib="nvidia-smi", host_peak_note="3090 24 GiB",+ python=PYTHON, engine=ENGINE, locks=LOCKS, env={"EXL3_CUDA_GRAPH": "1"},+ gpu_used_mib="nvidia-smi", host_peak_note="NVIDIA device memory",),- "rocm": dict( # not exercised yet (iGPU busy); same stages, locks as in mu_common.md (one holder, this order)- python=str(H / "kyojin-rb/.venv/bin/python"), engine=str(H / "kyojin-rb"),- locks=[str(Path.home() / "strix-bench/gpu.lock"), str(H / "strixfix/kigpu.lock")], env={},+ "rocm": dict(+ python=PYTHON, engine=ENGINE, locks=LOCKS, env={},gpu_used_mib="/sys/class/drm/card1/device/mem_info_gtt_used", host_peak_note="Strix unified memory",),}diff --git a/tools/qualify/load.py b/tools/qualify/load.pyindex ff24ff8..ecd5087 100644--- a/tools/qualify/load.py+++ b/tools/qualify/load.py@@ -10,7 +10,7 @@ import timeimport urllib.requestfrom pathlib import Path-CAL_DIR = Path.home() / "hermes-work/rtx1/engine/exllamav3/conversion/standard_cal_data"+CAL_DIR = Path(__file__).resolve().parents[2] / "exllamav3/conversion/standard_cal_data"CORPORA = ("c4.utf8", "wiki.utf8", "code.utf8", "technical.utf8", "multilingual.utf8")FR = ["Explique en quatre ou cinq phrases pourquoi le ciel est bleu, puis donne une analogie simple.","Écris un court poème sur la mer en six vers, puis explique le choix des rimes.",diff --git a/tools/qualify/smoke.py b/tools/qualify/smoke.pyindex cf32cbf..8ac9121 100644--- a/tools/qualify/smoke.py+++ b/tools/qualify/smoke.py@@ -13,14 +13,12 @@ import timeimport urllib.requestfrom pathlib import Path-EVAL_DIRS = ([Path(os.environ["QUALIFY_EVAL_DIR"])] if os.environ.get("QUALIFY_EVAL_DIR") else []) + [- Path.home() / "hermes-work/hermes_opt/eval", Path.home() / "hermes-work/duel_src/hermes_opt/eval",- Path.home() / "hermes-work/leadk/fleet/pr_bundles/duel/harness/eval"] # the duel's copy is the complete one (44 tasks, lib/taskdefs.py)+EVAL_DIRS = [Path(os.environ["QUALIFY_EVAL_DIR"])] if os.environ.get("QUALIFY_EVAL_DIR") else []DEFAULT_TASKS = "" # filled by pick_tasks from the suite's own task listdef find_eval() -> Path | None:- """The suite needs lib/taskdefs.py: the duel_src copy lacks it at the time of writing, so check for it."""+ """The suite needs lib/taskdefs.py, so check for it."""for d in EVAL_DIRS:if (d / "run_arm.sh").exists() and (d / "lib/taskdefs.py").exists():return d