Skip to content

perf(gemm): native float32 GEMM on loong64 - #81

Draft
tannevaled wants to merge 1 commit into
mainfrom
perf/gemm32-loong64
Draft

tannevaled wants to merge 1 commit into
mainfrom
perf/gemm32-loong64

Conversation

@tannevaled

@tannevaled tannevaled commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Native float32 GEMM on loong64: gemmMicro8x16LASX (LASX 8×16), using go-asmgen v0.23.0's new XVFMADDF encoder (go-asmgen/asmgen#37). It is gated on useLASX.

  • Correctness: CI is green, including the qemu loong64 lane (la464, NDARRAY_REQUIRE_LASX).
  • Sabotage check: shifting the A rows made only the loong64 lane fail, and the sabotage commit has been removed.

Still a draft: not measured on hardware. The Loongson host (cfarm401) refuses our key, and qemu timings mean nothing. On a 3C5000L an earlier LASX kernel (blocks8) was 26–47% slower than scalar code, so this one merges only after a hardware A/B shows the gain.

🤖 Generated with Claude Code

gemmMicro8x16LASX is the float64 8x8 LASX kernel at twice the lanes:
16 eight-lane accumulators, the B row in two registers, each A value
broadcast with xvldrepl.w (XVMOVQ .W8), and xvfmadd.s through go-asmgen
v0.23.0's new XVFMADDF encoder. Gated on useLASX; without it, float32
products widen to the float64 GEMM.

Validated under qemu la464 in CI (NDARRAY_REQUIRE_LASX): the Loongson
host, cfarm401, refuses our key, so it is not measured on hardware yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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