From 1d87af664fa8520365f7cc357463fbe08b0f7335 Mon Sep 17 00:00:00 2001 From: cobra91 Date: Mon, 23 Nov 2026 14:40:56 +0100 Subject: [PATCH] prefill: STRATA_PREFILL_LM_FORCE=1 also asks for the layer-major walk with a peer GPU (CUDA; HIP keeps the gate) --- engine/src/prefill/prefill.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/engine/src/prefill/prefill.cpp b/engine/src/prefill/prefill.cpp index 20df4804c..a98636f87 100644 --- a/engine/src/prefill/prefill.cpp +++ b/engine/src/prefill/prefill.cpp @@ -8184,7 +8184,14 @@ int64_t Prefill::lm_prepare(int64_t n, std::string& why, int64_t cap) { // no layer-major form const bool split = stage_lb_ != 0 || stage_le_ != g.n_layers || next_ != nullptr; if (hand_in_ != nullptr) { why = "a layer split's chunk hand-off is in use"; return 0; } + // a peer GPU's share of the prompt rows has no layer-major form; STRATA_PREFILL_LM_FORCE=1 asks for the walk anyway. + // HIP keeps the gate as it was: the walk with a peer GPU has not been run on an AMD card. +#if defined(STRATA_USE_HIP) || defined(STRATA_HIP_GFX906) if (m.pp || helper_ != nullptr || core::peer_portable()) { why = "a peer GPU"; return 0; } +#else + if (helper_ != nullptr) { why = "a peer GPU"; return 0; } + if ((m.pp || core::peer_portable()) && !lm_force_env()) { why = "a peer GPU"; return 0; } +#endif // the PLE block (layer 1) reads the token history: on a split it runs in a first stage that holds layers 0 and 1 // (a later stage never reaches it) if (split && m.ss->ple.ready() && stage_lb_ <= 1 && !(stage_lb_ == 0 && stage_le_ >= 2)) {