You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Version 0.35.0 AutoencoderKL failed with PyTorch 2.3.1: AutoAttributeError: module 'torch.library' has no attribute 'custom_op' #12195
This should be an old issue, but it appears again in version 0.35.0, maybe also in 0.35.1.
Maybe need to protect the import again if PyTorch 2.3.1 is still in the supporting list?
Reproduction
from diffusers import AutoencoderKL
import AutoencoderKL will lead to : AutoAttributeError: module 'torch.library' has no attribute 'custom_op'
Hi! I'd like to work on this issue. I can reproduce the problem with PyTorch 2.3.1 and will investigate the import protection needed for backward compatibility.
i submitted the PR if have time kindly review it it will be helpful contribution:
Added hasattr() checks before using these torch.library functions
Functions are only registered when available in the PyTorch version
Maintains backward compatibility with PyTorch 2.3.1 without breaking newer versions
Activity
Aishwarya0811 commentedon Aug 21, 2025
Hi! I'd like to work on this issue. I can reproduce the problem with PyTorch 2.3.1 and will investigate the import protection needed for backward compatibility.
Harperrrr111 commentedon Aug 21, 2025
same problem
Fix PyTorch 2.3.1 compatibility: add version guard for torch.library.…
Aishwarya0811 commentedon Aug 21, 2025
i submitted the PR if have time kindly review it it will be helpful contribution:
Added
hasattr()checks before using these torch.library functionsFunctions are only registered when available in the PyTorch version
Maintains backward compatibility with PyTorch 2.3.1 without breaking newer versions
a-r-r-o-w commentedon Aug 23, 2025
@skedin I've merged @Aishwarya0811's fix for pytorch<2.4 compatibility just now. Let me know if you run into any other errors :)
guyuezuntinggithub commentedon Sep 4, 2025
I have same question with pytorch 2.3.0 and diffuser 0.35.1
Fix PyTorch 2.3.1 compatibility: add version guard for torch.library.… (