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

Inference time for Model in first step #654

Open
Dwivedi07 opened this issue Dec 24, 2024 · 0 comments
Open

Inference time for Model in first step #654

Dwivedi07 opened this issue Dec 24, 2024 · 0 comments

Comments

@Dwivedi07
Copy link

I am utilizing the mamba.py to create an end-to-end model with multiple Mamba blocks stacked. After training the model, when I am running the model in inference mode: It is a very larger inference time for the first time step(1 sec), and then from 2nd time step onwards it is taking time of order 0.002 sec. Hence, when compared with S4D model on the same task mamba model turns out to be slow.

What could I be doing wrong in my implementation?
I tracked down the time and found that for the first time step :
y = selective_state_update(ssm_state, x, dt, A, B, C, self.D, z=z, dt_bias=self.dt_proj.bias, dt_softplus=True)
this line takes the maximum time of computation.
Thanks

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

1 participant