From 10b6694fa9be4d4a86f51377fe0fea97f0ae78a3 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Thu, 3 Dec 2026 12:46:34 +0100 Subject: [PATCH] ling32 --mtp-auto: HIP builds do not load the MTP sidecar on a unified-memory device (0.2.25 safety) On the Strix Halo (HIP, unified memory, tier A) some engine starts decoded a different greedy text with the MTP sidecar than without it: the app's warm-up 'Say hello.' (temperature 0) ran 32 tokens instead of 12 in two of three starts of the same package, with 2 of 912 drafts accepted; every other platform and the MTP-off Strix runs give 12. Exact speculative decoding must not change greedy text, so --mtp-auto now declines the sidecar there until that is understood: 'MTP sidecar (--mtp-auto): not loaded: unified-memory HIP (0.2.25 safety)'. --mtp FILE still forces it. Scope: compiled only under STRATA_USE_HIP and only when the device is integrated; CUDA, Metal and SYCL builds and every discrete HIP card (R9700) keep the existing rule. --- engine/src/ling32/ling32_main.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engine/src/ling32/ling32_main.cpp b/engine/src/ling32/ling32_main.cpp index 34c841956d..87de8373cc 100644 --- a/engine/src/ling32/ling32_main.cpp +++ b/engine/src/ling32/ling32_main.cpp @@ -840,9 +840,16 @@ int cmd_run(const RunOpts& o_in) { if (tiered) h2d_gbps = measure_h2d_gbps(o.device); int min_card = kMtpAutoMinCardExperts; if (const char* ev = std::getenv("STRATA_L32_MTP_AUTO_MIN_CARD")) if (ev[0]) min_card = std::atoi(ev); // test hook: the pool-size cut by hand (0: off; ling32_mtp_auto_regress) - const bool pays = mtp_auto_pays(tiered ? plan.mode : TierMode::A, integrated, h2d_gbps, &why, tiered ? plan.dyn_slots + plan.vram_ranks * 40 : -1, min_card); // 40 routed layers + bool pays = mtp_auto_pays(tiered ? plan.mode : TierMode::A, integrated, h2d_gbps, &why, tiered ? plan.dyn_slots + plan.vram_ranks * 40 : -1, min_card); // 40 routed layers + bool hip_uma_safety = false; +#if defined(STRATA_USE_HIP) + // 0.2.25 SAFETY (HIP builds only): on a HIP unified-memory device (Strix Halo, gfx1151) some engine starts decoded a different greedy text with the MTP sidecar than without it (the warm-up "Say hello." + // ran 32 tokens instead of 12 in two of three app starts, with 2 of 912 drafts accepted); --mtp-auto therefore does not load the sidecar there until that is understood. --mtp FILE still forces it. + if (pays && integrated) { pays = false; hip_uma_safety = true; } +#endif if (tiered) std::printf("tier store: host-to-device link moved %.1f GB/s (pinned 256 MiB copies, median of 3)\n", h2d_gbps); - std::printf("MTP sidecar (--mtp-auto): %s: %s\n", pays ? "loaded" : "not loaded (--mtp FILE forces it)", why.c_str()); + if (hip_uma_safety) std::printf("MTP sidecar (--mtp-auto): not loaded: unified-memory HIP (0.2.25 safety)\n"); + else std::printf("MTP sidecar (--mtp-auto): %s: %s\n", pays ? "loaded" : "not loaded (--mtp FILE forces it)", why.c_str()); if (!pays) { o.mtp_file.clear(); o.spec_mtp = false;