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

Switch to using total VRAM instead of free VRAM to estimate tile size #2929

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ def estimate():
if options.use_fp16:
model_bytes = model_bytes // 2
mem_info: tuple[int, int] = torch.cuda.mem_get_info(device) # type: ignore
free, _total = mem_info
_free, total = mem_info
# only use 75% of the total memory
total = int(total * 0.75)
RunDevelopment marked this conversation as resolved.
Show resolved Hide resolved
if options.budget_limit > 0:
free = min(options.budget_limit * 1024**3, free)
budget = int(free * 0.8)
total = min(options.budget_limit * 1024**3, total)
# Estimate using 80% of the value to be more conservative
budget = int(total * 0.8)

return MaxTileSize(
estimate_tile_size(
Expand Down
Loading