Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compile matrix multiplication #7

Open
spacemaninhust opened this issue Mar 23, 2024 · 4 comments
Open

How to compile matrix multiplication #7

spacemaninhust opened this issue Mar 23, 2024 · 4 comments

Comments

@spacemaninhust
Copy link

I want to try to compile the simplest matrix multiplication, but it seems that the compiler does not support matrix multiplication, does anyone know how to write a test file, thank you very much!

@ielhajj
Copy link
Member

ielhajj commented Mar 23, 2024

A matrix multiplication is equivalent to a fully-connected layer. Try checking the code for that file to see how to do a matrix multiplication: https://github.com/illinois-impact/puma-compiler/blob/master/test/fully-connected-layer.cpp. You can also check the MLP code which cascades multiple matrix multiplications.

@spacemaninhust
Copy link
Author

Thanks to @ielhajj , but I noticed that they are all matrix multiplication vectors, and there are no matrix multiplication. Do you know how to do that?

@ielhajj
Copy link
Member

ielhajj commented Mar 24, 2024

Ah, yes. the hardware only supports matrix-vector multiplication. If you want to do matrix-matrix multiplication, you need to break it down into multiple matrix-vector multiplications (i.e., declare an array of input vectors, one per column, and multiply by each of the vectors).

@spacemaninhust
Copy link
Author

Thanks, I will try it.

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

No branches or pull requests

2 participants