Latest Results
sbdot: convert in stack blocks instead of malloc'ing two n-float buffers
kernel/x86_64/sbdot.c is the SBDOT kernel of every BFLOAT16 build, on
all architectures (no KERNEL file overrides it; the Makefile build
enables BFLOAT16 by default on arm64 and POWER). Except for unit-stride
calls served by the AVX512-BF16 kernel (Cooperlake/Sapphire Rapids),
each call, or each thread part, malloc'ed float copies of x and y
without a NULL check, converted them with SBF16TOS_K and called
SDOTU_K once.
Convert blocks of 1024 elements into one stack array instead, with an
inline conversion that gives the same bits as bf16to.c (denormals become
signed zeros, NaNs are made quiet, all other values are exact), and
call the same SDOTU_K per block. The first block result is taken as is
and later ones are added in order. The array is aligned to 64 bytes by
hand because MSVC builds this file too. Where the AVX512-BF16 kernel
exists, the generic path is kept out of line so that the accelerated
path does not set up its 8 KB frame.
Results are bit-identical whenever a thread part has at most 1024
elements. For longer vectors the block results are added in float,
which can change the result at rounding level and the payload of NaN
results; where SDOTU_K accumulates in double or x87 precision, sums
close to the float overflow or underflow limits can differ by more.
This also fixes a hang on arm64: kernel/arm64/dot.c threads SDOTU_K
again from inside each sbdot worker thread, and in the default
(pthreads) build that nested call never got a thread once sbdot itself
used all of them (on a 14-core Jetson Thor: n >= 552960 with the default
thread count). The 1024-element calls stay below dot.c's threading
threshold.
On a Zen 2 host, one thread, with the Zen, Haswell, Nehalem, Sandybridge
and Core2 kernels and incx 1 or 2, sbdot gets 1.18-1.57x faster for
n <= 100, 1.65-1.89x at n = 1024, 2.48-2.70x at n = 4096, 5.91-6.12x at
n = 20000 and 7.39-8.11x for n = 10^5..10^6 (OPENBLAS_NUM_THREADS=4,
Zen and Haswell kernels: 7.2-7.8x for n = 10^5..10^6). On a Jetson Thor
(Neoverse V3AE, NEOVERSEV2 kernels), one thread: 1.54-2.43x for
n <= 4096 and 7.17-7.90x for n = 10^5..10^6. Latest Branches
0%
0%
SmaCow666:fix/rvv-extrema-valid-seed 0%
velonica0:openblas_zgemm_kernel_n © 2026 CodSpeed Technology