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 fp8 KV: generic paths in the A/B driver, micro sweep reference

YanissAmz9ee3e5f650eb
diff --git a/exllamav3/loader/lc_sparse.py b/exllamav3/loader/lc_sparse.py
index fcaeb06..073b7c6 100644
--- a/exllamav3/loader/lc_sparse.py
+++ b/exllamav3/loader/lc_sparse.py
@@ -263,7 +263,7 @@ def sparse_mla_attend(q_lat, q_pe, ckv, k_pe, qpos, sel, scale, sinks, scl=None)
out = torch.empty(T, H, R, dtype=torch.float32, device=q_lat.device)
if qf and HB_ON and HB_SPLIT != 0 and H % HB == 0 and R == triton.next_power_of_2(R) and R <= 1024:
from . import ref_fused as _rf
- ng, S = H // HB, (HB_SPLIT if HB_SPLIT > 0 else (16 if T <= 3 else 8)) # -1 = auto: the micro sweep (84_00_2a_mla_micro) best split per row count
+ ng, S = H // HB, (HB_SPLIT if HB_SPLIT > 0 else (16 if T <= 3 else 8)) # -1 = auto: the micro sweep (tools/hy4/step/mla_micro.py) best split per row count
wa = torch.empty(T * ng * S * HB * R, dtype=torch.float32, device=q_lat.device)
wm = torch.empty(T * ng * S * HB, dtype=torch.float32, device=q_lat.device)
wl = torch.empty(T * ng * S * HB, dtype=torch.float32, device=q_lat.device)
diff --git a/tools/hy4/step/ab_mla.py b/tools/hy4/step/ab_mla.py
index d0e8f3c..1ccc70d 100644
--- a/tools/hy4/step/ab_mla.py
+++ b/tools/hy4/step/ab_mla.py
@@ -10,7 +10,7 @@ CAP = max(ctxs) + 2048
serve.apply_env(CAP)
import torch
from engine import Hy4Engine
-GGUF = os.environ.get("GGUF", "/home/kamel/models/hy4-flash-gguf/Hy4-flash-Q3_K-00001-of-00002.gguf")
+GGUF = os.environ.get("GGUF", "/path/to/models/hy4-flash-gguf/Hy4-flash-Q3_K-00001-of-00002.gguf")
e = Hy4Engine(tree, GGUF, ctx=CAP, k=3)
e.load(print)
GR = e.GR
@@ -27,7 +27,7 @@ def arm(fl):
for k, f in LEV.items():
f(k in fl)
GR.clear()
-wiki = json.load(open(os.environ.get("WIKI", "/home/kamel/scratch_w5/wiki_ids.json")))
+wiki = json.load(open(os.environ.get("WIKI", "/path/to/wiki_ids.json")))
pc, sync = time.perf_counter, torch.cuda.synchronize
print("ARMB", FL, "KV_FP8", os.environ.get("HY4_KV_FP8"), "LC_SPARSE", LS.ENABLED, "HB", rf.HB, flush=True)
Ts = [int(x) for x in os.environ.get("PTS", "1,2,3,4,5,6").split(",")]