-
Notifications
You must be signed in to change notification settings - Fork 350
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
❓ [Question] How do you save a unet model compiled Torch-TensorRT (Stable Diffusion XL) #3018
Labels
question
Further information is requested
Comments
For reference, this is the modification I did inside
And this is the traceback
|
I have the same question. have you solved the problem? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
❓ Question
How do you save a unet model compiled Torch-TensorRT from Stable Diffusion XL?
What you have already tried
I've tried following the compilation instructions from the tutorial (link). It wasn't very useful for my use case because I would like to save the compilation on disk and load it down the line when inference is needed.
So I've tried following the instructions which let you save your compilation using the dynamo backend (link). This script represents a summary of what I'm doing:
But this yields the following error:
TypeError: UNet2DConditionModel.forward() missing 2 required positional arguments: 'timestep' and 'encoder_hidden_states'
So, I've tried to provide these arguments as well, found after some playing around with the code from diffusers:
And I get the same error. Probably, the kwargs don't get passed down into the calling functions. After altering the code from torch export (which probably wasn't necessary), I got an error of the type:
torch._dynamo.exc.InternalTorchDynamoError: argument of type 'NoneType' is not iterable
Any ideas how to properly compile a unet model from stable diffusion XL? Many thanks in advance.
Environment
conda
,pip
,libtorch
, source):pip install torch --index-url https://download.pytorch.org/whl/cu121
Additional context
The text was updated successfully, but these errors were encountered: