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

[BUG] GPU memory used is much more in v0.2.7 than v0.2.5 while quantizing models. #247

Open
GodHforever opened this issue Dec 18, 2024 · 2 comments

Comments

@GodHforever
Copy link

The model I used is llama3-8B.
The only difference in the quantisation process is the versions, 0.2.7 and 0.2.5.
My gpu memory size is 16g, and I found that version 0.2.7 had problems with the memory being full, but 0.2.5 was able to quantise without any problems.
Has anyone else had similar problems?

@GodHforever GodHforever changed the title GPU memory used is much more in v0.2.7 than v0.2.5 while quantizing models. [BUG] GPU memory used is much more in v0.2.7 than v0.2.5 while quantizing models. Dec 20, 2024
@GodHforever
Copy link
Author

After debugging with the new version code, I found that some memory was not released in module2inspect.
clear_memory() may be useful for this problem.
The code is awq/quantize/quantizer.py: _compute_best_scale

int_w_output = self._module_forward(x, module2inspect, kwargs)
clear_memory()

Using this API here, memory consumption is reduced by about half
Will any one fix this or I just submit a patch?

@wrsIt
Copy link

wrsIt commented Jan 8, 2025

Hello, I’ve encountered a similar issue. Could you please elaborate further on the solution? I wasn’t able to locate the code you mentioned.(T^T)

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