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.

Prefix disk restore: keep the per-page copies on ROCm, where the bulk copy is slower

YanissAmza93b114e48d8
diff --git a/exllamav3/generator/prefix_disk.py b/exllamav3/generator/prefix_disk.py
index a5dac23..b0199c7 100644
--- a/exllamav3/generator/prefix_disk.py
+++ b/exllamav3/generator/prefix_disk.py
@@ -37,8 +37,8 @@ _BULK_OFF_FILE = os.environ.get("EXL3_PD_BULK_OFF_FILE", "") # bench switch
def bulk_on() -> bool:
- """pinned bulk restore (default); EXL3_PD_BULK=0 = the per-page copies"""
- return os.environ.get("EXL3_PD_BULK", "1") != "0" and not (_BULK_OFF_FILE and os.path.exists(_BULK_OFF_FILE))
+ """pinned bulk restore (default on CUDA: 390 -> 295 ms; on ROCm unified memory it costs 329 -> 617 ms); EXL3_PD_BULK=0|1 forces it"""
+ return os.environ.get("EXL3_PD_BULK", "0" if torch.version.hip else "1") != "0" and not (_BULK_OFF_FILE and os.path.exists(_BULK_OFF_FILE))
def weights_identity(model_dir: str) -> str: