Skip to content

Conversation

@deandyu
Copy link
Contributor

@deandyu deandyu commented Dec 5, 2022

Fixes #85712

Standardizes error checking for max_pool1d between CPU and CPU requires_grad/CUDA.

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 5, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/90211

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 1b7306b:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 5, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@deandyu deandyu marked this pull request as ready for review December 5, 2022 21:06
@deandyu
Copy link
Contributor Author

deandyu commented Dec 5, 2022

/easycla


TORCH_CHECK(
KW > 0,
kernel_size[0] > 0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can the other error messages still be triggered? Do they need to removed or made consistent with these?

Copy link
Contributor Author

@deandyu deandyu Dec 5, 2022

Choose a reason for hiding this comment

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

I took the original error checks in max_pool1d_impl and refactored them into an error checking function (check_max_pool1d) that is run for both CPU and CUDA/CPU with requires_grad. The error messages that were originally triggered only by CUDA or CPU with requires_grad should no longer be triggered by max_pool1d, as these checks should cover all the same scenarios. However, they should not be removed, since they can still be triggered when max_pool2d is called natively.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So this PR fixes the inconsistency for max_pool1d (as it states) but not for max_pool2d?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not look into the code for max_pool2d as the issue was focused on inconsistencies in max_pool1d and these inconsistencies were well documented in pytorch/torch/testing/_internal/common_methods_invocations.py

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK

!self.device().is_cpu() ||
isTensorSubclassLike(self)) {
// Needs indices for grad and with_indices defines CUDA dispatch
check_max_pool1d(self, kernel_size, stride, padding, dilation);
Copy link
Collaborator

Choose a reason for hiding this comment

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

bring check_max_pool1d to above the conditional, as you are calling ti in all cases.

@deandyu deandyu requested review from mruberry and ngimel and removed request for mruberry and ngimel December 6, 2022 21:22
@deandyu
Copy link
Contributor Author

deandyu commented Dec 6, 2022

Sorry if I've bothered you with notifications, I tried to click the re-request review button and it behaved weirdly on my end.

@bdhirsh bdhirsh added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Dec 7, 2022
@mruberry
Copy link
Collaborator

mruberry commented Dec 7, 2022

Tests are running now, @deandyu. Once they run and reveal no issues relevant to this PR I think we'll be good to go. I'll just make a final check then.

@deandyu
Copy link
Contributor Author

deandyu commented Dec 9, 2022

Hey @mruberry, have you had a chance to look at the tests yet? As far as I can tell, (xla, 1, 1, linux.2xlarge) is the only test that fails, due to an issue that has been fixed in PR #90229.

@deandyu deandyu removed the request for review from ngimel December 12, 2022 18:47
@deandyu deandyu requested a review from mruberry December 12, 2022 18:47
@deandyu
Copy link
Contributor Author

deandyu commented Dec 14, 2022

@mruberry I just synced my fork to the main Repo as the PR was getting stale. Let me know if you need me to do anything else before this PR can be merged.

Copy link
Collaborator

@mruberry mruberry left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @deandyu!

@mruberry
Copy link
Collaborator

@pytorchbot merge -g

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 14, 2022
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks on your PR pass since you used the green (-g) flag (ETA: 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@deandyu
Copy link
Contributor Author

deandyu commented Dec 14, 2022

@mruberry Could you approve the remaining workflow? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

max_pool1d error messages diverge between CPU and CUDA

7 participants