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 prefill: to_f16 memo keyed on storage address, shape and version (a reshaped view of the same fp32 stream now hits); 8K chunk with CK + HIP experts + TunableOp frozen + HY4_PF_FUSE=1: 11.81 -> 10.69 s (766 tok/s), KL@4096 0.116 +- 0.012 vs three noise nulls 0.102-0.119

YanissAmz928f953afba5
diff --git a/exllamav3/loader/prefill_kernels.py b/exllamav3/loader/prefill_kernels.py
index 9ca0977..2798f8b 100644
--- a/exllamav3/loader/prefill_kernels.py
+++ b/exllamav3/loader/prefill_kernels.py
@@ -454,7 +454,7 @@ def to_f16(x):
if x.dtype != torch.float32 or not x.is_cuda or not x.is_contiguous() or x.numel() < (1 << 20):
return x.float().clamp(-F16MAX, F16MAX).half()
key = (x.data_ptr(), x.shape, x._version)
- if _F16_MEMO[0] is not None and _F16_MEMO[1] == key and _F16_MEMO[0][0] is x:
+ if _F16_MEMO[0] is not None and _F16_MEMO[1] == key: # same storage address + shape + in-place version; the memo holds the source, so the storage cannot be reused
return _F16_MEMO[0][1]
o = torch.empty(x.shape, dtype=torch.float16, device=x.device)
n = x.numel()