mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
prefill: the staged 40-79 SM class takes Flash-Next's K-quant experts on the fused kernels by default again (STRATA_PF_FUSED_SM40=0 and STRATA_PF_FUSED_KQ=0 give MMQ back)
This puts the 40-79 SM cards back into kq_takes for an unset switch, as the default commit had them: takes_by_default with its staged-launch clause (the K-quant gate/up is a weight-staging instance and its Q5_1 / Q8_0 down is one the staged kernels were measured with). The commit before this one took the class out because its one-layer table is below MMQ at 20,000 tokens; the rule for a default here is that our own kernels take over where quality is kept, also when they are a little slower at the largest size. The evidence for the class: - One layer of Flash-Next's shape on an RTX A4000 (sm_86, 48 SMs, CUDA 12.9, 128-row tile, one repetition), MMQ time / fused time at 300 / 1,000 / 2,048 / 4,096 / 8,192 / 20,000 tokens: 1.67 / 1.44 / 1.49 / 1.35 / 1.05 / 0.97 (Q4_K / Q5_1), 1.79 / 1.61 / 1.67 / 1.46 / 1.08 / 0.98 (Q4_K / Q8_0), 1.72 / 1.59 / 1.60 / 1.45 / 1.05 / 0.99 (Q5_K / Q8_0): ahead up to 8,192 tokens, 1 to 3% behind at 20,000. - The staged K-quant fused path runs end to end on that A4000 in the Qwen3.6 engine. - No end-to-end run of Flash-Next on a card of that size; the Qwen3.6 engine runs the same staged path there. The commit undoes the one before it (kq_takes takes its SM40 argument again, the grid test, the start-up-line test, the register note and the docs/QUANTS.md row name the RTX A4000 and RTX 5070 class again) and adds the numbers above to the comment of kq_takes. Host code only.
This commit is contained in:
1 parent
df723eb5a1
commit
d1ec6f0397
8 files changed
+46
-42
No files matched your search
@@ -24173,7 +24173,7 @@
|
||||
"last_date": "2026-11-05",
|
||||
"status": "rollback",
|
||||
"owner": "prefill",
|
||||
"note": "[11-12] CUDA: the K-quant experts of UD-Q4_K_XL (Q4_K / Q5_K gate/up with a Q5_1 or Q8_0 down) are read by Strata's fused prompt kernels by default on compute capability 8.0, 8.6, 8.9 and 12.0 cards with 80 or more multiprocessors (RTX A6000, A40, RTX 3090, RTX PRO 5000 class); cards with fewer (RTX A4000, RTX 5070 class) stay on MMQ unless =1; =0 puts them back on MMQ, =1 takes them on every sm_80+ card. AMD: still opt-in (=1 with STRATA_PF_FUSED=1 on gfx12; on by default on gfx1151 under Windows). One layer on the RTX A6000, Q4_K / Q5_1, MMQ time / fused time with the 128-row tile: 1.65 / 1.49 / 1.52 / 1.29 / 1.04 / 0.97 / 0.88 at 300 / 1,000 / 2,048 / 4,096 / 8,192 / 20,000 / 32,768 tokens. [docs/STRIX_HALO.md:228]",
|
||||
"note": "[11-12] CUDA: the K-quant experts of UD-Q4_K_XL (Q4_K / Q5_K gate/up with a Q5_1 or Q8_0 down) are read by Strata's fused prompt kernels by default on compute capability 8.0, 8.6, 8.9 and 12.0 cards with 80 or more multiprocessors (RTX A6000, A40, RTX 3090, RTX PRO 5000 class), and with 40 to 79 on the staged launches unless STRATA_PF_FUSED_SM40=0; =0 puts them back on MMQ, =1 takes them on every sm_80+ card. AMD: still opt-in (=1 with STRATA_PF_FUSED=1 on gfx12; on by default on gfx1151 under Windows). One layer on the RTX A6000, Q4_K / Q5_1, MMQ time / fused time with the 128-row tile: 1.65 / 1.49 / 1.52 / 1.29 / 1.04 / 0.97 / 0.88 at 300 / 1,000 / 2,048 / 4,096 / 8,192 / 20,000 / 32,768 tokens. [docs/STRIX_HALO.md:228]",
|
||||
"retire_after": "",
|
||||
"retired_in": ""
|
||||
},
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ SHA-256), so a PC that has one of them can link those two shards instead of down
|
||||
|
||||
| Format (role) | CUDA decode (grouped experts) | CUDA prompt | CPU pool | AMD (HIP) decode | AMD prompt | Intel (SYCL) decode | Intel prompt |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| Q4_K (gate/up) | yes | FP16 path; MMQ with `STRATA_MMQ_KQ=1`; UD-Q4_K_XL's experts (a Q4_K or Q5_K gate/up with a Q5_1 or Q8_0 down) are read by Strata's own kernels on RTX A6000, RTX 3090 and RTX PRO 5000 class cards (80 or more multiprocessors); smaller cards such as the RTX A4000 keep MMQ unless `STRATA_PF_FUSED_KQ=1`; `STRATA_PF_FUSED_KQ=0` gives MMQ back | ggml AVX2 dot; multi-token AVX2 (`STRATA_KQ256=1`) | yes (CUDA layout; `STRATA_EXPERT_V2K=1` bitwise) | FP16 path; MMQ with `STRATA_MMQ_KQ=1`; gfx11 fused (`STRATA_PF_FUSED_KQ=1`) | kernels built, not run with these files | FP16 path |
|
||||
| Q4_K (gate/up) | yes | FP16 path; MMQ with `STRATA_MMQ_KQ=1`; UD-Q4_K_XL's experts (a Q4_K or Q5_K gate/up with a Q5_1 or Q8_0 down) are read by Strata's own kernels on RTX A6000, RTX 3090 and RTX PRO 5000 class cards, and on RTX A4000 and RTX 5070 class cards for the launches Strata stages; `STRATA_PF_FUSED_KQ=0` gives MMQ back | ggml AVX2 dot; multi-token AVX2 (`STRATA_KQ256=1`) | yes (CUDA layout; `STRATA_EXPERT_V2K=1` bitwise) | FP16 path; MMQ with `STRATA_MMQ_KQ=1`; gfx11 fused (`STRATA_PF_FUSED_KQ=1`) | kernels built, not run with these files | FP16 path |
|
||||
| Q5_K (gate/up) | yes | as Q4_K | ggml AVX2 dot | as Q4_K | as Q4_K | kernels built, not run with these files | FP16 path |
|
||||
| Q6_K (gate/up) | yes (since this change; was `-DSTRATA_Q6K_EXPERTS=ON`) | FP16 path; MMQ with `STRATA_MMQ_KQ=1` | ggml AVX2 dot | yes (CUDA layout) | FP16 path; MMQ with `STRATA_MMQ_KQ=1` | kernels built, not run with these files | FP16 path |
|
||||
| Q5_1 (down) | yes | as Q4_K | ggml AVX2 dot; multi-token AVX2 (`STRATA_KQ256=1`) | yes (CUDA layout; V2K) | as Q4_K | kernels built, not run with these files | FP16 path |
|
||||
|
||||
@@ -49,7 +49,7 @@ std::vector<std::pair<std::string, std::string>> nv_kq_default_env(int min_major
|
||||
/// kernels read the K-quant experts on this machine (nv_kq_fused_here for a visible card); the line then says so, otherwise it is the earlier line, byte for byte.
|
||||
std::vector<std::string> apply_nv_kq_default(int min_major, int min_minor, bool fused_here = false);
|
||||
/// Whether a CUDA card (raw compute capability, its multiprocessor count) reads UD-Q4_K_XL's K-quant experts (Q4_K / Q5_K gate/up with a Q5_1 or Q8_0 down) on Strata's
|
||||
/// own fused kernels, from the environment as the engine reads it: the card rule of fused_tile::kq_takes with STRATA_PF_FUSED_KQ and
|
||||
/// own fused kernels, from the environment as the engine reads it: the card rule of fused_tile::kq_takes with STRATA_PF_FUSED_KQ, STRATA_PF_FUSED_SM40 and
|
||||
/// STRATA_PF_FUSED_SM86; STRATA_PF_FUSED=0 turns every fused kernel off.
|
||||
bool nv_kq_fused_here(int major, int minor, int sms);
|
||||
/// The line apply_nv_kq_default prints (without the newline).
|
||||
|
||||
@@ -170,14 +170,15 @@ constexpr bool q36_takes(int env, const Card& c, int sm40_env, bool gate_staged,
|
||||
// ---- Flash-Next's K-quant experts (UD-Q4_K_XL, and the other packs with a Q4_K / Q5_K gate/up and a Q5_1 or Q8_0 down: CUDA): whether the engine sets the K-quant fused kernels up on a card (dev_info in
|
||||
// src/prefill/moe_fused_iq.cu), which is what lets native_supported take those layers. STRATA_PF_FUSED_KQ as pf_env reads it: -1 unset or empty, 1 = a value starting with '1' (on for every sm_80+
|
||||
// card, as the opt-in always was), 0 = any other value (off: those layers stay on MMQ). Unset takes them on the cards the i-quant default rule takes (takes_by_default: sm_86-class and sm_120 cards
|
||||
// with 80+ SMs; the 40-79 SM cards are NOT in the K-quant default, whatever STRATA_PF_FUSED_SM40 says: one layer of Flash-Next's shape on an RTX A4000 (sm_86, 48 SMs, CUDA 12.9, 128-row tile, one repetition) has the fused
|
||||
// path at 1.67 / 1.44 / 1.49 / 1.35 / 1.05 / 0.97 (Q4_K / Q5_1), 1.79 / 1.61 / 1.67 / 1.46 / 1.08 / 0.98 (Q4_K / Q8_0) and 1.72 / 1.59 / 1.60 / 1.45 / 1.05 / 0.99 (Q5_K / Q8_0) times MMQ's speed at 300 / 1,000 / 2,048 /
|
||||
// 4,096 / 8,192 / 20,000 tokens, so below MMQ at 20,000 tokens, and no end-to-end run exists on such a card. STRATA_PF_FUSED_KQ=1 still sets the kernels up on every sm_80+ card. STRATA_PF_FUSED=0 still turns every fused
|
||||
// kernel off (native_supported checks it first). Evidence: par/RESULTS-KQ-DEFAULT.md (RTX A6000 end to end with UD-Q4_K_XL; one layer on the RTX PRO 5000 and the RTX A4000).
|
||||
constexpr bool kq_takes(int kq_env, const Card& c) {
|
||||
// with 80+ SMs, and the staged launches on 40-79 SMs unless STRATA_PF_FUSED_SM40=0): the K-quant gate/up (Q4_K / Q5_K) is a weight-staging instance (sw_on) and its Q5_1 / Q8_0 down is one the staged
|
||||
// kernels were measured with, so the launch kind is (staged, down ok) for every pair this decides. STRATA_PF_FUSED=0 still turns every fused kernel off (native_supported checks it first).
|
||||
// Evidence: par/RESULTS-KQ-DEFAULT.md (RTX A6000 end to end with UD-Q4_K_XL; one layer on the RTX PRO 5000 and RTX A4000). The 40-79 SM class: one layer of Flash-Next's shape on an RTX A4000 (sm_86, 48 SMs, CUDA 12.9, 128-row tile, one
|
||||
// repetition), MMQ time / fused time 1.67 / 1.44 / 1.49 / 1.35 / 1.05 / 0.97 (Q4_K / Q5_1), 1.79 / 1.61 / 1.67 / 1.46 / 1.08 / 0.98 (Q4_K / Q8_0), 1.72 / 1.59 / 1.60 / 1.45 / 1.05 / 0.99 (Q5_K / Q8_0) at 300 / 1,000 / 2,048 / 4,096 /
|
||||
// 8,192 / 20,000 tokens: ahead up to 8,192, 1 to 3% behind at 20,000. No end-to-end run of Flash-Next on a card of that size; the Qwen3.6 engine runs the same staged path there.
|
||||
constexpr bool kq_takes(int kq_env, const Card& c, int sm40_env) {
|
||||
if (kq_env == 0) return false;
|
||||
if (kq_env > 0) return true;
|
||||
return (c.s86 || c.s120) && c.sms >= 80; // takes_by_default's 80+ SM rule (sm_121 alone and cards with neither flag stay out); its 40-79 SM clause is left out
|
||||
return takes_by_default(c, sm40_on(sm40_env), true, true);
|
||||
}
|
||||
|
||||
// ---- the weight-staging guard (check_staged_blobs's decision in src/prefill/moe_fused_iq.cu), as pure functions so the decision can be tested without a GPU.
|
||||
|
||||
@@ -136,7 +136,7 @@ bool nv_kq_fused_here(int major, int minor, int sms) {
|
||||
namespace ft = strata::prefill::fused_tile;
|
||||
if (ft::pf_env(std::getenv("STRATA_PF_FUSED")) == 0) return false;
|
||||
const ft::Card c{strata::sm120_default(major, minor), major == 12 && minor == 1, sms, ft::s86_class(major, minor, off("STRATA_PF_FUSED_SM86"))};
|
||||
return ft::kq_takes(ft::pf_env(std::getenv("STRATA_PF_FUSED_KQ")), c);
|
||||
return ft::kq_takes(ft::pf_env(std::getenv("STRATA_PF_FUSED_KQ")), c, ft::sm40_env_of(std::getenv("STRATA_PF_FUSED_SM40")));
|
||||
}
|
||||
|
||||
std::string nv_kq_default_line(bool fused_here) {
|
||||
|
||||
@@ -97,10 +97,10 @@ int main() {
|
||||
unset("STRATA_PF_FUSED"); unset("STRATA_PF_FUSED_KQ"); unset("STRATA_PF_FUSED_SM40"); unset("STRATA_PF_FUSED_SM86");
|
||||
CHECK(nv_kq_fused_here(8, 6, 84) && nv_kq_fused_here(8, 6, 80) && nv_kq_fused_here(12, 0, 110) && nv_kq_fused_here(12, 0, 80)); // RTX A6000, RTX PRO 5000 class
|
||||
CHECK(nv_kq_fused_here(8, 0, 108) && nv_kq_fused_here(8, 9, 128)); // the sm_86 class
|
||||
CHECK(!nv_kq_fused_here(8, 6, 48) && !nv_kq_fused_here(12, 0, 48) && !nv_kq_fused_here(8, 6, 79)); // 40-79 SMs (RTX A4000, RTX 5070): not in the default
|
||||
CHECK(nv_kq_fused_here(8, 6, 48) && nv_kq_fused_here(12, 0, 48)); // 40-79 SMs: the staged launches
|
||||
CHECK(!nv_kq_fused_here(8, 6, 39) && !nv_kq_fused_here(12, 1, 48) && !nv_kq_fused_here(7, 5, 68) && !nv_kq_fused_here(8, 7, 16) && !nv_kq_fused_here(9, 0, 132)); // under 40 SMs, GB10, Turing, Orin, Hopper
|
||||
put("STRATA_PF_FUSED_SM40", "1");
|
||||
CHECK(!nv_kq_fused_here(8, 6, 48) && nv_kq_fused_here(8, 6, 84)); // the 40-79 SM switch does not move it
|
||||
put("STRATA_PF_FUSED_SM40", "0");
|
||||
CHECK(!nv_kq_fused_here(8, 6, 48) && nv_kq_fused_here(8, 6, 84));
|
||||
unset("STRATA_PF_FUSED_SM40");
|
||||
put("STRATA_PF_FUSED_KQ", "0");
|
||||
CHECK(!nv_kq_fused_here(8, 6, 84) && !nv_kq_fused_here(12, 0, 110)); // the way back
|
||||
|
||||
@@ -2372,13 +2372,14 @@ const DevInfo& dev_info() {
|
||||
// setup leaves those layers on the FP16 path.
|
||||
if (int o3 = 1 << 20; d.ok && q50_cuda_requested() && setup_one<T_Q5_0, false>(o3)) { d.q50 = true; d.occ_q50 = o3; }
|
||||
// The K-quant experts of UD-Q4_K_XL - gate/up Q4_K / Q5_K, down Q5_1 (or Q8_0) - on native_kernel instead of MMQ (libstrata_kq). On CUDA they are the
|
||||
// default on the cards of fused_tile::kq_takes (sm_86-class and sm_120 with 80+ SMs; not the 40-79 SM cards: their one-layer table is below MMQ at 20,000 tokens),
|
||||
// STRATA_PF_FUSED_KQ=1 sets them up on every sm_80+ card, STRATA_PF_FUSED_KQ=0 (or STRATA_PF_FUSED=0, native_supported) leaves them on MMQ.
|
||||
// default on the cards the i-quant default rule takes (fused_tile::kq_takes: sm_86-class and sm_120 with 80+ SMs, the staged launches on 40-79 SMs unless
|
||||
// STRATA_PF_FUSED_SM40=0), STRATA_PF_FUSED_KQ=1 sets them up on every sm_80+ card, STRATA_PF_FUSED_KQ=0 (or STRATA_PF_FUSED=0, native_supported) leaves them on MMQ.
|
||||
// The decode is the HIP kernels' (load_unit / convert: int8 codes, a scale and a minimum per 32 values); the minimum enters as s1 d_x (sum of the activation
|
||||
// codes), from the sums quant_act_nat_kernel and the K-quant gate/up epilogue store in the spare bytes. Their own occupancy (occ_kq); a failed setup leaves
|
||||
// those layers on MMQ. (kq_on() below is the HIP builds' reading of the switch; strata-q36 sets STRATA_PF_FUSED_KQ=1 itself, so its cards are unchanged.)
|
||||
static const int kq_env = strata::prefill::fused_tile::pf_env(std::getenv("STRATA_PF_FUSED_KQ"));
|
||||
const bool kq_want = strata::prefill::fused_tile::kq_takes(kq_env, {d.s120, d.s121, d.sms, d.s86});
|
||||
static const int kq_sm40_env = strata::prefill::fused_tile::sm40_env_of(std::getenv("STRATA_PF_FUSED_SM40"));
|
||||
const bool kq_want = strata::prefill::fused_tile::kq_takes(kq_env, {d.s120, d.s121, d.sms, d.s86}, kq_sm40_env);
|
||||
if (int o4 = 1 << 20; d.ok && kq_want && setup_one<T_Q4_K, true>(o4) && setup_one<T_Q5_K, true>(o4) && setup_one<T_Q5_1, false>(o4)) {
|
||||
d.kq = true;
|
||||
d.occ_kq = o4;
|
||||
|
||||
@@ -636,41 +636,43 @@ int main() {
|
||||
// Qwen3.6 (256 experts, top 8) is a different call: kq is never passed there, and wide_pair's answers above are unchanged
|
||||
CHECK(pick(a6000, 2048 * 8, 256, true, true, 0).ww == pick(a6000, 2048 * 8, 256, true, true).ww);
|
||||
}
|
||||
// ---- Flash-Next's K-quant experts by default: kq_takes(kq_env, card), whether dev_info sets the K-quant kernels up. The whole grid against an oracle written from the sentence of the decision:
|
||||
// STRATA_PF_FUSED_KQ=0 (or any value not starting with '1'): never. =1: every card. Unset: an sm_86-class or sm_120 card (not sm_121 alone, not a card with neither flag) with 80+ SMs; the 40-79 SM cards
|
||||
// and everything under 80 SMs never (the A4000's one-layer table is below MMQ at 20,000 tokens), whatever STRATA_PF_FUSED_SM40 says.
|
||||
// ---- Flash-Next's K-quant experts by default: kq_takes(kq_env, card, sm40_env), whether dev_info sets the K-quant kernels up. The whole grid against an oracle written from the sentence of the decision:
|
||||
// STRATA_PF_FUSED_KQ=0 (or any value not starting with '1'): never. =1: every card. Unset: the cards of the i-quant default rule (an sm_86-class or sm_120 card, not sm_121 alone, not a card with neither
|
||||
// flag) with 80+ SMs, 40-79 SMs while STRATA_PF_FUSED_SM40 is not "0", under 40 SMs never.
|
||||
{
|
||||
using namespace strata::prefill::fused_tile;
|
||||
long long cmp = 0, bad = 0, yes_def = 0, yes_below80 = 0;
|
||||
long long cmp = 0, bad = 0, yes_def = 0, yes40 = 0, yes80 = 0;
|
||||
for (int env = -1; env <= 1; ++env)
|
||||
for (int s120 = 0; s120 < 2; ++s120)
|
||||
for (int s86 = 0; s86 < 2; ++s86)
|
||||
for (int s121 = 0; s121 < 2; ++s121)
|
||||
for (int sms = 0; sms <= 200; ++sms) {
|
||||
const Card c{s120 != 0, s121 != 0, sms, s86 != 0};
|
||||
bool want = false;
|
||||
if (env == 1) want = true;
|
||||
if (env == -1) want = (s120 || s86) && sms >= 80;
|
||||
++cmp;
|
||||
if (kq_takes(env, c) != want) ++bad;
|
||||
if (want && env == -1) { ++yes_def; if (sms < 80) ++yes_below80; }
|
||||
}
|
||||
CHECK(bad == 0 && yes_def > 0 && yes_below80 == 0);
|
||||
std::printf("fused_tile_rule_test: Flash-Next K-quant default: %lld switch / card flag / SM count combinations (%lld wrong; %lld yes unset, none below 80 SMs)\n", cmp, bad, yes_def);
|
||||
for (int sm40e = -1; sm40e <= 1; ++sm40e)
|
||||
for (int s120 = 0; s120 < 2; ++s120)
|
||||
for (int s86 = 0; s86 < 2; ++s86)
|
||||
for (int s121 = 0; s121 < 2; ++s121)
|
||||
for (int sms = 0; sms <= 200; ++sms) {
|
||||
const Card c{s120 != 0, s121 != 0, sms, s86 != 0};
|
||||
bool want = false;
|
||||
if (env == 1) want = true;
|
||||
if (env == -1) want = (s120 || s86) && (sms >= 80 || (sms >= 40 && sm40e != 0));
|
||||
++cmp;
|
||||
if (kq_takes(env, c, sm40e) != want) ++bad;
|
||||
if (want && env == -1) { ++yes_def; (sms >= 80 ? yes80 : yes40)++; }
|
||||
}
|
||||
CHECK(bad == 0 && yes_def > 0 && yes40 > 0 && yes80 > 0);
|
||||
std::printf("fused_tile_rule_test: Flash-Next K-quant default: %lld switch / SM40 switch / card flag / SM count combinations (%lld wrong; %lld yes unset: %lld at 80+ SMs, %lld at 40-79)\n", cmp, bad, yes_def, yes80, yes40);
|
||||
// the switch as the engine reads it: the same reading as STRATA_PF_FUSED's (pf_env)
|
||||
CHECK(pf_env(nullptr) == -1 && pf_env("") == -1 && pf_env("1") == 1 && pf_env("0") == 0 && pf_env("off") == 0);
|
||||
// named cards, switch unset
|
||||
const Card a6000{false, false, 84, true}, a40{false, false, 84, true}, a4000{false, false, 48, true}, a100{false, false, 108, true}, rtx4090{false, false, 128, true}, pro5000{true, false, 110, false},
|
||||
rtx5090{true, false, 170, false}, rtx5070{true, false, 48, false}, gb10{false, true, 48, false}, rtx3050{false, false, 20, true}, turing{false, false, 68, false}, hopper{false, false, 132, false};
|
||||
for (const Card& c : {a6000, a40, a100, rtx4090, pro5000, rtx5090}) CHECK(kq_takes(-1, c) && !kq_takes(0, c) && kq_takes(1, c)); // 80+ SMs: on by default, =0 off
|
||||
for (const Card& c : {a4000, rtx5070, gb10, rtx3050, turing, hopper}) CHECK(!kq_takes(-1, c) && !kq_takes(0, c) && kq_takes(1, c)); // 40-79 SMs, sm_121, under 40 SMs, no class flag: the opt-in only
|
||||
// the same answer as the i-quant rule for a staged gate/up with a staged down on the 80+ SM cards; the 40-79 SM clause of that rule (sm40 on) is the one difference
|
||||
for (const Card& c : {a6000, a4000, a100, rtx4090, pro5000, rtx5090, rtx5070, gb10, rtx3050, turing, hopper}) CHECK(kq_takes(-1, c) == takes_by_default(c, false, true, true));
|
||||
CHECK(takes_by_default(a4000, true, true, true) && !kq_takes(-1, a4000));
|
||||
for (const Card& c : {a6000, a40, a100, rtx4090, pro5000, rtx5090}) CHECK(kq_takes(-1, c, -1) && kq_takes(-1, c, 0) && kq_takes(-1, c, 1) && !kq_takes(0, c, -1) && kq_takes(1, c, -1)); // 80+ SMs: the SM40 switch moves nothing
|
||||
for (const Card& c : {a4000, rtx5070}) CHECK(kq_takes(-1, c, -1) && kq_takes(-1, c, 1) && !kq_takes(-1, c, 0) && !kq_takes(0, c, -1) && kq_takes(1, c, 0)); // 40-79 SMs: on, STRATA_PF_FUSED_SM40=0 off
|
||||
for (const Card& c : {gb10, rtx3050, turing, hopper}) CHECK(!kq_takes(-1, c, -1) && !kq_takes(-1, c, 1) && !kq_takes(0, c, -1) && kq_takes(1, c, -1)); // sm_121, under 40 SMs, no class flag: the opt-in only
|
||||
// the same answer as the i-quant rule for a staged gate/up with a staged down, every card above
|
||||
for (const Card& c : {a6000, a4000, a100, rtx4090, pro5000, rtx5090, rtx5070, gb10, rtx3050, turing, hopper})
|
||||
for (int sm40e = -1; sm40e <= 1; ++sm40e) CHECK(kq_takes(-1, c, sm40e) == takes_by_default(c, sm40_on(sm40e), true, true));
|
||||
// compute capability: 8.0 / 8.6 / 8.9 are in the class (s86_class), 8.7 / 9.0 / 7.5 are not, STRATA_PF_FUSED_SM86=0 empties it
|
||||
CHECK(kq_takes(-1, Card{false, false, 108, s86_class(8, 0)}) && kq_takes(-1, Card{false, false, 128, s86_class(8, 9)}));
|
||||
CHECK(!kq_takes(-1, Card{false, false, 16, s86_class(8, 7)}) && !kq_takes(-1, Card{false, false, 132, s86_class(9, 0)}) && !kq_takes(-1, Card{false, false, 68, s86_class(7, 5)}) &&
|
||||
!kq_takes(-1, Card{false, false, 84, s86_class(8, 6, true)}));
|
||||
CHECK(kq_takes(-1, Card{false, false, 108, s86_class(8, 0)}, -1) && kq_takes(-1, Card{false, false, 128, s86_class(8, 9)}, -1));
|
||||
CHECK(!kq_takes(-1, Card{false, false, 16, s86_class(8, 7)}, -1) && !kq_takes(-1, Card{false, false, 132, s86_class(9, 0)}, -1) && !kq_takes(-1, Card{false, false, 68, s86_class(7, 5)}, -1) &&
|
||||
!kq_takes(-1, Card{false, false, 84, s86_class(8, 6, true)}, -1));
|
||||
}
|
||||
return failed == 0 ? 0 : 1;
|
||||
}
|
||||
Reference in new issue
Block a user