mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
prefill: the fused prompt kernels are the default on compute capability 8.6 cards with 80+ SMs (IQ3_S pack formats)
Owner decision of 11-11 ("waiting for the gates still running, then yes"), after the A6000 gate series. The default rule in
fused::native_supported() (sm_120 with 80+ SMs, IQ2_S / IQ3_XXS / IQ3_S / IQ4_XS gate/up with IQ4_NL / Q2_0 down) now also takes
compute capability 8.6 cards with 80+ SMs: RTX A6000 / A40 (84), RTX 3090 Ti (84), RTX 3090 (82), RTX 3080 Ti (80). DevInfo gets
s86, read from the raw attributes like s120; the tile pick is unchanged (it never looked at s120 for these cards), so the default
path is exactly the STRATA_PF_FUSED=1 path the gates measured. sm_86 below 80 SMs (RTX A4000 48, RTX 3080 68, A10 72) keeps MMQ:
no real-model data there, and one-layer timings on the A4000 lose at 8K for some formats. Other formats, chunks below 1,024
tokens and every other card class: unchanged.
Gates (RTX A6000, 84 SMs, Boston GPU 0, IQ3_S pack, STRATA_PF_FUSED=1 = fused against the MMQ default):
| gate | rule | result |
|---|---|---|
| prompt speed, 5 interleaved pairs (lane OWN-4N) | fused >= MMQ | 4K x1.067, 8K x1.036, 20K x1.010, 5/5 each |
| first-token KL vs the FP16 prompt path, 2,048 x 48 | <= MMQ | 0.00921 vs MMQ 0.01120 / again 0.01042; top-1 47 vs 46 / 46; routing to FP16 72.146 vs 71.973 % |
| same, 4K x 16 | <= MMQ | 0.00886 vs 0.02569 / 0.02527 |
| same, 8K x 48 | <= MMQ | 0.00763 vs 0.00771 / 0.00853; top-1 47 / 47 |
| same, 20K x 48 | <= MMQ | 0.00814 vs 0.00816 / 0.00797 (MMQ run to run 0.00088); top-1 48 / 48 |
| same, 1,000 x 24 | (both arms are MMQ below 1,024) | 0.01323 vs 0.01324 |
| neutral-writer forced tokens (llama.cpp writer), 48 prompts x 128 (16 each 4K / 8K / 20K), 6,042 tokens | rate +0.5 pt (90 % CI) and event rule | cand 2.814 / 2.929 % vs stock 2.929 / 2.830 %; diff -0.066 [-0.354, 0.228] and +0.050 [-0.253, 0.381] pt; events 0 / 0; PASS |
| small chunks 300 / 1,000 / 1,100 / 2,048 x 3 | all answer | all answered; top-1 12 / 12 both arms |
| agent: a 4K turn + 8 follow-ups, prompt cache on | all turns answer | all answered, both arms |
| first 8K read, 12 fresh engines per arm | no fused first read > 2x the stock median | 0 of 12; medians 3,068-3,089 ms fused vs 3,168-3,177 ms MMQ |
| backstop (STRATA_DBG_FORCE_SLOW_LAYER=1, fused) | answer or a clear error, no hang | the designed clear error ("the fused layout's MoE buffers are too small ... chunk of 4092 tokens"), no hang, as lane OWN-4N's step-1 backstop |
Kernel parity of these formats on sm_86 (prefill_fused_iq_test, A6000 and A4000) passed earlier; nothing in the kernels changes here.
STRATA_PF_FUSED_SM86=0 puts these cards back on MMQ: a diagnostic for bug reports, registered as "research" (not a user setting,
not in docs/SETTINGS.md); it goes away with MMQ in release C. STRATA_PF_FUSED=0 still turns every fused kernel off.
Host code only (src/prefill/moe_fused_iq.cu: DevInfo::s86, its setting in dev_info(), the rule in native_supported() and its
comments; data/settings-register.json: the new entry).
This commit is contained in:
1 parent
9e19948ff9
commit
4543053612
2 files changed
+45
-4
No files matched your search
@@ -25858,6 +25858,39 @@
|
||||
"retire_after": "",
|
||||
"retired_in": ""
|
||||
},
|
||||
{
|
||||
"name": "STRATA_PF_FUSED_SM86",
|
||||
"backends": [
|
||||
"cuda"
|
||||
],
|
||||
"reads": [
|
||||
{
|
||||
"file": "src/prefill/moe_fused_iq.cu",
|
||||
"line": 2171,
|
||||
"backend": "cuda",
|
||||
"fn": "getenv"
|
||||
}
|
||||
],
|
||||
"parse": "flag",
|
||||
"default_state": null,
|
||||
"code_default": null,
|
||||
"engine_sets": [],
|
||||
"engine_defaults": [],
|
||||
"launch_files": [],
|
||||
"launch_sets": [],
|
||||
"launch_reads": [],
|
||||
"doc_mentions": [],
|
||||
"first_commit": "",
|
||||
"first_date": "",
|
||||
"since": "",
|
||||
"last_commit": "",
|
||||
"last_date": "",
|
||||
"status": "research",
|
||||
"owner": "prefill",
|
||||
"note": "CUDA diagnostic for bug reports, not a user setting: =0 puts compute capability 8.6 cards with 80+ SMs back on MMQ for the IQ3_S pack's formats (the fused prompt kernels are the default there since 11-11). Goes away with MMQ (release C).",
|
||||
"retire_after": "",
|
||||
"retired_in": ""
|
||||
},
|
||||
{
|
||||
"name": "STRATA_PF_FUSED_TILE",
|
||||
"backends": [
|
||||
|
||||
@@ -1987,6 +1987,7 @@ struct DevInfo {
|
||||
bool q2n = false; // sm_80+ with STRATA_PF_FUSED_Q2N=1: the native Q2_0 pack's Q2_0 gate/up is set up as well (opt-in)
|
||||
bool s120 = false; // compute capability 12.0 (sm120_series.hpp): the default for the formats measured there
|
||||
bool s121 = false; // GB10 (sm_121, DGX Spark): 128-row tiles win from 65,536 routed rows a launch up (pick_ww)
|
||||
bool s86 = false; // compute capability 8.6 (RTX A6000 / A40 / RTX 3090 class): the same default as s120 with 80+ SMs (STRATA_PF_FUSED_SM86=0 off)
|
||||
int sms = 0, occ = 1;
|
||||
int occ_nt = 0; // blocks per multiprocessor of the NT = 256 kernels (0: not set up)
|
||||
bool ws = false; // STRATA_PF_FUSED_WS: the warp-specialized kernels are set up
|
||||
@@ -2166,6 +2167,9 @@ const DevInfo& dev_info() {
|
||||
cudaDeviceGetAttribute(&minor, cudaDevAttrComputeCapabilityMinor, dev);
|
||||
d.s120 = strata::sm120_default(major, minor); // (takes the raw attributes, as is_sm120 does)
|
||||
d.s121 = major == 12 && minor == 1; // GB10 (DGX Spark): its own tile threshold, see pick_ww
|
||||
// sm_86 (raw attributes, as s120): STRATA_PF_FUSED_SM86=0 is a diagnostic for bug reports (MMQ on these cards again); it goes with MMQ
|
||||
static const bool sm86_off = [] { const char* v = std::getenv("STRATA_PF_FUSED_SM86"); return v != nullptr && v[0] == '0'; }();
|
||||
d.s86 = major == 8 && minor == 6 && !sm86_off;
|
||||
major = strata::cc_major_of(major); // STRATA_EMULATE_CC counts (tests)
|
||||
minor = strata::cc_minor_of(minor);
|
||||
cudaDeviceGetAttribute(&d.sms, cudaDevAttrMultiProcessorCount, dev);
|
||||
@@ -2497,15 +2501,19 @@ bool native_supported(int gu_type, int d_type) {
|
||||
// prompt +7.0% 4K, +5.2% 20K, +3.4% 98K; teacher-forced KL against MMQ 0.0002 over 5998 positions, 0.0010 over 1760 long
|
||||
// ones; first-token KL against the FP16 prompt path 0.01181 vs MMQ's 0.01236 over 48 prompts; HumanEval, reasoning,
|
||||
// agent, needles, CJK and tool calls the same). IQ2_XXS / IQ2_XS gate/up (the IQ3_XXS and IQ2_XS packs) keep MMQ until
|
||||
// measured. Every other CUDA card: opt-in as before.
|
||||
// measured. The same on a compute capability 8.6 card with 80+ SMs (RTX A6000, 84 SMs, IQ3_S pack, 11-11: prompt +6.7% 4K, +3.6% 8K,
|
||||
// +1.0% 20K, 5/5 each; first-token KL against the FP16 prompt path at or below MMQ's at 2,048 / 4K / 8K / 20K; neutral-writer
|
||||
// forced-token gate PASS over 48 prompts; small chunks, agent, first 8K read, backstop as MMQ; STRATA_PF_FUSED_SM86=0 off).
|
||||
// Every other CUDA card: opt-in as before.
|
||||
if (env < 0) {
|
||||
// the native Q2_0 pack's Q2_0 / Q2_0 layers: only with STRATA_PF_FUSED_Q2N=1 (d.q2n), on any sm_80+ card
|
||||
if (gu_type == T_Q2_0) { const DevInfo& d = dev_info(); return d.ok && d.q2n && d_type == T_Q2_0 && d_covered_on(d_type, d); }
|
||||
if (gu_type != T_IQ2_S && gu_type != T_IQ3_XXS && gu_type != T_IQ3_S && gu_type != T_IQ4_XS) return false;
|
||||
const DevInfo& d = dev_info();
|
||||
// 12.0 cards with 80+ SMs only (RTX PRO 5000 / 6000, RTX 5080 / 5090): on an RTX 5070 (48 SMs, IQ2_XS pack, experts
|
||||
// partly in RAM) the fused kernels were 4.7% slower on 20K prompts (0/6 pairs) - it keeps MMQ unless STRATA_PF_FUSED=1
|
||||
return d.ok && d.s120 && d.sms >= 80 && !d.t75 && d_covered_on(d_type, d);
|
||||
// 12.0 and 8.6 cards with 80+ SMs only (RTX PRO 5000 / 6000, RTX 5080 / 5090; RTX A6000 / A40, RTX 3090 / 3090 Ti / 3080 Ti):
|
||||
// on an RTX 5070 (48 SMs, IQ2_XS pack, experts partly in RAM) the fused kernels were 4.7% slower on 20K prompts (0/6 pairs),
|
||||
// and the RTX A4000 (sm_86, 48 SMs) has no real-model data - they keep MMQ unless STRATA_PF_FUSED=1
|
||||
return d.ok && (d.s120 || d.s86) && d.sms >= 80 && !d.t75 && d_covered_on(d_type, d);
|
||||
}
|
||||
if (gu_type == T_Q2_0 && d_type != T_Q2_0) return false; // the opt-in (STRATA_PF_FUSED=1 as well) takes the Q2_0 / Q2_0 pair only
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user