rdna3: fix STRATA_VERIFY_DEVICE_HITS alias in expert_source and keep opt-in on discrete gfx11

This commit is contained in:
Niko1221 committed 2026-11-22 01:05:25 +01:00
1 parent d31256b79d
commit c8c82e300a
3 files changed
+12 -7

No files matched your search

@@ -70,7 +70,6 @@ inline std::vector<std::pair<std::string, std::string>> gfx11_discrete_exact_env
{"STRATA_SMALL_UNR", "3"},
{"STRATA_GR_Q32_G", "2"},
{"STRATA_GR_Q8_PFS", "1"},
{"STRATA_VERIFY_DEVICE_HITS", "1"},
};
if (windows) {
// Helper thread launches the verify window while the main thread serves CPU doorbells (prevents WDDM first-window launch stalls),
+9 -3
View File
@@ -5562,8 +5562,12 @@ void expert_pool_dispatch_multi(ExpertDispatch& d, const float* x_f, const int32
}
static const bool dec_batch = [] { const char* v = std::getenv("STRATA_DEC_BATCH"); return v == nullptr || std::atoi(v) != 0; }();
// the GPU's copy_rows_from_mapped zeroes the rows it computed itself (dec_batch); STRATA_VERIFY_DEVICE_PLAN's
// copy_or_zero_from_mapped copies every row, so there the host still zeroes them
static const bool device_plan = [] { const char* v = std::getenv("STRATA_VERIFY_DEVICE_PLAN"); return v != nullptr && std::atoi(v) != 0; }();
// (or its alias STRATA_VERIFY_DEVICE_HITS's) copy_or_zero_from_mapped copies every row, so there the host still zeroes them
static const bool device_plan = [] {
const char* v = std::getenv("STRATA_VERIFY_DEVICE_PLAN");
if (v == nullptr) v = std::getenv("STRATA_VERIFY_DEVICE_HITS");
return v != nullptr && std::atoi(v) != 0;
}();
const bool gpu_zeroes_hits = (d.plan != nullptr && n <= kMaxWindowEntries && n <= d.plan->cap && dec_batch && !device_plan);
bool any_cpu = false;
for (int64_t i = 0; i < n; ++i)
@@ -7128,7 +7132,9 @@ ForesightSwap* foresight_swap_from_env(int64_t layers, int64_t experts, const st
const char* v = std::getenv("STRATA_FS_SLOTS");
const int slots = v ? std::atoi(v) : 0;
if (slots <= 0) return nullptr;
if (const char* dp = std::getenv("STRATA_VERIFY_DEVICE_PLAN"); dp && std::atoi(dp) != 0) {
const char* dp = std::getenv("STRATA_VERIFY_DEVICE_PLAN");
if (dp == nullptr) dp = std::getenv("STRATA_VERIFY_DEVICE_HITS");
if (dp && std::atoi(dp) != 0) {
std::fprintf(stderr, "strata serve: foresight swap: off beside STRATA_VERIFY_DEVICE_PLAN (the device would plan "
"resident layers without the host)\n");
return nullptr;
+3 -3
View File
@@ -53,8 +53,8 @@ int main() {
const auto ex_lin = gfx11_discrete_exact_env(g, false, false);
const auto ex_win = gfx11_discrete_exact_env(g, false, true);
const auto wm = gfx11_discrete_wmma_env(g, false);
CHECK(ex_lin.size() == 25);
CHECK(ex_win.size() == 27);
CHECK(ex_lin.size() == 24);
CHECK(ex_win.size() == 26);
CHECK(wm.size() == 13);
CHECK(has_kv(ex_lin, "STRATA_GDN_HEAD", "1"));
CHECK(has_kv(ex_lin, "STRATA_GDN_PP", "2"));
@@ -74,7 +74,7 @@ int main() {
CHECK(has_kv(wm, "STRATA_PF_P1A_L2", "1"));
CHECK(has_kv(wm, "STRATA_DFLASH_WMMA", "1"));
CHECK(has_kv(wm, "STRATA_HIP_FAST_DEC", "1"));
CHECK(has_kv(ex_lin, "STRATA_VERIFY_DEVICE_HITS", "1"));
CHECK(!has_kv(ex_lin, "STRATA_VERIFY_DEVICE_HITS", "1"));
CHECK(gfx11_prefill_share_default(g, false));
}