Increase VAE decode memory estimates #7674
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR increases the working memory estimates for VAE decode operations. The previous values were set based on memory allocations and were pretty aggressive about trying to make full use of the available VRAM. The updated values were set based on experimentally-observed reserved memory (not just allocated) levels, and also aim to be conservative by including some buffer room.
This change is intended to address reports of slow VAE decoding.
The more conservative memory estimate values could cause more memory to be offloaded from the GPU during VAE decode. This in turn could result in slower model reloading on subsequent runs. The net impact of this change is expected to be positive, but there may be a noticeable regression for some users. We will want to keep a close eye on this when it is released in an RC.
Related Issues / Discussions
N/A
QA Instructions
I tested several common VAE decode scenarios with memory profiling enabled. Results:
Merge Plan
pytorch_cuda_alloc_conf
config to tune VRAM memory allocation #7673 first and change target branch tomain
Checklist
What's New
copy (if doing a release after this PR)