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.

Qwen server: keep the NVIDIA verify-row default; the 8-row depth cap default is for ROCm

YanissAmz1d5a976599be
diff --git a/doc/env_vars.md b/doc/env_vars.md
index e833d1b..b0f9d59 100644
--- a/doc/env_vars.md
+++ b/doc/env_vars.md
@@ -982,7 +982,7 @@ on the box (v1.7.2), 4 sessions, 4 greedy prompts: 26.1 to 40.7 tok/s aggregate.
not change there. The text of 4 concurrent plain streams still differs from the solo run at a near-tie word (the solo step
uses the one-row kernels), as it did before the flag.
-#### `QWSPEC_LOAD_ROWS` (default: `EXL3_ROW_INV_GROUP_ROWS` (`8`) with `--sessions` above 1 in the Qwen server, else `0`)
+#### `QWSPEC_LOAD_ROWS` (default: `EXL3_ROW_INV_GROUP_ROWS` (`8`) with `--sessions` above 1 in the Qwen server on ROCm; on NVIDIA `16` for a dense model and `0` for a model with MoE layers; `0` elsewhere)
Qwen speculative decoding: with N requests decoding together the draft depth is capped at `R // N - 1`, so the verify rows
of the step, `N * (depth + 1)`, stay within `R` rows (no draft when that is below 1). `0` turns the cap off.
diff --git a/tools/qwen/serve.py b/tools/qwen/serve.py
index 2b7893c..4d95cbf 100644
--- a/tools/qwen/serve.py
+++ b/tools/qwen/serve.py
@@ -703,7 +703,8 @@ class QwenEngine:
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")
- if sessions > 1: # speculative rounds of N requests verify N * (depth + 1) rows: cap the depth so they stay in one 8-row forward
+ if sessions > 1 and not on_cuda: # speculative rounds of N requests verify N * (depth + 1) rows: cap the depth so they stay in one 8-row forward
+ # (NVIDIA keeps the spec_policy default: a 16-row budget for a dense model, no cap for a MoE model)
os.environ.setdefault("QWSPEC_LOAD_ROWS", os.environ.get("EXL3_ROW_INV_GROUP_ROWS") or "8")
from exllamav3 import Cache, Config, Generator, Job, Model, Tokenizer
torch.set_grad_enabled(False)