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

Memory issue due to A and B matrix computation #25

Open
anupsingh15 opened this issue Mar 11, 2024 · 3 comments
Open

Memory issue due to A and B matrix computation #25

anupsingh15 opened this issue Mar 11, 2024 · 3 comments

Comments

@anupsingh15
Copy link

anupsingh15 commented Mar 11, 2024

Hi,
Thanks for providing the Mamba implementation. I would like to know if there is any workaround in the efficient computation of deltaA and deltaB_u that can avoid the GPU memory running out issue. The following are the parameters I used to create the Mamba instance:

d_model: 1024
n_layer: 4   
d_state: int = 1024
expand: int = 2

The other parameters are set to their default values.

It results in a model of ~60M parameters. However, I run out of memory (max GPU memory= 24 GB) when I train with a batch size of 256 or even as low as 64 and this probably happens due to large matrix computations for deltaA and deltaB_u.

@shim0114
Copy link

I also have this issue...!

@johnma2006
Copy link
Owner

This repo is mostly meant for educational purpose, and I would suggest using the official repo to do any training: https://github.com/state-spaces/mamba

@XZJIsme
Copy link

XZJIsme commented Mar 31, 2024

I also met this OOM problem lately, but not when using this repo's codes.
You may refer to this question on stackoverflow.

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

4 participants