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 plain lookup: skip the BC_SAM construction check on builds without it

YanissAmz9d68abbd6b04
diff --git a/tools/qwen/serve.py b/tools/qwen/serve.py
index 990cfcd..baf3804 100644
--- a/tools/qwen/serve.py
+++ b/tools/qwen/serve.py
@@ -849,7 +849,17 @@ class QwenEngine:
kw.update(draft_model=self.draft_model, draft_cache=self.draft_cache, num_draft_tokens=self.ndt)
elif pl:
kw.update(ngram_match_min=pl[0], num_draft_tokens=pl[1])
- self.generator = self.Generator(**kw)
+ # night1 1.6 hand-off port fix: the drafter-free plain lookup answers the Generator's n-gram slot itself
+ # (install_plain_lookup replaces iterate_ngram_gen), so the built-in n-gram path and its BC_SAM binding are never
+ # used. On a build without BC_SAM (this ROCm ext returns None for ext.BC_SAM(); the built-in path raises at
+ # construction) that check must not block the plain lookup. Restore the exact descriptor afterwards.
+ _val = self.Generator.__dict__["_validate_ngram_drafting_support"]
+ if pl:
+ self.Generator._validate_ngram_drafting_support = staticmethod(lambda: None)
+ try:
+ self.generator = self.Generator(**kw)
+ finally:
+ self.Generator._validate_ngram_drafting_support = _val
if pl:
self.uninstall = spec_policy.install_plain_lookup(self.generator, pl)
if spec and self.draft_policy == "mix":