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 step: row thresholds for the dot paths (HY4_BG_DOT_MINT 5, HY4_HEAD_DOT_MINT 3): box A/B shows no gain below T 5 for k_b / v_b and none at T 2 for the head
YanissAmzb402c31612a0
diff --git a/exllamav3/loader/head_bf16.py b/exllamav3/loader/head_bf16.pyindex b70f6d1..8fc3657 100644--- a/exllamav3/loader/head_bf16.py+++ b/exllamav3/loader/head_bf16.py@@ -12,6 +12,7 @@ BV = int(os.environ.get("HY4_HEAD_BV", "8"))BD = int(os.environ.get("HY4_HEAD_BD", "512"))DOT = os.environ.get("HY4_HEAD_DOT", "0") == "1" # 1 = verify rows (T >= 2) on tl.dot: fp16 WMMA, h split hi + lo (rel ~1e-7), W bf16 -> fp16 exact above 6e-8DOT_BV = int(os.environ.get("HY4_HEAD_DOT_BV", "64"))+DOT_MINT = int(os.environ.get("HY4_HEAD_DOT_MINT", "3")) # fewest rows on the dot path (box A/B: T 2 +0.2 ms, T 6 -4.2 ms)DOT_BD = int(os.environ.get("HY4_HEAD_DOT_BD", "64"))DOT_NW = int(os.environ.get("HY4_HEAD_DOT_NW", "4"))ROW_TILES = os.environ.get("HY4_ROW_TILES", "0") == "1" # 1 = verify-row tiles tuned on the Strix (T 2..4: BD 64 + 2 warps; T >= 5: BV 16, BD 32)@@ -79,7 +80,7 @@ def gemv(h, W):T = h.shape[0]if T > 1:out = torch.empty(T, V, dtype=torch.float32, device=W.device)- if DOT and D % DOT_BD == 0 and W.dtype in (torch.bfloat16, torch.float16):+ if DOT and T >= DOT_MINT and D % DOT_BD == 0 and W.dtype in (torch.bfloat16, torch.float16):_k_headd[(triton.cdiv(V, DOT_BV),)](W, h.contiguous(), out, V, D, T, BT=16, BV=DOT_BV, BD=DOT_BD, num_warps=DOT_NW)return outbv, bd, nw = BV, min(BD, 128), 4diff --git a/exllamav3/loader/mla_bgemv.py b/exllamav3/loader/mla_bgemv.pyindex 4039ba0..de35e33 100644--- a/exllamav3/loader/mla_bgemv.py+++ b/exllamav3/loader/mla_bgemv.py@@ -17,6 +17,7 @@ BK = int(os.environ.get("HY4_BG_BK", "128"))ROW_TILES = os.environ.get("HY4_ROW_TILES", "0") == "1" # 1 = tile sizes tuned on the Strix for verify rows (T >= 4: BN 32, BK 32; box microbench 19/11)DOT = os.environ.get("HY4_BG_DOT", "0") == "1" # 1 = verify rows (T >= 2) on tl.dot: int8 -> fp16 exact, x = hi + lo fp16, block scale applied to the fp32 partial (rel ~1e-7)DOT_BN = int(os.environ.get("HY4_BG_DOT_BN", "64"))+DOT_MINT = int(os.environ.get("HY4_BG_DOT_MINT", "5")) # fewest rows on the dot path (box A/B: T 3-4 +-0.2 ms, T 6 -5 ms, T 2 +0.9 ms)DOT_NW = int(os.environ.get("HY4_BG_DOT_NW", "4"))MAXT = 8 # rows served by the batched kernels (verify rows)@@ -100,7 +101,7 @@ class Q8Batched:if x.dim() == 3 and x.shape[0] > 1 and x.stride(-1) == 1:T = x.shape[0]out = torch.empty(T, self.H, self.N, dtype=torch.float32, device=x.device)- if DOT and T <= 16 and self.K % 32 == 0:+ if DOT and DOT_MINT <= T <= 16 and self.K % 32 == 0:_k_bgd[(self.H, triton.cdiv(self.N, DOT_BN))](self.q, self.d, x, out, self.N, self.K, self.K // 32, x.stride(0), x.stride(1), T, BT=16, BN=DOT_BN, num_warps=DOT_NW)return outbn, bk = (32, 32) if (ROW_TILES and T >= 4) else (BN, min(BK, 64))