From e0cc4e859e4047f6586f28ace5dea99186e2f3e2 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Fri, 30 Oct 2026 01:47:46 +0100 Subject: [PATCH] GDN harness: tc any_sms bypass for multi-wave tests, output hash --- src/prefill/gdn_harness.cu | 5 +++-- src/prefill/kernels.cu | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/prefill/gdn_harness.cu b/src/prefill/gdn_harness.cu index 2c6bc671..c5f87a69 100644 --- a/src/prefill/gdn_harness.cu +++ b/src/prefill/gdn_harness.cu @@ -372,8 +372,9 @@ int run_case(const Args& a, const FixtureSpec& spec, const char* fname, const cu } char tb[120] = ""; if (a.bench) std::snprintf(tb, sizeof tb, "%.3f/%.3f/%.3f (tot med %.3f min %.3f)", r.ms_gates, r.ms_conv, r.ms_rec, med, mn); - std::printf("%-8s %-6s %-9s %9.2e %9.2e %9.2e %9.2e %-34s %s %s\n", name, "yes", exact ? "identical" : "differs", cr.y_nmax, cr.s_nmax, - ci.y_nmax, ci.s_nmax, tb, join(r.logged).c_str(), verdict); + std::printf("%-8s %-6s %-9s %9.2e %9.2e %9.2e %9.2e %-34s %s %s h=%08llx\n", name, "yes", exact ? "identical" : "differs", cr.y_nmax, cr.s_nmax, + ci.y_nmax, ci.s_nmax, tb, join(r.logged).c_str(), verdict, + (unsigned long long) (fnv1a(r.y16.data(), r.y16.size() * 2) & 0xffffffffULL)); if (r.fallback_calls) std::printf(" (%d call(s) ran on the incumbent: the forced path could not take them)\n", r.fallback_calls); json_line(a, "case", fname, T, r, have_ref ? &cr : nullptr, &ci, exact, med, mn, verdict, pr); } diff --git a/src/prefill/kernels.cu b/src/prefill/kernels.cu index 66e2f82c..7c10bdbf 100644 --- a/src/prefill/kernels.cu +++ b/src/prefill/kernels.cu @@ -1239,7 +1239,9 @@ cudaError_t gdn_rec_tc(float* state, const float* h, const float* gate, const fl cudaGetLastError(); return cudaErrorNotSupported; } - if (strata::cc_major_of(major) < 8 || sms < HV || + const GdnProbe* pr = gdn_probe_get(); // tests only: fewer SMs than value heads run the 48 blocks in several waves + const bool any_sms = pr != nullptr && pr->any_sms; + if (strata::cc_major_of(major) < 8 || (!any_sms && sms < HV) || (size_t) strata::smem_optin_of(smem) < (split ? kTcScanSmemSplit : kTcScanSmem)) return cudaErrorNotSupported; } @@ -1284,7 +1286,7 @@ const char* gdn_chunk_why(bool tc, cudaError_t e, bool any_sms, bool split = fal if (cc < 8) std::snprintf(buf, sizeof buf, "compute capability %d < 8 (cp.async)", cc); else if (!tc && !any_sms && sms < sm_need) std::snprintf(buf, sizeof buf, "%d SMs < %d: the scan would run in several waves (STRATA_GDN_CHUNKED=2 bypasses)", sms, sm_need); - else if (tc && sms < sm_need) std::snprintf(buf, sizeof buf, "%d SMs < %d (one block per value head)", sms, sm_need); + else if (tc && !any_sms && sms < sm_need) std::snprintf(buf, sizeof buf, "%d SMs < %d (one block per value head)", sms, sm_need); else if ((size_t) strata::smem_optin_of(smem) < need) std::snprintf(buf, sizeof buf, "shared memory per block %d B < %zu B needed", strata::smem_optin_of(smem), need); else std::snprintf(buf, sizeof buf, "not supported (%s)", cudaGetErrorString(e));