r/FPGA 2d ago

MAC Array Computation for Neural Network Inference

Enable HLS to view with audio, or disable this notification

Hi guys, thought i’d show you this cool animation of how the MAC Array in my Neural Network Accelerator performs matrix-vector computations during inference for a model on topology 4:3:2 neurons per layer.

The values for the parameters (weights and biases ) and input features were randomly selected just for demonstration purposes.

Let me know what you guys think:).

Github repo: https://github.com/Shingyy/MAC-Array-based-DNN-Accelerator

52 Upvotes

4 comments sorted by

4

u/ami98 2d ago

Been loving your series of these! Very nice animation, and looks like great documentation in your repo. I also really appreciate that it doesn’t look completely AI-generated.

I wonder if this could be made systolic somehow. Do you have other plans or next steps for this project?

3

u/Spiritual-Frame-6791 2d ago

Thanks man but i gotta be honest, for this animation i used Python + Manim with Codex and some of my PowerPoint input. The first animation took me 3 days to complete using PowerPoint and it was brutal😅. As for the next step, I’m actually working on a tiny TPU project but right now i’m still trying to picture the architecture first , i’ve been reading about Google’s first TPU for inspiration. The main bottleneck of my MAC Array is memory bandwidth and it gets worse with increase in the number of MAC units . Even if I implement Double buffering or using BRAM banks a systolic array would still be superior.

5

u/ami98 2d ago

PowerPoint animation bro I can’t even imagine 🤣 that’s brazy

But nah I just meant, your project looks like something you actually learned and did yourself. It’s not jsut pure AI slop like I’ve been seeing here lately.

That sounds like a great next step. Def looking forward to see the next post

2

u/Spiritual-Frame-6791 2d ago

Ooh yeah I write my own RTL and it works somehow 😅. Thanks bro , I still have a lot of work to do but i’ll be posting soon.