Skip to content

BLIS on RISC-V: RVV build + DGEMM performance A/B vs OpenBLAS#19

Merged
hugomeiland merged 1 commit into
opensolvers:mainfrom
hmeiland:blis-bench
Jul 19, 2026
Merged

BLIS on RISC-V: RVV build + DGEMM performance A/B vs OpenBLAS#19
hugomeiland merged 1 commit into
opensolvers:mainfrom
hmeiland:blis-bench

Conversation

@hmeiland

Copy link
Copy Markdown
Contributor

Adds a BLIS/ benchmark package: builds BLIS (flame/blis, rv64iv target — RVV 1.0 with the hand-written RVV assembly gemm microkernels in kernels/rviv/3/) under the EESSI GCC 14.3.0 toolchain with OpenMP threading, verifies numerical correctness, and A/Bs its DGEMM throughput against the patched RVV OpenBLAS on the SpaceMiT X60 (Orange Pi RV2, VLEN=256).

Why link, not FlexiBLAS

FlexiBLAS is not installed on the RV2, so the A/B links the same backend-agnostic bench_dgemm.c against each library in turn — one variable changed (the BLAS impl), source and flags held constant.

Results (Orange Pi RV2 / X60, -O3 -march=rv64imafdcv_zvl256b, EESSI GCC 14.3.0)

DGEMM GFLOP/s:

threads N BLIS OpenBLAS BLIS/OpenBLAS
1 1024 1.99 2.13 0.93x
1 2048 2.73 2.25 1.21x
1 4096 2.95 2.28 1.29x
8 1024 8.93 10.13 0.88x
8 2048 9.60 10.83 0.89x
8 4096 9.55 11.94 0.80x
  • Single thread, large N: BLIS's RVV asm microkernel beats OpenBLAS by ~20-30% (N>=2048).
  • 8 threads: OpenBLAS scales slightly better (BLIS 0.80-0.89x).
  • C[0]=245.24 identical for both backends at every size — no NaN.

Correctness (verify_ctrsm, BLIS rv64iv): 2400 cases, 0 fails, worst_resid=2.55e-07.

Contents

  • build-blis.sh — clone + configure (rv64iv --enable-cblas --enable-blas --enable-threading=openmp) + build under EESSI GCC 14.3.0.
  • run-ab.sh — link bench_dgemm.c against BLIS and OpenBLAS, sweep sizes × threads, print GFLOP/s + ratio.
  • bench_dgemm.c / difftest.c / verify_ctrsm.c — backend-agnostic perf + correctness harnesses (shared with OpenBLAS/).
  • README.md — build/run/A-B methodology, results, and the two EESSI GCC14 link gotchas (-L/-B $GCC14/lib for libgcc_s/libatomic/libgomp.spec; the module load PATH trap).

Branched off the same clean base as #18 (no unrelated gromacs history).

Build BLIS (flame/blis rv64iv, RVV 1.0 hand-written asm gemm kernels) under
EESSI GCC 14.3.0 with OpenMP threading, validate correctness, and A/B its
DGEMM throughput against the patched RVV OpenBLAS on the SpaceMiT X60.

Measured (Orange Pi RV2, VLEN=256, -O3 -march=rv64imafdcv_zvl256b):
- 1 thread: BLIS beats OpenBLAS 1.21-1.29x at N>=2048 (RVV asm microkernel)
- 8 threads: OpenBLAS scales better, BLIS 0.80-0.89x
- CTRSM correctness: 2400 cases, 0 fails, worst_resid 2.55e-07

No FlexiBLAS on the board, so the A/B links the same backend-agnostic
bench_dgemm.c against each library in turn (one variable = the BLAS impl).
Documents the two EESSI GCC14 link gotchas (-L/-B $GCC14/lib for
libgcc_s/libatomic/libgomp.spec) and the module-load PATH trap.
@hugomeiland
hugomeiland merged commit 00f6cc6 into opensolvers:main Jul 19, 2026
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.

2 participants