From d50f6a77ed7fe86ac14964238b96fedace7cca6d Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Tue, 27 Oct 2026 21:55:25 +0100 Subject: [PATCH] metal: the DSpark drafter stays off on a Mac unless asked for (its quantised Markov bias has no Metal kernel; the setup test stopped with kernel launch with no Metal dispatch) --- src/dsv41/ds4_model.cu | 8 ++++++++ tools/dsv41/smoke.py | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/dsv41/ds4_model.cu b/src/dsv41/ds4_model.cu index 83a97ac5..980bc0de 100644 --- a/src/dsv41/ds4_model.cu +++ b/src/dsv41/ds4_model.cu @@ -2229,6 +2229,14 @@ struct Model::Impl { if (o.vision_only) return true; // layers: roles and the sources they read +#if defined(STRATA_METAL) + // On a Mac the drafter is off unless it is asked for outright: it gave the same answers and no speed-up there, and the head of its + // quantised Markov bias has no Metal kernel (the engine stopped with "kernel launch with no Metal dispatch" on the setup test). + if (o.dspark_auto && o.dspark && g.n_mtp > 0) { + o.dspark = false; + std::fprintf(stderr, "ds4: DSpark not loaded on a Mac (--dspark on loads it anyway)\n"); + } +#endif if (o.dspark_auto && o.dspark && g.n_mtp > 0) { // (see Options::dspark_auto) double exp_b = 0, room_b = 0; for (const auto& kt : pk.t) diff --git a/tools/dsv41/smoke.py b/tools/dsv41/smoke.py index 3a3e1956..7a2b94e9 100644 --- a/tools/dsv41/smoke.py +++ b/tools/dsv41/smoke.py @@ -77,8 +77,8 @@ def main() -> int: with tempfile.TemporaryDirectory() as d: f = Path(d) / "ids.txt" f.write_text(",".join(str(i) for i in ids), encoding="ascii") - cmd = [a.exe, "--pack", str(pack), "--ids", "@" + str(f), "--n", str(a.tokens), "--max-context", "1024", "--dspark", "auto", - "--window", "16"] + cmd = [a.exe, "--pack", str(pack), "--ids", "@" + str(f), "--n", str(a.tokens), "--max-context", "1024", "--dspark", "none" if sys.platform == "darwin" else "auto", + "--window", "16"] # (a Mac runs without the drafter: its Metal engine has no kernels for it) if a.gpus: cmd += ["--gpus", a.gpus] try: