[Engine] Enable Volta (sm_70) kernels and defaults for Jetson Xavier (sm_72)

This commit is contained in:
Xavier Port Builder authored and Niko1221 committed 2026-12-04 07:06:46 +01:00
1 parent b569fd723b
commit 92879c33de
5 files changed
+8 -7

No files matched your search

+2 -2
View File
@@ -133,7 +133,7 @@ std::vector<std::pair<std::string, std::string>> nv_default_env(int major, int m
// (the engine turns it off, with a line, for a layer split, helper cards, --batch and the other cases of the DETAILS.md row). STRATA_ADAPT_FETCH=0 is the way back.
if (adapt_fetch_default_card(major, minor, main_vram_bytes)) t.push_back({"STRATA_ADAPT_FETCH", "2"});
else if (main_vram_bytes > kAdaptFetchMaxVramBytes) t.push_back({"STRATA_VERIFY_DEVICE_HITS", "1"});
} else if (mj == 7 && mn == 0) {
} else if (mj == 7 && (mn == 0 || mn == 2)) {
// Volta (Tesla V100 / Titan V / Quadro GV100, sm_70): 21 validated bit-exact switches measured on locked-clock
// dual V100-SXM2-16GB (200 W / 1020 MHz and 300 W / 1530 MHz SM / 877 MHz MEM; identical sha and needle checks).
// STRATA_SM70_PERF=0 and STRATA_DEFAULTS=026 leave the table out.
@@ -244,7 +244,7 @@ std::vector<std::string> apply_nv_defaults(int major, int minor, uint64_t main_v
// sm_86 / sm_89 / sm_70 / sm_60: bit-exact switches. sm_121: the fused prompt path and the FP4-activation NVFP4 prompt round differently from the
// paths they replace (24 of 24 greedy answers were identical on the Spark; no KL run), so the line does not say "exact".
const bool sm120 = mj == 12 && mn == 0;
const bool sm70 = mj == 7 && mn == 0;
const bool sm70 = mj == 7 && (mn == 0 || mn == 2);
// ADAPT_FETCH (a card of 16 GiB or less) is not bit-exact either: the line then says so and names its own way back
std::fprintf(stderr, "strata: %s: %zu %sspeed switches on by default (%s=0 turns them off%s; a switch you set is kept%s): ",
sm86 ? "sm_86 (Ampere)" : sm89 ? "sm_89 (Ada)" : sm121 ? "sm_121 (GB10)" : sm120 ? "sm_120 (Blackwell)" : sm70 ? "sm_70 (Volta)" : "sm_60 (Pascal)", set.size(), sm121 || fetch_set ? "" : "exact ",
+1 -1
View File
@@ -1413,7 +1413,7 @@ bool cur_dev_volta() {
int major = 0, minor = 0;
cudaDeviceGetAttribute(&major, cudaDevAttrComputeCapabilityMajor, dev);
cudaDeviceGetAttribute(&minor, cudaDevAttrComputeCapabilityMinor, dev);
per_dev[dev] = major == 7 && minor == 0 ? 2 : 1;
per_dev[dev] = major == 7 && minor < 5 ? 2 : 1;
}
return per_dev[dev] == 2;
#endif
+2 -2
View File
@@ -47,7 +47,7 @@ __device__ __forceinline__ uint2 i8h_cvt4(uint32_t w) {
return make_uint2(*(const uint32_t*) &l, *(const uint32_t*) &h);
}
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ == 700
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 700 && __CUDA_ARCH__ < 750
__device__ __forceinline__ void i8h_mma(float (&d)[8], uint2 a, uint2 b) {
asm volatile("mma.sync.aligned.m8n8k4.row.col.f32.f16.f16.f32 {%0,%1,%2,%3,%4,%5,%6,%7}, {%8,%9}, {%10,%11}, {%0,%1,%2,%3,%4,%5,%6,%7};\n"
: "+f"(d[0]), "+f"(d[1]), "+f"(d[2]), "+f"(d[3]), "+f"(d[4]), "+f"(d[5]), "+f"(d[6]), "+f"(d[7])
@@ -60,7 +60,7 @@ __global__ void __launch_bounds__(I8_NT, 2)
i8h_kernel(const unsigned long long* __restrict__ grp_ptr, const int32_t* __restrict__ grp_start, const int32_t* __restrict__ n_groups,
const int32_t* __restrict__ tile_off, const int32_t* __restrict__ ent_idx, const block_q8_1* __restrict__ A,
block_q8_1* __restrict__ hq, float* __restrict__ out, NativeExpertLayout L) {
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ == 700
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 700 && __CUDA_ARCH__ < 750
using SM = I8HSmem<T>;
extern __shared__ uint4 i8_dyn[];
uint32_t* const smem = (uint32_t*) i8_dyn;
+1 -1
View File
@@ -6797,7 +6797,7 @@ int exp_mode() {
// layout in windows of 4+ tokens (sm75_down_em below). STRATA_SM75_EXP=0 keeps the CUDA layout.
// (off unless STRATA_SM75_PERF=1; STRATA_SM75_EXP=0 / 1 forces it off / on)
const bool turing = strata::sm75_switch("STRATA_SM75_EXP", major, minor);
per_dev[dev] = 1 + ((major == 7 && minor == 0 && sm70 != nullptr && std::atoi(sm70) != 0) || p100 || p40 || gb10 ? 8 : turing ? 4 : kExpModeDefault);
per_dev[dev] = 1 + ((major == 7 && minor < 5 && sm70 != nullptr && std::atoi(sm70) != 0) || p100 || p40 || gb10 ? 8 : turing ? 4 : kExpModeDefault);
}
return per_dev[dev] - 1;
#endif
+2 -1
View File
@@ -4159,6 +4159,7 @@ int il_cc() {
cc[dev] = 1201;
// STRATA_MMVQ_IL_SM80=0: an sm_80 card takes the shared table as before kIlRows_80 (A/B)
if (cc[dev] == 80 && !strata::sm80_default_on(std::getenv("STRATA_MMVQ_IL_SM80"), strata::qwen_defaults_026())) cc[dev] = 81; // =0 or STRATA_DEFAULTS=026
if (cc[dev] == 72) cc[dev] = 70; // Jetson Xavier (sm_72) uses the Volta (sm_70) interleaved tables
cudaGetLastError();
}
return cc[dev];
@@ -4208,7 +4209,7 @@ bool il_arch_ok() {
int minor = 0;
cudaDeviceGetAttribute(&minor, cudaDevAttrComputeCapabilityMinor, dev);
ok[dev] = (cudaDeviceGetAttribute(&major, cudaDevAttrComputeCapabilityMajor, dev) == cudaSuccess &&
(major >= 8 || (major == 7 && minor == 0 && sm70_opt_in()) || (major == 7 && minor == 5 && sm75_il_on(major, minor)) ||
(major >= 8 || (major == 7 && minor < 5 && sm70_opt_in()) || (major == 7 && minor == 5 && sm75_il_on(major, minor)) ||
(major == 6 && minor == 0 && sm60_table_on()) || (major == 6 && minor == 1 && sm61_table_on()))) ? 1 : -1;
}
return ok[dev] > 0;