Skip to content

OpInfo for adaptive_avg_pool2d#62704

Closed
krshrimali wants to merge 4 commits intopytorch:masterfrom
krshrimali:opinfo/high_priority/nn/functional/adaptive_avg_pool2d
Closed

OpInfo for adaptive_avg_pool2d#62704
krshrimali wants to merge 4 commits intopytorch:masterfrom
krshrimali:opinfo/high_priority/nn/functional/adaptive_avg_pool2d

Conversation

@krshrimali
Copy link
Contributor

@krshrimali krshrimali commented Aug 4, 2021

Please see pytorch/functorch#78 and #54261.

Note regarding sample inputs for this function:

  • Checks added for all relevant/interesting cases for output_size: (None, None), (None, width), (height, None), (height, width).

cc: @mruberry @zou3519 @Chillee

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Aug 4, 2021

🔗 Helpful links

💊 CI failures summary and remediations

As of commit 3ed1f38 (more details on the Dr. CI page):


None of the CI failures appear to be your fault 💚



❄️ 1 failure tentatively classified as flaky

but reruns have not yet been triggered to confirm:

See CircleCI build pytorch_linux_xenial_cuda11_1_cudnn8_py3_gcc7_test2 (1/1)

Step: "Run tests" (full log | diagnosis details | 🔁 rerun) ❄️

Aug 05 21:01:27 unknown file: Failure
Aug 05 21:01:27 frame #9: build/bin/test_api() [0xbdb39a]
Aug 05 21:01:27 frame #10: build/bin/test_api() [0xbdbbed]
Aug 05 21:01:27 frame #11: testing::internal::UnitTestImpl::RunAllTests() + 0xe27 (0xbe47b7 in build/bin/test_api)
Aug 05 21:01:27 frame #12: testing::UnitTest::Run() + 0x8f (0xbe4b6f in build/bin/test_api)
Aug 05 21:01:27 frame #13: main + 0xc8 (0x586cb8 in build/bin/test_api)
Aug 05 21:01:27 frame #14: __libc_start_main + 0xf0 (0x7f7239286840 in /lib/x86_64-linux-gnu/libc.so.6)
Aug 05 21:01:27 frame #15: _start + 0x29 (0x5c7b29 in build/bin/test_api)
Aug 05 21:01:27 " thrown in the test body.
Aug 05 21:01:27 [  FAILED  ] IMethodTest.CallMethod (3 ms)
Aug 05 21:01:27 [ RUN      ] IMethodTest.GetArgumentNames
Aug 05 21:01:27 unknown file: Failure
Aug 05 21:01:27 C++ exception with description "open file failed, file path: torch/csrc/deploy/example/generated/simple_jit
Aug 05 21:01:27 Exception raised from RAIIFile at /var/lib/jenkins/workspace/caffe2/serialize/file_adapter.cc:13 (most recent call first):
Aug 05 21:01:27 frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x6b (0x7f723999c4ab in /var/lib/jenkins/workspace/build/lib/libc10.so)
Aug 05 21:01:27 frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0xce (0x7f7239997c6e in /var/lib/jenkins/workspace/build/lib/libc10.so)
Aug 05 21:01:27 frame #2: caffe2::serialize::FileAdapter::RAIIFile::RAIIFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0xdc (0x7f7255ba003c in /var/lib/jenkins/workspace/build/lib/libtorch_cpu.so)
Aug 05 21:01:27 frame #3: caffe2::serialize::FileAdapter::FileAdapter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0x41 (0x7f7255ba06c1 in /var/lib/jenkins/workspace/build/lib/libtorch_cpu.so)
Aug 05 21:01:27 frame #4: torch::jit::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, c10::optional<c10::Device>, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&) + 0x40 (0x7f72571fb370 in /var/lib/jenkins/workspace/build/lib/libtorch_cpu.so)
Aug 05 21:01:27 frame #5: torch::jit::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, c10::optional<c10::Device>) + 0x6f (0x7f72571fb4ff in /var/lib/jenkins/workspace/build/lib/libtorch_cpu.so)
Aug 05 21:01:27 frame #6: IMethodTest_GetArgumentNames_Test::TestBody() + 0x7e (0xb9f5be in build/bin/test_api)
Aug 05 21:01:27 frame #7: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) + 0x4a (0xbebafa in build/bin/test_api)

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@krshrimali krshrimali added the module: testing Issues related to the torch.testing module (not tests) label Aug 4, 2021
@zou3519 zou3519 self-requested a review August 4, 2021 14:53
@ezyang ezyang added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Aug 4, 2021
Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

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

This looks pretty good, I had one small suggestion for a test case

Comment on lines +2213 to +2216
((1, 8, 8, 8), (5, 7)),
((2, 8, 8, 8), (None, 7)),
((1, 8, 4, 3), (5, None)),
((1, 8, 4, 3), (None, None)),
Copy link
Contributor

Choose a reason for hiding this comment

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

output_size is allowed to be a single integer according to https://pytorch.org/docs/stable/generated/torch.nn.functional.adaptive_avg_pool2d.html?highlight=adaptive_avg_pool#torch.nn.functional.adaptive_avg_pool2d, could we test that case for completeness?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for taking a look, @zou3519 - appreciate the suggestion. I've added a case in the latest commit, and have also merged with upstream. :)

@facebook-github-bot
Copy link
Contributor

@zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@zou3519 merged this pull request in 5c43198.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by 6e24ce7.

facebook-github-bot pushed a commit that referenced this pull request Aug 12, 2021
Summary:
This PR is an attempt to reland #62704.

**What has changed?**

The op has non-deterministic behavior, hence an appropriate `gradcheck` wrapper had to be added.

cc: mruberry zou3519 heitorschueroff kshitij12345

Pull Request resolved: #62935

Reviewed By: anjali411

Differential Revision: D30225095

Pulled By: zou3519

fbshipit-source-id: 644873cc21d44b19c8b68f9edff691913778de0e
alanwaketan pushed a commit that referenced this pull request Aug 17, 2021
Summary:
This PR is an attempt to reland #62704.

**What has changed?**

The op has non-deterministic behavior, hence an appropriate `gradcheck` wrapper had to be added.

cc: mruberry zou3519 heitorschueroff kshitij12345

Pull Request resolved: #62935

Reviewed By: anjali411

Differential Revision: D30225095

Pulled By: zou3519

fbshipit-source-id: 644873cc21d44b19c8b68f9edff691913778de0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged module: testing Issues related to the torch.testing module (not tests) open source Reverted 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.

5 participants