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

Expand the size of the matrix #1

Open
leankemski opened this issue Dec 11, 2018 · 4 comments
Open

Expand the size of the matrix #1

leankemski opened this issue Dec 11, 2018 · 4 comments

Comments

@leankemski
Copy link

leankemski commented Dec 11, 2018

Hi, I tried to change the dimensions for matrix A and B into 1000*1000, and I just changed the size of matrix in mmilt.hpp and sharedmem.py. It did not work, the result of the matrix was wrong. Here are the codes I changed, the board I used is PYNQ-Z1. Can you tell me what else should I change, thx.
in mmult.hpp
// Dimensions for A and B (which determine C)
#define A_ROWS 1000
#define A_COLS 1000
#define B_ROWS A_COLS
#define B_COLS 1000
in sharedmem.py
__MMULT_A_SHAPE = (1000, 1000)
__MMULT_BT_SHAPE = (1000, 1000)
__MMULT_C_SHAPE = (1000, 1000)
(https://user-images.githubusercontent.com/34908328/49782331-deaeaa80-fd50-11e8-8177-13a968a5ca57.png)

I also want to know if i change the type to float would the ip work correctly?

@drichmond
Copy link
Owner

drichmond commented Dec 12, 2018 via email

@leankemski
Copy link
Author

Did you re-compile the overlay?

On Dec 10, 2018, at 10:30 PM, leankemski @.**> wrote: I tried to change the dimensions for matrix A and B into 10001000, and I just changed the size of matrix in mmilt.hpp and sharedmem.py. It did not work, the result of the matrix was wrong. Here are the codes I changed, the board I used is PYNQ-Z1. Can you tell me what else should I change, thx. in mmult.hpp // Dimensions for A and B (which determine C) #define A_ROWS 1000 #define A_COLS 1000 #define B_ROWS A_COLS #define B_COLS 1000 in sharedmem.py __MMULT_A_SHAPE = (1000, 1000) __MMULT_BT_SHAPE = (1000, 1000) __MMULT_C_SHAPE = (1000, 1000) (https://user-images.githubusercontent.com/34908328/49782331-deaeaa80-fd50-11e8-8177-13a968a5ca57.png https://user-images.githubusercontent.com/34908328/49782331-deaeaa80-fd50-11e8-8177-13a968a5ca57.png) — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#1>, or mute the thread https://github.com/notifications/unsubscribe-auth/AGFUdF3j5mw7pdtileBH5F4PPL2HFd-Pks5u31EBgaJpZM4ZMwES.

Yes, I re-compiled the overlay according to the tutorial.

@drichmond
Copy link
Owner

drichmond commented Dec 13, 2018 via email

@leankemski
Copy link
Author

Increase the delay in sharedmem.py. I think your matrix is taking longer than 1 second to multiply

Thank you. I changed delay to 100, it worked for a 300 matrix. But for a matrix of 1000, it should be more longer. I think if I change the type into float, it will be much worse. Will the mmult perform better if I unroll the loop? There is no accerlerlated computation now.

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