Engineering challenge
The central problem was to map dense matrix multiplication onto a processor whose useful performance depends on explicit data movement. A mathematically correct triple loop does not determine where its operands live, how they reach registers, or how much time packing and transfers consume. On a small embedded system, those decisions can dominate execution.
GEMM is relevant because convolution can be lowered to matrix multiplication, allowing one carefully engineered kernel to support many neural-network layers. The project focuses on classical dense multiplication and its implementation costs. Reducing the asymptotic exponent of matrix multiplication is a separate research question; the practical task here is to reuse operands efficiently within a constrained memory hierarchy.
This research was carried out in collaboration with Jie Lei, under the supervision of Enrique Quintana and Adrián Castelló, preserving the attribution of the original technical article. The related 2022 publication lists Cristian Ramírez, Adrián Castelló and Enrique S. Quintana-Ortí as its authors. Read the research paper.
Read the Technical Deep Dive for the mathematics, portable examples, DMA scheduling and Roofline derivations.
Hardware and execution target
GAP8 contains a Fabric Controller (FC), a separate eight-core compute cluster and a hardware convolution engine. These components share a 512 kB L2 memory. The FC has its own 16 kB L1 TCDM; the cluster has a distinct, banked 64 kB L1 TCDM. These capacities describe different memory domains: the cluster’s storage is not the FC’s private working budget. The processor also has instruction caches; its explicitly managed data memories should not be confused with conventional CPU data caches. These distinctions follow the GreenWaves Hardware Reference Manual, §§3.1–3.2.
The 2022 implementation and experiments target the FC, rather than an eight-core parallel GEMM. Moving work to the cluster requires a separate implementation and evaluation, even though the cores share architectural features. External RAM adds another boundary whose transfer and packing costs must be included in an end-to-end measurement. Paper, §§1 and 3.
From BLIS organization to a GAP8 kernel
The design draws on BLIS: partition the matrix product into reusable panels, separate packing from computation, and concentrate architecture-specific arithmetic in a micro-kernel. Packing changes physical layout so that the inner computation can consume contiguous groups of operands. This costs additional reads, writes and temporary storage, so it must be justified by reuse.
The relevant public implementation uses the name B3C2A0. Its organization packs B in external memory, keeps a C block in L2, copies a B micro-panel toward FC L1, and holds an A micro-tile in 32-bit registers with packed operands. The macro-kernel source makes those placements concrete. This is a BLIS-inspired adaptation; it is not a claim that an unchanged desktop BLIS kernel automatically suits GAP8.
This arrangement also exposes a tradeoff. Keeping A close to arithmetic reduces some input traffic, but repeatedly updating C through L2 can remain expensive. A register-efficient arithmetic kernel therefore does not by itself establish an efficient complete GEMM.
What the public source establishes
The qblis_gpduino README explicitly identifies the 2022 paper as its description and evaluation. That establishes a direct relationship. The inspected revision is 53f8bc6187470a435c501fbfb6ef58267c431b75; it is not presented as a bit-for-bit archive of the experimental build.
Source files contain 4×4, 4×8 and 4×12 micro-kernels, calls to gap8_dotp4, packing routines and explicit RAM copies. The checked-in Makefile selects mk_4x4, illustrating why available kernels and the active benchmark configuration must be distinguished.
A helper name does not prove one hardware instruction executed. The paper describes software simulation of vector dot products in its SDK, while the official SDK header contains target builtins and a scalar fallback. The exact compiler, target definitions and disassembly are needed to resolve a particular build.
Numerical semantics also require care: the repository’s signed-char configuration uses narrow stored results. It should not be advertised as a verified INT8-input, INT32-accumulator library. The educational article treats wider accumulation, overflow and explicit output conversion separately from this historical code.
Memory management and optimization boundaries
The inspected implementation packs and copies data before consuming it; its B-panel path passes through an L2 temporary before copying into FC TCDM. Those staging buffers contribute to capacity requirements and transfer cost. A reproducible port must reserve space for code, stack and runtime allocations as well as matrix panels. Allocation and transfer source.
Double buffering is a useful extension to study: separate current and next buffers can allow transfer and computation to overlap. It adds storage, synchronization and ownership constraints. Here it is an optimization proposal, not an established result of the 2022 implementation. The same distinction applies to multicore decomposition. The original paper identifies overlap and use of the cluster as future work.
Experimental evidence
The publication separates packing, copying, register traffic and arithmetic. For its reported M=1792, N=1536, K=1024 case with a 4×12 micro-kernel, it reports 159.13 seconds overall and labels throughput 33.8 MOPS, compared with 76.7 MOPS for the arithmetic-only component. These are published results, not measurements reproduced on this portfolio’s host. The printed 33.8 is consistent with dividing 2MNK/time by 2^20, rather than decimal 10^6; the original rate labels are preserved here. Integer throughput must not be relabeled FLOP/s. Paper, §4 and Table 1.
The engineering finding is the gap between the complete computation and the arithmetic-only component: data movement, particularly C traffic, must be addressed along with instruction throughput. The paper’s 4×16 estimate is an analytical prediction, so it is not included as a measured improvement. No new speedup, energy saving or performance-per-watt claim is added here.
A fresh evaluation should pin the source and SDK, record the FC clock and compiler flags, specify dimensions, layouts and numerical behavior, and validate outputs before timing. It should report warmup, repetitions, timer overhead and variability, and show both total time and a breakdown of packing, transfer and compute. A benchmark executable alone is not a reproducibility package.
Scope and related research
The project demonstrates how algorithm structure, operand placement and measurement boundaries interact. The accompanying article extends that reasoning through portable teaching examples and explicit analytical models. Those examples and proposed schedules are not presented as newly measured GAP8 kernels. GPU performance and the performance of other RISC-V processors require their own evidence.
- A BLIS-like matrix multiplication for machine learning in the RISC-V ISA-based GAP8 processor
- Parallel GEMM-based convolution for deep learning on multicore RISC-V processors
- Communication-Avoiding Fusion of GEMM-Based Convolutions for Deep Learning in the RISC-V GAP8 MCU
- Research poster (PDF)
- Public implementation