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

Update min PyTorch version to 1.9, resolve deprecation warnings #1835

Merged
merged 8 commits into from
Nov 22, 2021

Conversation

gpleiss
Copy link
Member

@gpleiss gpleiss commented Nov 22, 2021

There are a number of new deprecation warnings due to PyTorch 1.10 (plus some other warnings that we've previously missed). This PR addresses all warnings that pop up in the test suite.

This should hopefully be an easy merge.

@gpleiss gpleiss enabled auto-merge (squash) November 22, 2021 15:35
@gpleiss gpleiss changed the title Fix pytorch 1.10 warnings in test suite Update min PyTorch version to 1.10, resolve deprecation warnings Nov 22, 2021
@Balandat
Copy link
Collaborator

It seems a bit aggressive to jump from 1.8.1 min req to 1.10 skipping 1.9, and just one month after 1.10 was released. This could mean a lot of folks that are using this in a prod setting and who may be able to upgrade gpytorch but not torch would not be able to use this for a while. Are there any warnings that were issued starting with 1.9? If so coudl we split those out and make a release that requires 1.9, and then merge the rest of this?

@gpleiss
Copy link
Member Author

gpleiss commented Nov 22, 2021

Okay yeah that's fair. There was only one minor 1.10-specific warning. I'll split that out

@gpleiss gpleiss changed the title Update min PyTorch version to 1.10, resolve deprecation warnings Update min PyTorch version to 1.9, resolve deprecation warnings Nov 22, 2021
Copy link
Collaborator

@Balandat Balandat left a comment

Choose a reason for hiding this comment

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

couple of nits, o/w lgtm!

Comment on lines +55 to +56
row_index_block = torch.div(row_index, self.base_lazy_tensor.size(-2), rounding_mode="floor")
col_index_block = torch.div(col_index, self.base_lazy_tensor.size(-1), rounding_mode="floor")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
row_index_block = torch.div(row_index, self.base_lazy_tensor.size(-2), rounding_mode="floor")
col_index_block = torch.div(col_index, self.base_lazy_tensor.size(-1), rounding_mode="floor")
row_size, col_size = self.base_lazy_tensor.shape[-2:]
row_index_block = torch.div(row_index, row_size, rounding_mode="floor")
col_index_block = torch.div(col_index, col_size, rounding_mode="floor")

Comment on lines +56 to +57
row_index = torch.div(row_index, self.base_lazy_tensor.size(-3), rounding_mode="floor")
col_index = torch.div(col_index, self.base_lazy_tensor.size(-3), rounding_mode="floor")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
row_index = torch.div(row_index, self.base_lazy_tensor.size(-3), rounding_mode="floor")
col_index = torch.div(col_index, self.base_lazy_tensor.size(-3), rounding_mode="floor")
block_dim = self.base_lazy_tensor.size(-3)
row_index = torch.div(row_index, block_dim, rounding_mode="floor")
col_index = torch.div(col_index, block_dim, rounding_mode="floor")

@gpleiss gpleiss merged commit 452443a into master Nov 22, 2021
@Balandat
Copy link
Collaborator

oops so much for the suggestions, auto-merge

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