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
Serve (CUDA): turn on the multi-job decode graph when the server runs several requests
YanissAmz54d0de92e979
diff --git a/doc/env_vars.md b/doc/env_vars.mdindex 10520d6..dc71d26 100644--- a/doc/env_vars.md+++ b/doc/env_vars.md@@ -1217,7 +1217,7 @@ noise of the quantization), which is why each has an off switch for A/B work.#### `EXL3_CUDA_GRAPH` (default `0`; `tools/qwen/serve.py` and `tools/flint/serve.py` set it to `1` on NVIDIA)Whole-forward CUDA graph for decode steps (Qwen GDN, Flint sliding-window ring, MTP verify). `EXL3_CUDA_GRAPH_MULTI=1`-(default off) lets several jobs share one graph (B in 1..4, B*Q <= 32). `EXL3_CUDA_GRAPH_MAX` bounds the graph cache.+(default off; `tools/flint/serve.py --max-batch N` and `tools/qwen/serve.py --sessions N` set it to `1` on NVIDIA when N > 1) lets several jobs share one graph (B in 1..4, B*Q <= 32). `EXL3_CUDA_GRAPH_MAX` bounds the graph cache (16 with MULTI, 32 from the Qwen server with `--sessions` > 1).#### `EXL3_QDEC` (default `1`), `EXL3_QDEC_GRAPH` (default `1`), `EXL3_QDEC_ROWS` (default `1`)diff --git a/tools/flint/serve.py b/tools/flint/serve.pyindex dd54441..98af907 100644--- a/tools/flint/serve.py+++ b/tools/flint/serve.py@@ -83,6 +83,8 @@ class Engine:import torchif torch.version.cuda and not torch.version.hip:os.environ.setdefault("EXL3_CUDA_GRAPH", "1") # NVIDIA preset: whole-forward decode graph (read at import)+ if max_batch > 1:+ os.environ.setdefault("EXL3_CUDA_GRAPH_MULTI", "1") # one graph per number of decoding jobs (B 1..4), not only for a lone jobfrom exllamav3 import Config, Model, Cache, Tokenizer, Generatorfrom exllamav3.cache import CacheLayer_quantself.config = Config.from_directory(model_dir)diff --git a/tools/qwen/serve.py b/tools/qwen/serve.pyindex a59a776..fcb6464 100644--- a/tools/qwen/serve.py+++ b/tools/qwen/serve.py@@ -700,6 +700,9 @@ class QwenEngine:if on_cuda:for k, v in CUDA_SERVE_ENV:os.environ.setdefault(k, v)+ if sessions > 1: # one graph per (jobs, rows) shape of the batched step; the LRU holds the 4 x 8 shapes+ os.environ.setdefault("EXL3_CUDA_GRAPH_MULTI", "1")+ os.environ.setdefault("EXL3_CUDA_GRAPH_MAX", "32")from exllamav3 import Cache, Config, Generator, Job, Model, Tokenizertorch.set_grad_enabled(False)self.torch, self.Generator, self.Job = torch, Generator, Job