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

autodiff_composition: Allow using torch 1.11 with python3.10 and Windows #2667

Merged
merged 4 commits into from
May 12, 2023

Conversation

jvesely
Copy link
Collaborator

@jvesely jvesely commented May 9, 2023

Block all torch wheels on windws+python3.10.
Add compatibility code path for torch <1.12.0.
Check for the availability of torch numpy bindings instead of the Python/OS version.

@jvesely jvesely added bug Should work but doesn't regression Used to work but now it doesn't deps Dependency update labels May 9, 2023
@jvesely jvesely requested review from davidt0x, jdcpni and SamKG May 9, 2023 03:07
@jvesely
Copy link
Collaborator Author

jvesely commented May 9, 2023

I'm not 100% sure about the extra dimension in the <1.12.0 path, but it's enough to make the tests pass

@jvesely jvesely linked an issue May 9, 2023 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented May 9, 2023

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

No differences!

...

See CI logs for the full diff.

@@ -4,3 +4,17 @@
__all__ = list(regressioncfa.__all__)
__all__.extend(compositionrunner.__all__)
__all__.extend(autodiffcomposition.__all__)

try:
import torch

Check notice

Code scanning / CodeQL

Module is imported with 'import' and 'import from'

Module 'torch' is imported with both 'import' and 'import from'.
tests/composition/test_autodiffcomposition.py Fixed Show fixed Hide fixed
conftest.py Fixed Show fixed Hide fixed
@jvesely jvesely force-pushed the torch branch 2 times, most recently from b723a4d to aff25fa Compare May 9, 2023 04:20
@github-actions
Copy link

github-actions bot commented May 9, 2023

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

No differences!

...

See CI logs for the full diff.

Copy link
Collaborator

@davidt0x davidt0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

No differences!

...

See CI logs for the full diff.

jvesely added 3 commits May 12, 2023 12:07
…torch<=1.11.x

d6d95f3 ("Nback (PrincetonUniversity#2617)") changed the
format of cross entropy target that requires torch >=1.12
1.12.0+ includes input handling path to consider inputs without batch
dimension and can be used directly. [0,1,2]

Fixes: d6d95f3 ("Nback (PrincetonUniversity#2617)")
Closes: PrincetonUniversity#2665

[0] https://github.com/pytorch/pytorch/releases/tag/v1.12.0
[1] pytorch/pytorch#77653
[2] pytorch/pytorch@8881d7a

Signed-off-by: Jan Vesely <[email protected]>
pytorch/pytorch#100690
1.11.0 also has this problem, but it was built using numpy 1.22
which is supported in PNL.

Signed-off-by: Jan Vesely <[email protected]>
Assert that torch is usable if installed during testing.

Signed-off-by: Jan Vesely <[email protected]>
@github-actions
Copy link

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

No differences!

...

See CI logs for the full diff.

@jvesely jvesely merged commit 878b32e into PrincetonUniversity:devel May 12, 2023
@jvesely jvesely deleted the torch branch May 12, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Should work but doesn't deps Dependency update regression Used to work but now it doesn't
Projects
None yet
Development

Successfully merging this pull request may close these issues.

using torch<1.12.0 fails cross_entropy tests
2 participants