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

Add PyTorch 2.5.1 to CI #1069

Merged
merged 10 commits into from
Nov 5, 2024
Merged

Add PyTorch 2.5.1 to CI #1069

merged 10 commits into from
Nov 5, 2024

Conversation

BenjaminBossan
Copy link
Collaborator

@BenjaminBossan BenjaminBossan commented Oct 18, 2024

  • Drop 2.1.2, update 2.4.0 to 2.4.1
  • Drop Python 3.8, add Python 3.12
  • Filter new torch warning about weights_only as that trips up some warning tests
  • Unpin protobuf from dev requirements
  • Filter warnings caused by usage of utcnow by protobuf
  • Skip torch.compile tests when torch < 2.4 and Python 3.12 are used, as this is not supported by torch

Note that I had to upgrade torch and Python at the same time because torch 2.5 requires Python > 3.8 and because Python 3.12 requires torch > 2.1 (which is dropped in favor of 2.5).

Drop 2.1.2, update 2.4.0 to 2.4.1
@BenjaminBossan
Copy link
Collaborator Author

BenjaminBossan commented Oct 18, 2024

CI needs #1070 first, as torch 2.5 is not available for Python 3.8.

Comment on lines 139 to 144
w_list = [
warning for warning in recwarn.list
if "protobuf" not in warning.message.args[0]
and "utcnow" not in warning.message.args[0]
]
w0, w1 = w_list # one warning for train, one for valid
Copy link
Member

Choose a reason for hiding this comment

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

Assuming two warnings by coming out of this filter can be a bit flaky. Can we directly pull out the warnings from training and validation warnings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I thought so too. Do you have an elegant solution for that? I was wondering if there was an API for setting filters to recwarn but I didn't see anything.

At least, with this implementation, we catch unexpected warnings ;-)

Copy link
Member

Choose a reason for hiding this comment

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

For this specific test, can we filter for the warning we want to check for and make sure there are two of them:

        w_list = [
            warning for warning in recwarn.list
            if msg_substr in str(warning.message)
        ]
        assert len(w_list) == 2

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After spending too much time fiddling with pytest.mark.filterwarnings without success, I rewrote the filters in a similar way as you suggested to make them more robust.

@BenjaminBossan BenjaminBossan changed the title Add PyTorch 2.5.0 to CI Add PyTorch 2.5.1 to CI Oct 30, 2024
@BenjaminBossan BenjaminBossan merged commit ad0259b into master Nov 5, 2024
16 checks passed
@BenjaminBossan BenjaminBossan deleted the pytorch-2.5.0 branch November 5, 2024 16:17
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

Successfully merging this pull request may close these issues.

2 participants