From 3a55dfd253e0807973de8091235f8786c4498dcd Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Fri, 9 Oct 2026 15:19:04 +0200 Subject: [PATCH] HIP: STRATA_HEAD_MIX_MULTI and STRATA_ONE_TOKEN_COMMIT as opt-ins (=1), default stays off (#1479) Patch from the issue by jkuepker. Co-authored-by: jkuepker <20614147+jkuepker@users.noreply.github.com> --- src/core/mtp.cpp | 3 ++- src/core/verify.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/core/mtp.cpp b/src/core/mtp.cpp index 4edcea80..03bcdf5f 100644 --- a/src/core/mtp.cpp +++ b/src/core/mtp.cpp @@ -857,7 +857,8 @@ bool MtpDrafter::record_rest(int step_row, cudaStream_t cs, std::string& err) { }(); static const bool head_mix_multi_on = [] { #if defined(STRATA_USE_HIP) - return false; + const char* v = std::getenv("STRATA_HEAD_MIX_MULTI"); // HIP: opt-in (=1) + return v != nullptr && std::atoi(v) != 0; #else const char* v = std::getenv("STRATA_HEAD_MIX_MULTI"); return v == nullptr || std::atoi(v) != 0; diff --git a/src/core/verify.cpp b/src/core/verify.cpp index 8f70e022..518cbc21 100644 --- a/src/core/verify.cpp +++ b/src/core/verify.cpp @@ -190,7 +190,11 @@ bool sh_stream_on() { // STRATA_HEAD_MIX_MULTI=0 does too): bitwise the same sums. bool head_mix_multi_enabled() { #if defined(STRATA_USE_HIP) - return false; + static const bool on = [] { + const char* v = std::getenv("STRATA_HEAD_MIX_MULTI"); // HIP: opt-in (=1) + return v != nullptr && std::atoi(v) != 0; + }(); + return on; #else static const bool on = [] { const char* v = std::getenv("STRATA_HEAD_MIX_MULTI"); @@ -202,7 +206,11 @@ bool head_mix_multi_enabled() { bool one_token_self_commit() { #if defined(STRATA_USE_HIP) - return false; + static const bool on = [] { + const char* v = std::getenv("STRATA_ONE_TOKEN_COMMIT"); // HIP: opt-in (=1) + return v != nullptr && std::atoi(v) != 0; + }(); + return on; #else static const bool on = [] { const char* v = std::getenv("STRATA_ONE_TOKEN_COMMIT");