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

About GPU usage during inference #21

Open
yangzijia opened this issue Jun 19, 2024 · 1 comment
Open

About GPU usage during inference #21

yangzijia opened this issue Jun 19, 2024 · 1 comment

Comments

@yangzijia
Copy link

Hi, thank you for sharing. I found that after pruning, the model size of slimsam-77 is only 38M, which is the same as the model size of edgesam, but the GPU usage of slimsam is still very high, 3071MiB, while that of edgesam is only 433MiB. Why does this happen? I don't quite understand the technical principle.

@yangzijia yangzijia changed the title GPU utilization About GPU usage during inference Jun 19, 2024
@czg1225
Copy link
Owner

czg1225 commented Jun 19, 2024

Hi @yangzijia ,
SAM's main memory requirements come from the global attention block of its image encoder. After pruning, SlimSAM greatly reduces the number of parameters through channel pruning, but the number of image tokens remains unchanged. If you want to solve this problem, you can try to further apply token merging or token pruning techniques.

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