From d02478b7a10cd6e05063e004dd9e6d8c7790cff8 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Mon, 26 Oct 2026 20:07:56 +0100 Subject: [PATCH] layer-major prefill: stays off on AMD builds (#3976) Only NVIDIA CUDA has run the layer-major walk. On a HIP build (wave32 or the gfx906 compat layer) lm_prepare now declines with a reason, so a prompt takes the chunk-major path and the one-time "layer-major off for this prompt" line names it. The code still compiles everywhere the shared prefill.cpp does; nothing else changes. With STRATA_PREFILL_LAYER_MAJOR unset nothing is reached. Not covered: HIP and SYCL were not built or run (SYCL has its own prefill.cpp). --- src/prefill/prefill.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/prefill/prefill.cpp b/src/prefill/prefill.cpp index fd75b6ab..91663284 100644 --- a/src/prefill/prefill.cpp +++ b/src/prefill/prefill.cpp @@ -5639,6 +5639,11 @@ void Prefill::lm_release() { int64_t Prefill::lm_prepare(int64_t n, std::string& why, int64_t cap) { Impl& m = *impl_; if (m.g == nullptr) { why = "not initialized"; return 0; } +#if defined(STRATA_USE_HIP) || defined(STRATA_HIP_GFX906) + // only NVIDIA CUDA has run this path; on an AMD build the prompt stays on the chunk-major path + why = "layer-major prefill has only been run on NVIDIA CUDA"; + return 0; +#endif const core::ModelGeometry& g = *m.g; const core::OnDevice on_device(m.device); // a layer split's later stage is sized on its own GPU // layer split (2026-10-24): each stage runs its own layers layer-major over the same super-chunk and hands the