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

2d.py with SDXL #4

Open
ThibaultGROUEIX opened this issue Apr 10, 2024 · 2 comments
Open

2d.py with SDXL #4

ThibaultGROUEIX opened this issue Apr 10, 2024 · 2 comments

Comments

@ThibaultGROUEIX
Copy link

Hi !

I am interested in your implementation of SDS with SDXL, and i would like to see the results on pixel optimization.
I was trying to run 2d.py but I ran into this error :

   scaler.scale(loss).backward()
  File "xxx/lib/python3.8/site-packages/torch/_tensor.py", line 522, in backward
    torch.autograd.backward(
  File xxx/lib/python3.8/site-packages/torch/autograd/__init__.py", line 266, in backward
    Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
RuntimeError: Trying to create tensor with negative dimension -17146298352: [-17146298352]

Does this experiment run on your side with SDXL or SDXL-turbo?
Thank you very much,
Thibault

@mdarhdarz
Copy link
Collaborator

Thank you for your attention.
Yes, 'assets/pgc.png' and 'assets/nopgc.png' are obtained through running 2d.py with SDXL-0.9. In this released version, some new arguments should be added to 'opt' in 2d.py but it seems you have fixed this.
For the negative dimension error, I have not met this. Could you provide more information for reproducing this error?
Here is my environment:
One 48G NVIDIA RTX A6000, 32G used to run 2d.py
Ubuntu 20, CUDA 11.7

@ivanpuhachov
Copy link

ivanpuhachov commented Nov 13, 2024

Hi, I can confirm that this issue is version related.
2d.py with SDXL raises RuntimeError: Trying to create tensor with negative dimension -17146298352: [-17146298352] with CUDA 12.2 and PyTorch 2.1
Runs OK if I use CUDA 11.7 and PyTorch 1.13 as recommended. I also fixed some arguments-related errors, can do a pull request.

256x256 image optimizations take 24GB of gpu memory (fits into 3090).

@mdarhdarz could you share arguments for 2d.py to reproduce assets/pgc.py?
upd: 1000 iterations with SDXL takes approx 15 minutes, is it expected?

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

3 participants