Skip to content

perf(gemm): native float32 GEMM on s390x - #79

Merged
tannevaled merged 2 commits into
mainfrom
perf/gemm32-s390x
Oct 31, 2026
Merged

tannevaled merged 2 commits into
mainfrom
perf/gemm32-s390x

Conversation

@tannevaled

@tannevaled tannevaled commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Native float32 GEMM on s390x: gemmMicro4x16VXE, the float64 4×8 kernel at twice the lanes. It replicates each A value with VLREPF and uses the z14 fused multiply-add VFMASB, which go-asmgen encodes. It is gated on useVXE; without that facility, float32 products widen to the float64 GEMM as before.

float32 MatMul, IBM Z (LinuxONE, VXE), abbench 8 rounds, 1 core 64² 256² 1024²
vs v0.28.0 (widened to the float64 GEMM) −58% −54% −50%

Sabotage check: shifting the A rows made only the qemu s390x lane fail, and the sabotage commit has been removed. On the real IBM Z the kernel suite (fence included, useVXE = true) and the root suite pass.

🤖 Generated with Claude Code

tannevaled and others added 2 commits October 27, 2026 21:32
gemmMicro4x16VXE is the float64 4x8 kernel at twice the lanes: sixteen
four-lane accumulators, the B row in one VLM, each A value replicated
with VLREPF, and VFMASB, which go-asmgen encodes because Go's assembler
has no short-format vector float op. It needs the vector-enhancements
facility 1, so it is gated on useVXE like the other float32 kernels.
Without it, float32 products still widen to the float64 GEMM.

IBM Z (LinuxONE, VXE), abbench 8 rounds, one core, against v0.28.0:
-58/-54/-50% at 64²/256²/1024².

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled marked this pull request as ready for review October 30, 2026 20:59
@tannevaled
tannevaled merged commit bf1795b into main Oct 31, 2026
12 checks passed
@tannevaled
tannevaled deleted the perf/gemm32-s390x branch October 31, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant