Accept sm_80+ GPUs at runtime, matching the build guard and the README

The CMake arch guard already lets RTX 30 (sm_86) / 40 (sm_89) build - its own
comment says the kernels need sm_80 or newer (tf32 mma, bf16 math) - and the
README lists RTX 30/40/50 as supported. But device_info() still refused
anything with cc_major != 12, so a working Ampere/Ada build died at startup
with 'Strata targets sm_120 only'. Relax the runtime check to the kernels'
real floor (compute capability 8.0) and align the stale 120-only comments.

Verified on RTX A2000 12GB + RTX 3080 10GB (both sm_86), CUDA 12.0, gcc-13,
engine 0.1.20 serving daily: TG 21-24 t/s flat 1k-128k, 29.6 t/s code-gen at
81% draft acceptance, PP 375/445 @8k/32k, 8/8 needle retrieval at 113k.
This commit is contained in:
mikicvi committed 2026-09-28 19:14:51 +00:00
1 parent bcd62942f1
commit 941f671d65
2 files changed
+10 -9

No files matched your search

+3 -3
View File
@@ -4,9 +4,9 @@
# `strata-pack` are added when their sources exist - a target with no sources would make the build graph
# claim something the tree does not have, which is worse than an absent target.
#
# CUDA targets arrive in Phase 2 and this build REJECTS any architecture other than 120: the engine is
# written against sm_120 (RTX 5000 / Blackwell) and silently building for an older arch would produce a
# binary that runs and is wrong about its own performance, which is the worst of both outcomes.
# CUDA targets arrive in Phase 2. The kernels need sm_80 or newer (tf32 mma, bf16 math) and the guard
# below refuses anything older: silently building for a pre-Ampere arch would produce a binary that runs
# and is wrong about its own performance, which is the worst of both outcomes.
cmake_minimum_required(VERSION 3.24)
project(strata VERSION 0.1.20 LANGUAGES CXX)
add_compile_definitions(STRATA_VERSION="${PROJECT_VERSION}")
+7 -6
View File
@@ -30,7 +30,7 @@ DeviceInfo device_info(int ordinal) {
int count = 0;
check(cudaGetDeviceCount(&count), "cudaGetDeviceCount");
if (count == 0) {
throw CudaError("no CUDA device is present; Strata targets sm_120 (RTX 5000 series)", -1);
throw CudaError("no CUDA device is present; Strata needs an NVIDIA GPU of compute capability 8.0 or newer", -1);
}
if (ordinal < 0 || ordinal >= count) {
throw CudaError("device ordinal " + std::to_string(ordinal) + " is out of range (have " +
@@ -56,13 +56,14 @@ DeviceInfo device_info(int ordinal) {
check(cudaDriverGetVersion(&d.driver_version), "cudaDriverGetVersion");
check(cudaRuntimeGetVersion(&d.runtime_version), "cudaRuntimeGetVersion");
// The engine is written against sm_120. Compiling for it is enforced by CMake; RUNNING on something else
// is caught here, because a binary can be carried to a machine with an older card and would otherwise
// silently take whatever path the driver chose.
if (d.cc_major != 12) {
// The kernels need sm_80 or newer (tf32 mma in the attention scorer, bf16 math) - the same floor the
// arch guard in CMakeLists enforces at build time (RTX 30 / 40 / 50). Anything older is caught here,
// because a binary can be carried to a machine with an older card and would otherwise silently take
// whatever path the driver chose. Pre-Blackwell is untested by the author; trust, then verify.
if (d.cc_major < 8) {
throw CudaError("device " + d.name + " reports compute capability " + std::to_string(d.cc_major) +
"." + std::to_string(d.cc_minor) +
"; Strata targets sm_120 (RTX 5000 series / Blackwell) only",
"; Strata needs an NVIDIA GPU of compute capability 8.0 or newer (RTX 30 / 40 / 50)",
-1);
}
return d;