The GPU memory usage during inference is increasing, the inference speed is getting slower and slower, the cuda usage is decreasing, and the memory is not released
Self Checks
- [x] This template is only for bug reports. For questions, please visit Discussions.
- [x] I have thoroughly reviewed the project documentation (installation, training, inference) but couldn't find information to solve my problem. English 中文 日本語 Portuguese (Brazil)
- [x] I have searched for existing issues, including closed ones. Search issues
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template and fill in all required fields.
Cloud or Self Hosted
Self Hosted (Source)
Environment Details
Steps to Reproduce
The GPU memory usage during inference is increasing, the inference speed is getting slower and slower, the cuda usage is decreasing, and the memory is not released
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
遇到同样的问题
同样的问题
同样的问题
1.5版本没这个问题,新版本才出现的
same problem. (Ubuntu)
Same.
Am going to attempt to clear the model after every 100 gens, wonder if that will help.
Not sure how an issue this fundamental can go un-responded to for this long.
Same.
The GPU memory leak issue is caused by the graph construction problem in torch.compile, where each input triggers a new compilation. This is unreasonable and leads to a sharp increase in memory usage with every call.
Here, 🤪I’ve provided a less elegant solution that resolves the memory issue. After testing 1,000 times, the memory remains stable. Additionally, the latency per call meets expectations, and there are no noticeable quality flaws in the audio output.
fix(inference): GPU memory leakage bug (#1040) #1073
@echonoshy worked like a charm! you nailed it ;)