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

[enhancement] Print status message at startup when xformers is available #2461

Merged
merged 2 commits into from
Feb 1, 2023
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
9 changes: 9 additions & 0 deletions ldm/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import transformers
from PIL import Image, ImageOps
from diffusers.pipeline_utils import DiffusionPipeline
from diffusers.utils.import_utils import is_xformers_available
from omegaconf import OmegaConf
from pytorch_lightning import seed_everything, logging

Expand Down Expand Up @@ -203,6 +204,14 @@ def __init__(
self.precision = choose_precision(self.device)
Globals.full_precision = self.precision=='float32'

if is_xformers_available():
if not Globals.disable_xformers:
print('>> xformers memory-efficient attention is available and enabled')
else:
print('>> xformers memory-efficient attention is available but disabled')
else:
print('>> xformers not installed')

# model caching system for fast switching
self.model_manager = ModelManager(mconfig,self.device,self.precision,max_loaded_models=max_loaded_models)
# don't accept invalid models
Expand Down