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.

qdec.hip split count / wave count: run-time knobs (EXL3_QDEC_HIP_SPL, EXL3_QDEC_HIP_WAVES)

YanissAmzb79bb8f6994d
diff --git a/exllamav3/modules/attention_fn/qdec_hip.py b/exllamav3/modules/attention_fn/qdec_hip.py
index 374b227..e86e0b7 100644
--- a/exllamav3/modules/attention_fn/qdec_hip.py
+++ b/exllamav3/modules/attention_fn/qdec_hip.py
@@ -155,9 +155,9 @@ def cu_count(device):
def num_splits(cfg, device, programs, max_k_len):
- if os.environ.get("EXL3_QDEC_HIP_SPL"):
- return int(os.environ["EXL3_QDEC_HIP_SPL"])
- waves = int(os.environ.get("EXL3_QDEC_HIP_WAVES", "0")) or cu_count(device) * (16 if cfg.get("tq") and cfg["qlen"] * (cfg["nqh"] // cfg["nkv"]) <= 16 else 12) # tq, one q tile: 4 waves per SIMD (its V loads stay in flight)
+ if knob("EXL3_QDEC_HIP_SPL"):
+ return int(knob("EXL3_QDEC_HIP_SPL"))
+ waves = knob_int("EXL3_QDEC_HIP_WAVES", 0) or cu_count(device) * (16 if cfg.get("tq") and cfg["qlen"] * (cfg["nqh"] // cfg["nkv"]) <= 16 else 12) # tq, one q tile: 4 waves per SIMD (its V loads stay in flight)
return max(1, min(-(-waves // (programs * cfg["nw"])), -(-max_k_len // 16 // cfg["nw"]), 128))
diff --git a/exllamav3/util/knobs.py b/exllamav3/util/knobs.py
index 919b552..c2e7b3b 100644
--- a/exllamav3/util/knobs.py
+++ b/exllamav3/util/knobs.py
@@ -36,6 +36,8 @@ KNOBS = {
"EXL3_QDEC_HIP_NW": "0",
"EXL3_QDEC_HIP_DW": "",
"EXL3_QDEC_HIP_MAXO": "96",
+ "EXL3_QDEC_HIP_SPL": "",
+ "EXL3_QDEC_HIP_WAVES": "0",
"EXL3_QDEC_HIP_FLAGS": "",
}