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

install_diffusers issue with stable_diffusion_xl #2522

Open
JasonMts opened this issue Oct 21, 2024 · 0 comments
Open

install_diffusers issue with stable_diffusion_xl #2522

JasonMts opened this issue Oct 21, 2024 · 0 comments

Comments

@JasonMts
Copy link
Contributor

The call to install_diffusers() in benchmark/torchbenchmark/canary_models/stable_diffusion_xl/install.py at main · pytorch/benchmark should be made before error checking for the token, similarly to how it's done for other models such as stable_diffusion_unet and stable_diffusion_text_encoder. If not, then when it warns about the token and exits, it has not installed diffusers yet.

The following is an example of the error when we try to run the model after installation and the token is not set.

$ python3 run.py stable_diffusion_xl -t eval
Warning: The model stable_diffusion_xl cannot be found at core set.
Traceback (most recent call last):
  File "/home/user/benchmark/run.py", line 599, in <module>
    main()  # pragma: no cover
  File "/home/user/benchmark/run.py", line 511, in main
    model_flops = get_model_flops(config) if "model_flops" in metrics_needed else None
  File "/home/user/benchmark/torchbenchmark/util/experiment/metrics.py", line 129, in get_model_flops
    model = load_model(eager_model_config)
  File "/home/user/benchmark/torchbenchmark/util/experiment/instantiator.py", line 90, in load_model
    Model = load_canary_model_by_name(config.name)
  File "/home/user/benchmark/torchbenchmark/__init__.py", line 686, in load_canary_model_by_name
    module = importlib.import_module(f".canary_models.{model}", package=__name__)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/user/benchmark/torchbenchmark/canary_models/stable_diffusion_xl/__init__.py", line 11, in <module>
    from diffusers import DiffusionPipeline
ModuleNotFoundError: No module named 'diffusers'

Note that this is a low priority issue and a bit of an edge case as it doesn’t affect performance if the token is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant