mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-04 15:28:40 +00:00
kernels: mla_latent_attn: 32-head tile for Q8_0 decode at 128 heads on cards with 96+ SMs
Same as the f-mla-kernel commit f6235e80d.
This commit is contained in:
1 parent
8aad19ca6e
commit
b8cd23ffa8
1 file changed
+1
-1
@@ -780,7 +780,7 @@ Chosen choose(const MlaLatentArgs& a) {
|
||||
const bool want_tc = a.precision == MlaPrecision::kTcFast || a.precision == MlaPrecision::kTcSplit || (a.precision == MlaPrecision::kAuto && tc_by_default(a, d));
|
||||
if (force == 0 && want_tc && mma_allowed(a) && d.cc >= 80 && d.smem_optin >= static_cast<int>(tc_smem_bytes(false, 2, false))) {
|
||||
c.variant = (a.precision == MlaPrecision::kTcFast) ? kVarTcFast : kVarTcSplit;
|
||||
c.rm = (c.variant == kVarTcFast && a.n_head % 32 == 0 && static_cast<long>(a.n_tok) * (a.n_head / 32) >= 16 && !a.bit_exact_per_query) ? 32 : 16; // 32 heads a block pays off with 16+ tiles of 32 heads (verify windows of 8+, prompts); decode and the per-query mode keep 16 (2 blocks per SM, more parallelism)
|
||||
c.rm = (c.variant == kVarTcFast && a.n_head % 32 == 0 && (static_cast<long>(a.n_tok) * (a.n_head / 32) >= 16 || (a.type == MlaCacheType::kQ8_0 && a.n_head >= 128 && d.sm >= 96)) && !a.bit_exact_per_query) ? 32 : 16; // Q8_0 decode at 128 heads: the dequantisation repeats for every 16-head tile; measured: +13 % on the 110-SM sm_120 card, -12 % on the 48-SM sm_86 card // 32 heads a block pays off with 16+ tiles of 32 heads (verify windows of 8+, prompts); decode and the per-query mode keep 16 (2 blocks per SM, more parallelism)
|
||||
}
|
||||
}
|
||||
const int max_idx = a.sel ? a.n_sel : a.max_kv;
|
||||
|
||||
Reference in new issue
Block a user