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
import os, sys, torch
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "tools", "qwen", "cache8"))
from ref8 import pack8, dequant8
def _rel(x):
w, s = pack8(x)
return ((dequant8(w, s) - x.float()).pow(2).mean().sqrt() / x.float().pow(2).mean().sqrt()).item()
def test_roundtrip_8bit_error():
g = torch.Generator().manual_seed(0)
assert _rel(torch.randn(512, 512, generator=g).half()) < 7e-3
x = torch.randn(512, 512, generator=g); x[:, ::37] *= 30
assert _rel(x.half()) < 7e-3
def test_zero_group():
w, s = pack8(torch.zeros(4, 512).half())
assert dequant8(w, s).abs().max() < 1e-6