Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

setup: UD-Q4_K_XL on AMD is asked before the download (#429); a resumed download needs room only for the rest (#425)

Niko1221af53393b9405
diff --git a/docs/UNSLOTH_Q4.md b/docs/UNSLOTH_Q4.md
index d970af9bc..cf8d2ac39 100644
--- a/docs/UNSLOTH_Q4.md
+++ b/docs/UNSLOTH_Q4.md
@@ -24,7 +24,8 @@ What setup does differently for this model:
- It needs 48 GB of RAM or more (with less it asks, default no; `--model UD-Q4_K_XL --yes` installs it anyway) and
engine 0.1.32 or newer (checked before anything is downloaded), and an NVIDIA
- GPU. One GPU only: with `--gpus` it uses the first one and says so. No images (the vision encoder is not wired to
+ GPU: it has not been run on AMD cards (its prompt kernels for the Q4_K / Q5_K experts are NVIDIA-only), so with
+ `--backend hip` setup says so and asks before the download (#429; `--model UD-Q4_K_XL --yes` tries it). One GPU only: with `--gpus` it uses the first one and says so. No images (the vision encoder is not wired to
this file yet) and no experimental speed projection (not tested with it).
- It downloads the four shards below from the pinned revision `38bb39e` (resumable, like the other models), then
checks each one's size and SHA-256 against the table below; the check takes a few minutes once and is remembered
diff --git a/setup.py b/setup.py
index 40c74b733..67fdd4f5a 100644
--- a/setup.py
+++ b/setup.py
@@ -2767,6 +2767,8 @@ def main() -> int:
if d.get("budget"):
verdict = (f"EXPERIMENTAL, fits with {resident_budget_gib(m, ram)} GiB of its experts in RAM, the rest "
"read from the SSD" if ram >= d["ram_gb"] else "does not fit")
+ if hip: # #429: not run on AMD yet (its prompt kernels are CUDA-only)
+ verdict += " - NVIDIA only so far, untested on AMD"
elif low_ram_needed(m, ram) and low_ram_fits(m, ram, gpu["vram_gb"]) and a.low_ram != "off":
verdict = (f"fits in the low-RAM mode (the GPU holds ~{100 * low_ram_gpu_share(m, gpu['vram_gb']):.0f}% "
"of its experts, " + ("the rest stays in RAM)" if low_ram_resident(m, ram, gpu["vram_gb"])
@@ -2812,6 +2814,14 @@ def main() -> int:
# experts.bin: it would be another 77 GB on the disk), and one GPU (the budget mode has no layer split)
warn(f"{model} is EXPERIMENTAL (docs/UNSLOTH_Q4.md): most of its experts are read from the SSD while it "
"answers, so it is several times slower than the 2-3-bit models; quality checked against llama.cpp")
+ if hip:
+ # #429 (jkuepker): checked before the 111 GB download. The HIP engine has no prompt kernels for its
+ # Q4_K / Q5_K experts (STRATA_MMQ_KQUANTS is CUDA-only) and it has not been run on AMD: asked, not refused
+ confirm_risk(f"{model} has not been run on AMD cards yet: its prompt kernels are NVIDIA-only, so on "
+ f"{gpu_name(gpu)} long prompts read much more slowly, and it may not work at all",
+ bool(a.model), a.yes, f"{model} is NVIDIA-only so far", "choose one of the 2-3-bit models, "
+ f"or --model {model} --yes to try it on AMD anyway", " Try it anyway?")
+ warn(f"installing {model} on an AMD card, as you chose (please report how it runs)")
if ram < MODELS[model]["ram_gb"]:
confirm_risk(f"{model} needs {MODELS[model]['ram_gb']} GB of RAM or more; this PC has {ram:.0f} GB: "
f"its RAM budget would be {resident_budget_gib(model, ram)} GiB, so nearly every expert is "
@@ -2976,11 +2986,17 @@ def main() -> int:
if s.exists() and not done(s) and whole_shard(s):
mark(s, "whole (checked against its own tensor directory)")
have_model = all(s.exists() and (done(s) or a.gguf_dir) for s in shards)
- need = (0 if a.gguf_dir or have_model else MODELS[model]["download_gb"]) + 8 + \
+ # #425 (jctaborda): a download that resumes needs room only for what is still missing - the finished shards and
+ # the .part files already on the disk count
+ on_disk = sum(f.stat().st_size for s in shards for f in (s, s.with_name(s.name + ".part")) if f.is_file()) / 1e9
+ to_fetch = 0 if a.gguf_dir or have_model else max(MODELS[model]["download_gb"] - on_disk, 0)
+ need = to_fetch + 8 + \
(40 if model == "Q2_0" and avx512 and family == "qwen" else 0) + (1 if vision != "none" else 0) + \
(MODELS[model]["arena_gb"] + 1 if low_ram and not (model == "Q2_0" and avx512 and family == "qwen") else 0)
if free_gb(models_dir) < need:
- fail(f"not enough free disk space in {models_dir}: need ~{need:.0f} GB", "use --models-dir on a bigger drive")
+ fail(f"not enough free disk space in {models_dir}: need ~{need:.0f} GB" +
+ (f" ({on_disk:.0f} GB of the model is already there)" if on_disk >= 1 and not have_model else ""),
+ "use --models-dir on a bigger drive")
# ---- 3. python packages
step(3, "Python packages")
diff --git a/tools/test_setup_unsloth.py b/tools/test_setup_unsloth.py
index fc8d3be06..e6bd13fe6 100644
--- a/tools/test_setup_unsloth.py
+++ b/tools/test_setup_unsloth.py
@@ -139,7 +139,7 @@ class Main(unittest.TestCase):
def tearDown(self):
self.tmp.cleanup()
- def main(self, argv, ram=63.7, version="0.1.32", n_gpus=1, model=True):
+ def main(self, argv, ram=63.7, version="0.1.32", n_gpus=1, model=True, amd=(), free=500.0):
eng = self.t / "engine"
eng.mkdir(exist_ok=True)
(eng / "BUILD.json").write_text(json.dumps({"version": version, "source": "local"}))
@@ -161,11 +161,11 @@ class Main(unittest.TestCase):
mock.patch.object(setup, "data_folder", lambda d: (self.t / "data", [])),
mock.patch.object(setup, "installed_configs", lambda: []),
mock.patch.object(setup, "gpus", lambda: found),
- mock.patch.object(setup, "amd_gpus", lambda: []),
+ mock.patch.object(setup, "amd_gpus", lambda *a: list(amd)),
mock.patch.object(setup, "ram_gb", lambda: ram),
mock.patch.object(setup, "cpu_info", lambda: ("Test CPU", True, True)),
mock.patch.object(setup, "page_file_gb", lambda: 16.0),
- mock.patch.object(setup, "free_gb", lambda p: 500.0),
+ mock.patch.object(setup, "free_gb", lambda p: free),
mock.patch.object(setup, "pip_install", lambda *a, **k: None),
mock.patch.object(setup, "get_llama_cpp", lambda: self.t / "llama.cpp"),
mock.patch.object(setup, "get_prebuilt", lambda *a, **k: eng),
@@ -245,6 +245,35 @@ class Main(unittest.TestCase):
self.assertIn("--model UD-Q4_K_XL --yes", out) # the way to insist
self.assertEqual(self.downloads, [])
+ def test_amd_is_asked_before_the_download(self):
+ """#429: UD-Q4_K_XL has not run on AMD (CUDA-only prompt kernels): --yes alone stops before the 111 GB
+ download, saying why; it is not refused outright (the owner's rule: --model with --yes goes on)."""
+ r9700 = [{"index": 0, "name": "AMD Radeon AI PRO R9700", "vram_gb": 31.9, "arch": "gfx1201",
+ "driver": "amdgpu"}]
+ code, out, cfg = self.main(["--context", "8192", "--backend", "hip"], model=False, amd=r9700)
+ self.assertEqual(code, 1, out)
+ self.assertIn("has not been run on AMD cards yet", out)
+ self.assertIn("--model UD-Q4_K_XL --yes", out)
+ self.assertEqual(self.downloads, [])
+
+ def test_resumed_download_needs_room_for_the_rest_only(self):
+ """#425: the disk check counts the finished shards and .part files already there (sizes scaled down: a
+ 2 MB "model" with 1.5 MB on the disk, 8 GB of other room needed, 8.001 GB free)."""
+ d = self.t / "models" / "unsloth-UD-Q4_K_XL"
+ d.mkdir(parents=True)
+ (d / (list(setup.UNSLOTH_SHARDS)[0] + ".part")).write_bytes(b"x" * 1_500_000)
+ with mock.patch.dict(setup.MODELS[M], {"download_gb": 0.002}):
+ code, out, cfg = self.main(["--context", "8192"], free=8.001)
+ self.assertNotIn("not enough free disk space", out)
+ self.assertEqual(code, 0, out)
+ for f in d.iterdir(): # the first run "downloaded" them
+ f.unlink()
+ (d / (list(setup.UNSLOTH_SHARDS)[0] + ".part")).write_bytes(b"x" * 1_500_000)
+ with mock.patch.dict(setup.MODELS[M], {"download_gb": 0.003}): # 1.5 MB still missing: no room
+ code, out, cfg = self.main(["--context", "8192"], free=8.001)
+ self.assertEqual(code, 1)
+ self.assertIn("not enough free disk space", out)
+
def test_too_little_ram_with_an_explicit_model_installs(self):
"""S6 (the owner's rule): --model with --yes is the consent; the risk is said."""
code, out, cfg = self.main(["--context", "8192"], ram=31.9)