BLAS full-overwrite: matched-provider instruction evidence

Local candidate, not a native-speedup claim or merge-ready dependency chain.

Results

Same migrated baseline, strided revision, compiler, OpenBLAS and 1T settings; only tenferro's linked-BLAS full-overwrite implementation differs.

Workload Baseline Ir / operation Candidate Ir / operation Paired reduction
b32 × 128 × 128 × 128 43,895,074 39,696,305 9.560–9.569%
GEMM 1024 533,358,520 524,962,594 1.573–1.574%
LM sentence 3, 12d 1,009,589,326.5 968,164,607.75 4.103%, one exploratory pair

Binary cases report medians of three independent N3/N1 pairs. Every pair passes the predeclared instruction gate: BMM reduction >=5%, GEMM control regression <=1%. LM was an additional check, not a predeclared acceptance workload; its single pair is not a repeated-measurement performance claim. GEMM kernel self-Ir is identical in every baseline/candidate pair (33,273,536 for BMM, 512,386,632 for GEMM, and path-mean 444,650,842 for LM).

The candidate removes redundant Rust output initialization when BLAS beta=0 fully overwrites the result. It does not change the GEMM math kernel, add a batched BLAS API, remove canonical packing, or eliminate eager input copies. Empty contractions still initialize zeros; nonzero beta stays initialized. Injected providers do not advertise the new witness: their existing unsafe registration contract promises ABI compatibility rather than full overwrite.

Julia workloads were active, including in CPU16's L3 domain (CPUs16–23). No native timings, bandwidth figures, time shares or predicted speedups are reported. Timing fields in diagnostic/profiler stdout are intentionally ignored.

PyTorch and batched GEMM findings

Exact wheel source: PyTorch 0d62256a2b23365f8e1604297eb23a6545102aa8:

This justifies investigating small independent products separately, but not copying PyTorch's threshold into Rust without matching-kernel evidence.

Provenance and validation

Reproduction and retained evidence

Use the existing OpenBLAS image identified in raw/environment.txt, mount the workspace at the same absolute path (the harness embeds CARGO_MANIFEST_DIR), and point extern/tenferro-rs at separate baseline/candidate worktrees and extern/strided-rs at the fixed strided worktree. Do not overwrite a dirty checkout. raw/blas-bench-patch.toml records all six local strided overrides; raw/benchmark-Cargo.lock records dependency resolution. Sequential build command:

RUSTC_WRAPPER= CARGO_PROFILE_RELEASE_DEBUG=1 cargo build -j 16 \
  --config /tmp/local-patch.toml --release --no-default-features \
  --features system-openblas --bin tenferro-einsum-benchmark

Preserve each binary before rebuilding. The build container used CARGO_HOME=/tmp/bench-cargo (mounted host Cargo cache), RUSTUP_HOME=/home/vscode/.rustup, and HOME=/tmp/bench-home. The archived patch is mounted as /tmp/local-patch.toml.

Run reproduce.sh in the benchmark worktree inside the image, supplying the two binaries and output directory. Baseline then candidate, never concurrent. It uses configure_cpu_thread_env 1, explicit eager/BLAS, CPU16, one fixed warmup, and N1/N3. The whole-process difference cancels fixed preparation; small per-repeat harness/statistics overhead remains, so these are warmed eager operation counts, not kernel-only windows. Identical binary paths share the harness's strategy cache: divide by 2. LM has two distinct paths: divide by 4.

python3 result/amd-cpu/blas-full-overwrite/summarize.py
# To inspect a compressed raw profile:
gzip -dc raw/final/PROFILE.callgrind.gz > /tmp/profile.callgrind
callgrind_annotate --auto=no --inclusive=no --threshold=100 /tmp/profile.callgrind

Raw profiles, annotations, logs and the source patch are gzip-compressed without changing their bytes (including original tool-output whitespace). summary.json is generated from the raw profiles; the parser was checked against both uncompressed and compressed evidence with identical output. Raw logs include the initial candidate 133ca79 trial (not used for the final table) and a rejected missing-fixtures launch. The final table uses only raw/final/. Non-einsum JSON fixture warnings are loader skips, identical across variants. Auto source annotation produced a Valgrind/Perl warning; final annotations disable automatic source annotation and retain complete function self-cost tables.