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

pytest doesn't run on python3.12 #7441

Closed
pbsds opened this issue Mar 22, 2024 · 13 comments · Fixed by #7455
Closed

pytest doesn't run on python3.12 #7441

pbsds opened this issue Mar 22, 2024 · 13 comments · Fixed by #7455
Labels
bug Something isn't working

Comments

@pbsds
Copy link

pbsds commented Mar 22, 2024

Describe the bug

https://peps.python.org/pep-0632/

Reproduction

./setup.py

Logs

No response

System Info

diffusers 0.27.1, python 3.12, nixos 23.11

Who can help?

@DN6 @sayakpaul @yiyixuxu

@pbsds pbsds added the bug Something isn't working label Mar 22, 2024
@sayakpaul
Copy link
Member

Does it build on any other distro? What's the error message?

@pbsds
Copy link
Author

pbsds commented Mar 23, 2024

Sorry, i was to quick to parse the error log and jumped to conclusion. It seems to happen while running pytest, not while installing the package, but the linked PEP is still relevant.

https://cache.nixos.org/log/8kgw3gqpd3r9d48gb1xibz592226xhys-python3.12-diffusers-0.27.1.drv

likely relevant bit:

  File "/build/source/tests/conftest.py", line 34, in pytest_addoption
    from diffusers.utils.testing_utils import pytest_addoption_shared
  File "/build/source/src/diffusers/utils/testing_utils.py", line 17, in <module>
    from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils'

@sayakpaul
Copy link
Member

Does it happen in Linux?

@pbsds
Copy link
Author

pbsds commented Mar 23, 2024

yes

@sayakpaul
Copy link
Member

How are you installing the package?

@pbsds pbsds changed the title Doesn't build on python3.12 pytest doesn't run on python3.12 Mar 23, 2024
@pbsds
Copy link
Author

pbsds commented Mar 23, 2024

We're packaging diffusers on linux/nixpkgs for python 3.12, which involves running the test suite to make sure it works correctly. Here is our build recipe but it is likely of low interest to you.

The reason it fails is due to the use of distutils, which is removed in python 3.12:
image

I updated the title, since most python 3.12 users should be able to fetch the prebuilt wheels from pypi and install it just fine.

I'm sorry for not being able to provide an simple debuggable reproduction for you, my FHS (non-nixos) machines are currently out of commission, and my docker setup is being grumpy.

@sayakpaul
Copy link
Member

Thanks for providing this information. I think this warrants a discussion with the broader Python community no? Probably better off in PyTest?

@pbsds
Copy link
Author

pbsds commented Mar 23, 2024

The fault is not with pytest as it does not feature a single import of distutils (checked pytest v7.4.3), it is triggered when running pytest on the diffusers codebase, e.g. pytest tests/. Is there someone else available on this project who might be better suited to look into this issue?

@sayakpaul
Copy link
Member

You are talking to one of the maintainers :-)

You mentioned:

The reason it fails is due to the use of distutils, which is removed in python 3.12

This tells me we need to handle the corresponding distutils import based on the Python version. I will look into it.

@sayakpaul
Copy link
Member

This thread is useful in this regard: https://stackoverflow.com/questions/69858963/how-can-one-fully-replace-distutils-which-is-deprecated-in-3-10.

@yiyixuxu we should try to replace distutils with other alternatives. Happy to look into it. But before that, wanted to know if you have any other thoughts.

@sayakpaul
Copy link
Member

@pbsds #7455 works for you?

@pbsds
Copy link
Author

pbsds commented Mar 24, 2024

It fixes the distutils issue!

But now the tests fail with "RuntimeError: Dynamo is not supported on Python 3.12+".

diffusers> ============================= test session starts ==============================
diffusers> platform linux -- Python 3.12.2, pytest-8.0.2, pluggy-1.4.0
diffusers> rootdir: /build/source
diffusers> plugins: timeout-2.3.1, xdist-3.5.0, requests-mock-1.11.0
diffusers> 12 workers [4763 items]  m
diffusers> sssssssssssss..sssssssssssssssssssssssssssss.ssss.ss.sssssssssssssssssss [  1%]
diffusers> ssssssssssssssssssss.ssssssssssssssssssss.s.ssss.sssssssssssssssssss..xx [  3%]
diffusers> sssss.....xxxx.xxxxsxsxs..xx.x..xsss.xsss..xxx.x...x.xx.xxx.xs.xsx.xs... [  4%]
diffusers> ss..ssssssssssssssssssssssssssssssssssssssssxsssss.ss.xssxx.x...sxs.xsxx [  6%]
diffusers> ss.sssssssssssssssx..xssx..xxs.xs.xssxxsx.x.xxsssss.x.xxx..xxssxssx..x.x [  7%]
diffusers> xssxsss.xs.xx..xsxxx.....xxsxx.xx..xx.xxxxxxFxF....xs.xx...x.x.ssxsxs.ss [  9%]
diffusers> .xxxx.xxx...xxx..xssxsxxs.......xx.xsxxx.xxxxsxssx..x..xs.xsssssxx.x.xxs [ 10%]
diffusers> x......xxxxxxx.xxxsxssxx.xFxx.x...xxx..xs...xxxxxxxxxxx..xxxxsxxsx....xs [ 12%]
diffusers> x...............s..x.....Fx....x.xxx...ssxxxx.xxss.xxxxxxsssx..xs...xxxx [ 13%]
diffusers> xxxxxsxsxxss..xxxxsxxsx.xxx.xsFxxxxxs.xxxxxxxx...x.xsx.x.xsxxxxsx..x.x.. [ 15%]
diffusers> ss.....x.x.xsxsxx.......x.....x....xs..x....xsx.xx.xs....x.xsx.xxx.xxssx [ 16%]
diffusers> xxxxs.xssxs.xsxxxxxssxxxxsxsxxxxssxxx.ss...ss.s.xss.xxxx.xssx.sxxsxxsssx [ 18%]
diffusers> ......x..x..sxxx.x.xxx...xxxsxxxxx.xsxxxxxxxxxsxs.x.xsx..xsxxsss.sxx..xs [ 19%]
diffusers> .xs....x...x.xxxssssxx.xxsxxxxxxxsxx..x.x.xxssxxsxxx.xsxxx..xxxssxxxsxxs [ 21%]
diffusers> .xss..xsxxx.x.xsxx...xx.xFxxsxxxsxxss.xsxx.x.xxsxxsxssxsxsxx.xssxx.xxxxs [ 22%]
diffusers> s.xss.xssxxs.xss.xxx..xxssssxx.x..ss..xFFx.xxxxx.xsxxsxxxxxsxxx..xssxxxx [ 24%]
diffusers> xsx.xx.xx.xxx.xs..s.xsxsxxsx.xxxxx.xssxss.x.xxsxss.xss.xsx.x.x.xxs.x...s [ 25%]
diffusers> s...xxxxx.x.xxssx.xsxsxsxs.x.xx..xxx....x.xss..x.x..xx.x...xsssssx.xsx.x [ 27%]
diffusers> sxsxsxxxx.sxxxssxssxxxss.xssx.xxF..x.x.xsx.....xs..xx.sssxx.s.xxsx.Fx.xs [ 28%]
diffusers> sxxs..xxs.xx...ss...ssxxx.sxs.....x..xsFxxx.ssx.sssxxs.xxx.xsx..sxxxxxs. [ 30%]
diffusers> x.xx...xs..x.s.x.s.x.xxxx..xssxssxxsssxxs..x.x.x.xx....xxxx..x.xx.xsx.x. [ 31%]
diffusers> .xxs...xsxx.xss.x.xsxsssx.xs..xx..xsxss.xsxsxs..s.sxxsx..xss.ssxxxsssxxx [ 33%]
diffusers> s.xxFxx.ssxxxxxx...xxsxsxxx.xxxsx.xxs.x...s..xxx..xx.sxx.xsssss...xsssss [ 34%]
diffusers> ssssssssssxssssssssssss..ss.xxx..xxsx..x.xxxxsxxxxs.xsx.xx..xs.xxs.ssx.s [ 36%]
diffusers> ssxxs..xxxxxx....xxx..sss.xxxs...xx..x.xsxxx.s.xxsx..sxxx.x.xxxs.xssssss [ 37%]
diffusers> ssssssss..sxx..x.xsxx.sxx..sx.xs.xxs.xxxxxxssx..xs...xxs.x..xxxxss.xxssx [ 39%]
diffusers> .x.xxs...xxsssssxss...........x...xx..x.xsx.sxx..xxxsxx.ssxx.ssxs.x.xs.s [ 40%]
diffusers> xxxFxsxsssssx.xxxx.xxxxF.x..xxxs...xxx..xsxx.x.sxxx..xs.ss.x.sssxs..xxxx [ 42%]
diffusers> xs.xs.xxsx..xxsxx.xxsxxxsssssssssx.xx..x.xxx....ss.xxxx.xs.sxsxxxs.xssss [ 43%]
diffusers> ssssssssssssssssssxsxx..xxx.xxx.x.x.ss.ssxxxsssss.xsx.xx.xx...xxx.x.sxxx [ 45%]
diffusers> xsxxsx.xxsxxxxsxsxxxsssssss.xxx.xxssxx.xxssx.xs.x.xxsxxxsxxxx.xs.xssssss [ 46%]
diffusers> ssssxxxx.xsxxxxxxx..x.xxsxxssxsx.xxsxxsxs.xxxs.xxx..xxss.xxs..xxxxssxssx [ 48%]
diffusers> xxxx.xxssssssxxxxxx.x.xxxsxsxxx.x.xxxxxxxsxxxxsxxxxxsxxx.xxssx.sxx.xs.x. [ 49%]
diffusers> xxxsssx.x.xsxsxs..ssx.xxxxxx.xxxxxssxxxx.xxsxs.xsxx..xxxsxxx..xxxxxsx.xx [ 51%]
diffusers> x.xxsssssssxxxs.xs.xx.xxxxx.xxsxx..xs.xsxxxxxxxsxx.xs.xssxssxsssssssssss [ 52%]
diffusers> sxsxx.sx.sssssssssss.xsssxsxxssssxsxxxsxssssssssssssssxx..x.x.xx.xsxxxxx [ 54%]
diffusers> ssxxxxx.xsssx.xs.s.xsxxxxxxxxsxsxs.xxxxxxsxsxxxxsssss..xxxxsxxsxx..xxssx [ 55%]
diffusers> .xxxxxx.xsxxxxxxxsxsxx.ssx.xxs..xx.ssx.....xxxxxx.xxxs.xxx.xsxxxxxsxxsx. [ 57%]
diffusers> xx.ss..xx.ss..xs.xx.xsxxxxsxxxxx...xsxxssxsxx.xsxxsxssssxxxsxxxsxxx.xxsx [ 58%]
diffusers> sxxxxsxxssx.xxxxsxx..xx...xxs.xx..xxxs.x.xx..xxxxxsxs.s.xxs.xxxxsxxs.xss [ 60%]
diffusers> sxxsssssxxxxxsx.xxxx...xsssxx.x.x.sx.sx.xxx.x.xx.xx...xxsxxxsxsx.s.s.sxx [ 61%]
diffusers> x..sxx.ss.xxsxsxxxxss.sxx.xx.xsssxsxx.xxx.xssssxxs..x.x..xxxxxx.x.xxssxx [ 63%]
diffusers> xxs.sss.sxssxsxsxs.xs..xxsssxx.xxxxxxssx....x..xx.xssssx.sxxxxx.x.sss.xx [ 65%]
diffusers> x.x.x.xxxx.x.xxxxsxxxsxxsxxsxxxxxssx.xxxxssssssssssxxxxxxxx.xxxxx.xxxx.. [ 66%]
diffusers> .xx.xxxx.....xs.xx.xsssxxs.xxxxxxssssxs.xxxsx.xsx.xsssssssxs.x.sxsxxssss [ 68%]
diffusers> xxxxx.sxxxsxx.....xxxsxsxxxxx.xsxsxx.xxxxsssx.sxxxsss..x.xxssssx..xsxxxF [ 69%]
diffusers> x.sxxxxxx.xxsxx.ssx.xxxsxxxxsx.xxx.xsxs.x.xsx.xx.xxxxx.xsxssxsxxxxxxsxss [ 71%]
diffusers> xxxxxxxx.xxxxx.xsxssssssssxx.xxxsxx.x.xx.xxx.xssxxss.xxssxxs.x.xx.xx.xs. [ 72%]
diffusers> xssssxx.x..xss.xxx.....................................x................ [ 74%]
diffusers> .....x.....xss..s.s.......x...xxs.............................xs........ [ 75%]
diffusers> .......xs....................xxxx..................xs...ssx.xs.......... [ 77%]
diffusers> ...........................................xs....................xs.s... [ 78%]
diffusers> ............................................x......sss.................. [ 80%]
diffusers> .........xss.................x.......................................... [ 81%]
diffusers> .....................xs....s............................................ [ 83%]
diffusers> ......s.........s.............sss.sssss.ssss.sss.sss.ssss.ssssss.ssssss. [ 84%]
diffusers> sssssss.sssss........................................................... [ 86%]
diffusers> ......................xs..........................x...x..x..x.x...xxsx.. [ 87%]
diffusers> .xs.x..xs...ssx...ss...xss....................ss........................ [ 89%]
diffusers> xs...x....x..x...............................x.......................... [ 90%]
diffusers> .....x..................xs.............................................. [ 92%]
diffusers> ..............x..........................................x.............. [ 93%]
diffusers> .............sx...........................x....x...........ss.x..xxxs... [ 95%]
diffusers> sssssssssssssssssssssssssssssxxsx..xxxxxxxxxxxx.sxxx..xxsxssssssssssssss [ 96%]
diffusers> sxssssssssssssssxxs...ss.ss.......x.x.ss..ss.xxxxx.xsxx.xxx.xsxxs.ss.xs. [ 98%]
diffusers> x.s.xss.....s.......s.F.s....s.ssssssssssxxxsssxx..x..s.s..ss...ss.sssss [ 99%]
diffusers> s..........                                                              [100%]
diffusers> =================================== FAILURES ===================================
diffusers> ______________ UNetLDMModelTests.test_from_save_pretrained_dynamo ______________
diffusers> [gw5] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.unets.test_models_unet_2d.UNetLDMModelTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ____________ PriorTransformerTests.test_from_save_pretrained_dynamo ____________
diffusers> [gw4] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.transformers.test_models_prior.PriorTransformerTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> _____________ AutoencoderKLTests.test_from_save_pretrained_dynamo ______________
diffusers> [gw0] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.autoencoders.test_models_vae.AutoencoderKLTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ________________ VQModelTests.test_from_save_pretrained_dynamo _________________
diffusers> [gw1] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.autoencoders.test_models_vq.VQModelTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ______________ UNet1DModelTests.test_from_save_pretrained_dynamo _______________
diffusers> [gw4] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.unets.test_models_unet_1d.UNet1DModelTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ______________ UNetRLModelTests.test_from_save_pretrained_dynamo _______________
diffusers> [gw4] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.unets.test_models_unet_1d.UNetRLModelTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ______________ NCSNppModelTests.test_from_save_pretrained_dynamo _______________
diffusers> [gw5] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.unets.test_models_unet_2d.NCSNppModelTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ________ AsymmetricAutoencoderKLTests.test_from_save_pretrained_dynamo _________
diffusers> [gw0] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.autoencoders.test_models_vae.AsymmetricAutoencoderKLTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> __________ UNet3DConditionModelTests.test_from_save_pretrained_dynamo __________
diffusers> [gw3] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.unets.test_models_unet_3d_condition.UNet3DConditionModelTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ____________ AutoencoderTinyTests.test_from_save_pretrained_dynamo _____________
diffusers> [gw0] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.autoencoders.test_models_vae.AutoencoderTinyTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ______________ Unet2DModelTests.test_from_save_pretrained_dynamo _______________
diffusers> [gw4] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.unets.test_models_unet_2d.Unet2DModelTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> _________ ConsistencyDecoderVAETests.test_from_save_pretrained_dynamo __________
diffusers> [gw0] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.autoencoders.test_models_vae.ConsistencyDecoderVAETests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> __________ UNet2DConditionModelTests.test_from_save_pretrained_dynamo __________
diffusers> [gw5] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.unets.test_models_unet_2d_condition.UNet2DConditionModelTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ____ AutoncoderKLTemporalDecoderFastTests.test_from_save_pretrained_dynamo _____
diffusers> [gw0] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.autoencoders.test_models_vae.AutoncoderKLTemporalDecoderFastTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ____________ UNetMotionModelTests.test_from_save_pretrained_dynamo _____________
diffusers> [gw3] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.unets.test_models_unet_motion.UNetMotionModelTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+
diffusers> ____ UNetSpatioTemporalConditionModelTests.test_from_save_pretrained_dynamo ____
diffusers> [gw3] linux -- Python 3.12.2 /nix/store/7yh2ax34jd7fgf17mjfd3c6niw1h2hsj-python3-3.12.2/bin/python3.12
diffusers> 
diffusers> self = <tests.models.unets.test_models_unet_spatiotemporal.UNetSpatioTemporalConditionModelTests testMethod=test_from_save_pretrained_dynamo>
diffusers> 
diffusers>     @require_python39_or_higher
diffusers>     @require_torch_2
diffusers>     def test_from_save_pretrained_dynamo(self):
diffusers>         init_dict, _ = self.prepare_init_args_and_inputs_for_common()
diffusers>         inputs = [init_dict, self.model_class]
diffusers> >       run_test_in_subprocess(test_case=self, target_func=_test_from_save_pretrained_dynamo, inputs=inputs)
diffusers> 
diffusers> tests/models/test_modeling_common.py:437: 
diffusers> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffusers> src/diffusers/utils/testing_utils.py:761: in run_test_in_subprocess
diffusers>     test_case.fail(f'{results["error"]}')
diffusers> E   AssertionError: Traceback (most recent call last):
diffusers> E     File "/build/source/tests/models/test_modeling_common.py", line 56, in _test_from_save_pretrained_dynamo
diffusers> E       model = torch.compile(model)
diffusers> E               ^^^^^^^^^^^^^^^^^^^^
diffusers> E     File "/nix/store/pq4gw9yz5aamzjk967hq17qq8l5g573x-python3.12-torch-2.2.1/lib/python3.12/site-packages/torch/__init__.py", line 1801, in compile
diffusers> E       raise RuntimeError("Dynamo is not supported on Python 3.12+")
diffusers> E   RuntimeError: Dynamo is not supported on Python 3.12+

But i assume that issue is upstream?

@sayakpaul
Copy link
Member

Yes, that is a PyTorch problem it seems and is better filed in the PyTorch repository. I will add a decorator to those tests to skip for Python 3.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants