Skip to content

Commit

Permalink
VRAM: Fallback should move to CUDA
Browse files Browse the repository at this point in the history
Signed-off-by: bghira <[email protected]>
  • Loading branch information
bghira committed Jul 8, 2023
1 parent f115230 commit a3a8ba3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions discord_tron_client/classes/image_manipulation/diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ def get_pipe(
logging.error(
f"Could not enable sequential CPU offload on the model: {e}"
)
else:
logging.info(f'Moving pipe to CUDA early, because no offloading is being used.')
self.pipelines[model_id].to(self.device)
torch._dynamo.config.suppress_errors = True
torch._dynamo.config.log_level = logging.WARNING
self.pipelines[model_id].unet = torch.compile(self.pipelines[model_id].unet, mode="reduce-overhead", fullgraph=True)
Expand Down

0 comments on commit a3a8ba3

Please sign in to comment.