From 60768eb41e3302443aeda7f375afce7472ee5260 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Fri, 2 Oct 2026 22:05:04 +0200 Subject: [PATCH] prefill: with --peer-device the fused experts stay off even when the peer declines the prompt path (#531 follow-up) fused_ring() turns the fused ring sizing off for any --peer-device session (core::peer_portable), but the layer's fused choice tested the peer's prompt-path state (m.pp), which is null when set_peer declines (no P2P, the buffers do not fit, --peer-prefill-rows 0). Both now follow the flag, so a peer session's prompt path is MMQ with the MMQ ring and buffers it was sized for. Without --peer-device nothing changes. --- src/prefill/prefill.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/prefill/prefill.cpp b/src/prefill/prefill.cpp index edbc47c5..03529cf1 100644 --- a/src/prefill/prefill.cpp +++ b/src/prefill/prefill.cpp @@ -1969,8 +1969,11 @@ bool Prefill::run(const int64_t* tokens, int64_t n, int64_t pos0, std::string& e const bool use_mmq = mmq_plan().any && mmq_plan().layer[(size_t) l]; const int mmq_gt = lay.native ? lay.fmt[(size_t) l].gu_type : 42; const int mmq_dt = lay.native ? lay.fmt[(size_t) l].d_type : 42; - const bool fused_nat = use_mmq && stream_all && !m.pp && lay.native && fused::native_supported(mmq_gt, mmq_dt); - const bool fused_l = (use_mmq && stream_all && !m.pp && !lay.native && fused::enabled()) || fused_nat; + // --peer-device: MMQ only, whether or not the peer took the prompt path (set_peer can decline), as + // fused_ring() sized the ring and the buffers for it + const bool no_peer = !core::peer_portable(); + const bool fused_nat = use_mmq && stream_all && no_peer && lay.native && fused::native_supported(mmq_gt, mmq_dt); + const bool fused_l = (use_mmq && stream_all && no_peer && !lay.native && fused::enabled()) || fused_nat; size_t n_order = 0; // the routed experts (the debug report; unknown when fused) bool peer_now = false; // multi-GPU: the peer computed rows of this layer (MMQ path only) if (fused_l) {