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

Fast Feedforward is slower #1

Open
superFilicos opened this issue Dec 20, 2023 · 2 comments
Open

Fast Feedforward is slower #1

superFilicos opened this issue Dec 20, 2023 · 2 comments

Comments

@superFilicos
Copy link

Hi!
I'm also focusing on the project Fast feedforward, and when I use it in my model I found that it was much slower than Linear. I also use your code and get the same result.
image
So, did you encounter the same problem with me?

@issamemari
Copy link
Owner

issamemari commented Dec 20, 2023

Indeed I also get similar results. I noticed however that you can get a speedup in extreme cases. For example under the following configuration:

in_features = 2000
leaf_features = 5
out_features = 2000
depth = 4
batch_size = 500
max_iter = 1000

I get ~1.7x speedup:

FastFeedForward avg batch inference duration: 0.027593517475409817
Linear avg batch inference duration: 0.04902171762295078
Speedup: 1.7765664586487342
FastFeedForward avg batch inference duration: 0.027575688951612876
Linear avg batch inference duration: 0.04907984716129028
Speedup: 1.7798230625320297
FastFeedForward avg batch inference duration: 0.027542462952380928
Linear avg batch inference duration: 0.04911540638095234
Speedup: 1.7832612306992872

@superFilicos
Copy link
Author

Hi!
Yes, but you need to set the hidden_size to more than 2000... I wish maybe someday I can have such powerful gpus...

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