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

Cannot run sdxl sample code with deepcache, PyTorch should be >= 1.12 #977

Open
XuekuanWang opened this issue Jun 25, 2024 · 2 comments
Open
Assignees

Comments

@XuekuanWang
Copy link

Describe the bug

A clear and concise description of what the bug is.

I cannot run example code of SDXL with deepcache.
The error report is "
obj_entity = self._get_module(name)
File "/mnt/wangxuekuan/onediff/src/onediff/infer_compiler/backends/oneflow/import_tools/dyn_mock_mod.py", line 167, in _get_module
raise RuntimeError(
RuntimeError: Failed to import onediffx.deep_cache because of the following error (look up to see its traceback):
PyTorch should be >= 1.12"

However, my pytorch is 2.3.0. And I try to print the version of Pytorch, and get log
"You are using torch==0.9.1.dev20240624+cu122, but torch>=1.10.0 is required to use BridgeTowerModel. Please upgrade torch."

I find the version of 0.9.1.dev20240624+cu122 is oneflow not torch.

Your environment

A100, ubuntu 20.04

OneDiff git commit id

master branch code
onediff 1.2.0.dev1
onediffx 1.2.0.dev1
oneflow 0.9.1.dev20240624+cu122

OneFlow version info

Run python -m oneflow --doctor and paste it here.

version: 0.9.1.dev20240624+cu122
git_commit: ec7b682
cmake_build_type: Release
rdma: True
mlir: True
enterprise: False

How To Reproduce

Steps to reproduce the behavior(code or script):

The complete error message

The sample code "
import torch

from onediffx import compile_pipe
from onediffx.deep_cache import StableDiffusionXLPipeline

pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True
)
pipe.to("cuda")

pipe = compile_pipe(pipe)

prompt = "A photo of a cat. Focus light and create sharp, defined edges."

Warmup

for i in range(1):
deepcache_output = pipe(
prompt,
cache_interval=3, cache_layer_id=0, cache_block_id=0,
output_type='pil'
).images[0]

deepcache_output = pipe(
prompt,
cache_interval=3, cache_layer_id=0, cache_block_id=0,
output_type='pil'
).images[0]
"

@strint
Copy link
Collaborator

strint commented Jun 25, 2024

"You are using torch==0.9.1.dev20240624+cu122, but torch>=1.10.0 is required to use BridgeTowerModel. Please upgrade torch."

I find the version of 0.9.1.dev20240624+cu122 is oneflow not torch.

@ccssu looks like a problem with mock

@ccssu
Copy link
Contributor

ccssu commented Jun 25, 2024

hello, Thank you for your feedback @XuekuanWang
Please let us know the diffusers version information, probably due to version compatibility issues.

The onediff nearest ci test script is pass, using the diffusers==0.19.3 , You can also try using it pip install diffusers==0.19.3
https://github.com/siliconflow/onediff/blob/main/onediff_diffusers_extensions/examples/text_to_image_deep_cache_sdxl.py

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

No branches or pull requests

3 participants