Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

moe_fused, moe_fused_iq: the Turing opt-in (#2145) reads the compute capability through STRATA_EMULATE_CC like the other kernels

Niko1221b30d09cb983a
diff --git a/src/prefill/moe_fused.cu b/src/prefill/moe_fused.cu
index 480734d3e..3522e1c98 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 <cuda_fp16.h>
#include <cuda_runtime.h>
@@ -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 e1f3961a8..f87a08081 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 <cuda_fp16.h>
#include <cuda_runtime.h>
@@ -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'; }();