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

torch compile issues #1122

Open
jdack41 opened this issue Feb 15, 2024 · 5 comments
Open

torch compile issues #1122

jdack41 opened this issue Feb 15, 2024 · 5 comments

Comments

@jdack41
Copy link

jdack41 commented Feb 15, 2024

#1024 (comment)

I have written about some errors with torch compile above, but there are currently two issues with the torch compile option:

  • When using einops version 0.6.1, an "unhashable type: non-singleton SymInt" error occurs during finetuning. This issue does not occur with version 0.7.0.
  • When saving a model using torch compile, a prefix '_orig_mod.' is added to the saved model, which breaks the structure if saved as is.

I have been able to reproduce these issues in my local environment, but could someone please verify the situation in another environment?

@feffy380
Copy link
Contributor

einops 0.6.1 requires you to manually register its operators as compilable, which sd-scripts fails to do.
einops 0.7 does this automatically.
https://github.com/arogozhnikov/einops/wiki/Using-torch.compile-with-einops

@jdack41
Copy link
Author

jdack41 commented Feb 23, 2024

einops 0.6.1 requires you to manually register its operators as compilable, which sd-scripts fails to do. einops 0.7 does this automatically. https://github.com/arogozhnikov/einops/wiki/Using-torch.compile-with-einops

Thank you for verification.
I understood why error occurred with 0.6.1.

@jdack41
Copy link
Author

jdack41 commented Feb 23, 2024

[2024-02-24 05:02:51,702] [33/29] torch._dynamo.variables.higher_order_ops: [ERROR] self mismatch for bound method

I’m also concerned about the continued occurrence of the above error while exec sdxl_train_network.py. Is this occurring in other environments?

@jdack41
Copy link
Author

jdack41 commented Feb 23, 2024

When saving a model using torch compile, a prefix '_orig_mod.' is added to the saved model, which breaks the structure if saved as is.

It should be noted that this is incompatible with other applications such as a1111 as it is, or it should be modified to remove orig_mod as explained above.

@kohya-ss
Copy link
Owner

I will update the version of einops in the next release.

kohya-ss added a commit that referenced this issue Feb 24, 2024
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