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

No reduction in graphics memory #23

Open
chenmeng666chen opened this issue Apr 24, 2023 · 1 comment
Open

No reduction in graphics memory #23

chenmeng666chen opened this issue Apr 24, 2023 · 1 comment

Comments

@chenmeng666chen
Copy link

chenmeng666chen commented Apr 24, 2023

1、GPU:A100-80G,
test-code:
test_code

2、result
test-result

3、conclusion and problem
(1)tomesd:token_ merge_ The higher the ratio, the faster the inference speed, 8.71s ->5.92s (ratio: 0->ratio: 0.5),however,there has been no significant change in the graphics memory, which is not consistent with the paper. I would like to understand the possible reasons???
(2)The inference speed of xforms+tomesd [token merge ratio>0.3] is better than using xforms alone。

@dbolya
Copy link
Owner

dbolya commented Apr 24, 2023

All the benchmarks in the paper were done using the original stable diffusion repo, not diffusers (and diffusers may give different results). Also, it's hard to get an accurate memory usage reading with pytorch. The way I estimated it in the paper using the stable diffusion repo was I used 512x512 images and then increased the batch size until I ran out of memory. Then the memory per image was the total memory allocated divided by the maximum batch size before running out of memory.

If you don't do it like that, the problem is that pytorch will very often allocate more memory than it needs, and it's hard to find out how much memory the network is actually using.

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