harvard-acc / gem5-aladdin

End-to-end SoC simulation: integrating the gem5 system simulator with the Aladdin accelerator simulator.
BSD 3-Clause "New" or "Revised" License
221 stars 59 forks source link

GEMM in Systolic Array #46

Closed mateo-vm closed 2 years ago

mateo-vm commented 2 years ago

Is there currently a way to compute matrix-matrix multiplications with the systolic array or is it limited to convolutional tensors?

yaoyuannnn commented 2 years ago

You can run GEMMs on the systolic array as special convolutions. For example, an FC of (M, K) * (K, N) can be viewed as a 1x1 convolution of (1, M, 1, K) and (N, 1, 1, K), which produces a (1, M, 1, N) tensor.

mateo-vm commented 2 years ago

Thank you for the reply. There were some errors (in line with #43), but in general it worked.

In case someone else want to test this too, just note that it is needed to set up the stride and the padding accordingly.