1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Which shapes take the tiled matmul path.
//!
//! These queries are architecture-neutral. Callers on every target read them,
//! including targets that compile no SIMD matmul kernel.
use crate;
/// Small matrix threshold - below this, register-blocked SIMD is faster than tiled
pub const SMALL_MATRIX_THRESHOLD: usize = 128 * 128 * 128 + 1;
/// Do the transposed-B entry points take the tiled path for this shape?
///
/// The tiled path is the one that packs B panels straight out of the `[N, K]`
/// buffer, producing panels byte-identical to a materialized `[K, N]` operand —
/// so on that path, and only on that path, `matmul_bt_f32` and `matmul_f32`
/// agree bit for bit. Anywhere else the transposed operand runs a different
/// kernel (the dot-product GEMV-BT one), which agrees within tolerance but
/// accumulates in its own order. Callers that require identity gate on this.
/// Fewest output columns that keep an `m × n × k` product on the tiled path.
///
/// A caller splitting N across threads uses this as its chunk floor. A chunk
/// narrower than this drops below `SMALL_MATRIX_THRESHOLD` and runs the
/// small-matrix kernel instead, which both accumulates in a different order
/// and — for a transposed B — is a *different* kernel from the contiguous
/// case, breaking the bit-for-bit agreement [`matmul_bt_is_tiled`] promises.
///
/// Returns `usize::MAX` when `m * k` is zero, so no split can clear the floor.
/// Does this SIMD level have a tiled microkernel, rather than the scalar path?
/// Does this SIMD level have a tiled microkernel, rather than the scalar path?
/// Does this SIMD level have a tiled microkernel, rather than the scalar path?