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

why GPU memory cost of Mamba2 Block > full self-attention block? And how to reduce this memory cost when training? #495

Open
thucz opened this issue Jul 26, 2024 · 1 comment

Comments

@thucz
Copy link

thucz commented Jul 26, 2024

I found Mamba2 is much faster than full self-attention block. But I met a memory problem.

I used 12 layers of Mamba2 in the vision task. d_model=128, d_state=16, head_dim = 32, expand = 2.

I found the inner dimension of the middle layer is > d_model while the inner_dim in my self-attention block is equal to d_model.

image

How to reduce the inner dimension to have a similar or smaller memory cost than full self-attention?

@ScottHoang
Copy link

Have you tried reducing the expansion_ratio?

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