moe_fused, moe_fused_iq: the Turing opt-in (#2145) reads the compute capability through STRATA_EMULATE_CC like the other kernels
This commit is contained in:
1 parent
0639deff7d
commit
b30d09cb98
2 files changed
+6
-2
No files matched your search
@@ -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; }
|
||||
|
||||
@@ -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'; }();
|
||||
|
||||
Reference in new issue
Block a user