Switch to using total VRAM instead of free VRAM to estimate tile size #2929
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.
We recently switched to not clearing out the cuda cache after each upscale and rather at the end of the chain. This means that pytorch now keeps VRAM usage somewhat high. This is fine though, because this is actually PyTorch's intended behavior to improve performance. Even though it is capturing this VRAM and it looks like its in use, PyTorch is able to reuse that memory for allocating tensors. In fact users should not be using clear cache at all, apparently.
However, since it looks like this vram is in use and unable to be used, we need to switch to using total system VRAM for estimations rather than free VRAM, since otherwise we might be estimating incorrectly.
Since the total amount is likely have some usage already, i lowered the budget calculation a bit to compensate.