From b30d09cb983a2d9535e038bbb631804e127cf3db Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Wed, 14 Oct 2026 07:14:09 +0200 Subject: [PATCH] moe_fused, moe_fused_iq: the Turing opt-in (#2145) reads the compute capability through STRATA_EMULATE_CC like the other kernels --- src/prefill/moe_fused.cu | 3 ++- src/prefill/moe_fused_iq.cu | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/prefill/moe_fused.cu b/src/prefill/moe_fused.cu index 480734d3..3522e1c9 100644 --- a/src/prefill/moe_fused.cu +++ b/src/prefill/moe_fused.cu @@ -19,6 +19,7 @@ // activations are stored in it (perm32), and a lane's two B registers (h = 0 and 1) are adjacent: one 8-byte load. #include "strata/prefill/moe_fused.hpp" #include "strata/kernels/gfx_arch.hpp" +#include "strata/core/emulate.hpp" #include #include @@ -645,7 +646,7 @@ const DevInfo& dev_info() { cudaDeviceGetAttribute(&major, cudaDevAttrComputeCapabilityMajor, dev); cudaDeviceGetAttribute(&minor, cudaDevAttrComputeCapabilityMinor, dev); cudaDeviceGetAttribute(&d.sms, cudaDevAttrMultiProcessorCount, dev); - d.cc = 10 * major + minor; + d.cc = 10 * strata::cc_major_of(major) + strata::cc_minor_of(minor); // STRATA_EMULATE_CC counts (tests) // Turing (sm_75): the same kernels with plain copies and m8n8k16 MMAs, opt-in (STRATA_PF_FUSED_SM75=1) static const bool sm75 = [] { const char* v = std::getenv("STRATA_PF_FUSED_SM75"); return v != nullptr && v[0] == '1'; }(); if (d.cc < 75 || (d.cc < 80 && !sm75)) { d.cc = d.cc < 80 ? 0 : d.cc; return d; } diff --git a/src/prefill/moe_fused_iq.cu b/src/prefill/moe_fused_iq.cu index e1f3961a..f87a0808 100644 --- a/src/prefill/moe_fused_iq.cu +++ b/src/prefill/moe_fused_iq.cu @@ -21,6 +21,7 @@ // (SwiGLU, H to int8 per 32 features; down into the per-slot rows) are moe_fused.cu's. #include "strata/prefill/moe_fused_iq.hpp" #include "strata/kernels/gfx_arch.hpp" +#include "strata/core/emulate.hpp" #include #include @@ -1048,7 +1049,7 @@ int host_astages() { if (!per[dev]) { int major = 0; cudaDeviceGetAttribute(&major, cudaDevAttrComputeCapabilityMajor, dev); - per[dev] = major < 8 ? 2 : ASTAGES; + per[dev] = strata::cc_major_of(major) < 8 ? 2 : ASTAGES; } return per[dev]; } @@ -1136,6 +1137,8 @@ const DevInfo& dev_info() { int major = 0, minor = 0; cudaDeviceGetAttribute(&major, cudaDevAttrComputeCapabilityMajor, dev); cudaDeviceGetAttribute(&minor, cudaDevAttrComputeCapabilityMinor, dev); + major = strata::cc_major_of(major); // STRATA_EMULATE_CC counts (tests) + minor = strata::cc_minor_of(minor); cudaDeviceGetAttribute(&d.sms, cudaDevAttrMultiProcessorCount, dev); // Turing (sm_75): the same kernels with plain copies and m8n8k16 MMAs, opt-in (STRATA_PF_FUSED_SM75=1) static const bool sm75 = [] { const char* v = std::getenv("STRATA_PF_FUSED_SM75"); return v != nullptr && v[0] == '1'; }();