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
[Pytorch][Vulkan] mean.dim #111609
[Pytorch][Vulkan] mean.dim #111609
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/111609
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 4784ab7 with merge base 7709382 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D50312990 |
7fbfdbf
to
c7f598b
Compare
Summary: We implement [`torch.mean(input, dim, keepdim)`](https://pytorch.org/docs/stable/generated/torch.mean.html) for tensors of 2d to 4d. Since 0-dim tensor hasn't been supported yet, we only support `dim.size() < input.dim()` for now. We will support following cases in the future work: - `dim.size() == input.dim()` - `input.dim() == 1` Test Plan: ``` [luwei@devbig984.prn1 /data/users/luwei/fbsource (970fcd90c)]$ LD_LIBRARY_PATH=third-party/swiftshader/lib/linux-x64/ buck run fbcode/mode/dev-nosan //xplat/caffe2:pt_vulkan_api_test_bin -- --gtest_filter="*mean*" Building: finished in 0.1 sec (100%) 339/339 jobs, 0/339 updated Total time: 0.1 sec BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc Note: Google Test filter = *mean* [==========] Running 7 tests from 1 test suite. [----------] Global test environment set-up. [----------] 7 tests from VulkanAPITest [ RUN ] VulkanAPITest.mean_invalid_inputs [ OK ] VulkanAPITest.mean_invalid_inputs (46 ms) [ RUN ] VulkanAPITest.mean_dim_2d [ OK ] VulkanAPITest.mean_dim_2d (127 ms) [ RUN ] VulkanAPITest.mean_dim_3d [ OK ] VulkanAPITest.mean_dim_3d (103 ms) [ RUN ] VulkanAPITest.mean_dim_4d [ OK ] VulkanAPITest.mean_dim_4d (89 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_2d [ OK ] VulkanAPITest.mean_dim_keepdim_2d (66 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_3d [ OK ] VulkanAPITest.mean_dim_keepdim_3d (127 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_4d [ OK ] VulkanAPITest.mean_dim_keepdim_4d (4 ms) [----------] 7 tests from VulkanAPITest (564 ms total) [----------] Global test environment tear-down [==========] 7 tests from 1 test suite ran. (564 ms total) [ PASSED ] 7 tests. ``` Reviewed By: yipjustin Differential Revision: D50312990
This pull request was exported from Phabricator. Differential Revision: D50312990 |
Summary: We implement [`torch.mean(input, dim, keepdim)`](https://pytorch.org/docs/stable/generated/torch.mean.html) for tensors of 2d to 4d. Since 0-dim tensor hasn't been supported yet, we only support `dim.size() < input.dim()` for now. We will support following cases in the future work: - `dim.size() == input.dim()` - `input.dim() == 1` Test Plan: ``` [luwei@devbig984.prn1 /data/users/luwei/fbsource (970fcd90c)]$ LD_LIBRARY_PATH=third-party/swiftshader/lib/linux-x64/ buck run fbcode/mode/dev-nosan //xplat/caffe2:pt_vulkan_api_test_bin -- --gtest_filter="*mean*" Building: finished in 0.1 sec (100%) 339/339 jobs, 0/339 updated Total time: 0.1 sec BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc Note: Google Test filter = *mean* [==========] Running 7 tests from 1 test suite. [----------] Global test environment set-up. [----------] 7 tests from VulkanAPITest [ RUN ] VulkanAPITest.mean_invalid_inputs [ OK ] VulkanAPITest.mean_invalid_inputs (46 ms) [ RUN ] VulkanAPITest.mean_dim_2d [ OK ] VulkanAPITest.mean_dim_2d (127 ms) [ RUN ] VulkanAPITest.mean_dim_3d [ OK ] VulkanAPITest.mean_dim_3d (103 ms) [ RUN ] VulkanAPITest.mean_dim_4d [ OK ] VulkanAPITest.mean_dim_4d (89 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_2d [ OK ] VulkanAPITest.mean_dim_keepdim_2d (66 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_3d [ OK ] VulkanAPITest.mean_dim_keepdim_3d (127 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_4d [ OK ] VulkanAPITest.mean_dim_keepdim_4d (4 ms) [----------] 7 tests from VulkanAPITest (564 ms total) [----------] Global test environment tear-down [==========] 7 tests from 1 test suite ran. (564 ms total) [ PASSED ] 7 tests. ``` Reviewed By: yipjustin Differential Revision: D50312990
c7f598b
to
e26f8c5
Compare
This pull request was exported from Phabricator. Differential Revision: D50312990 |
Summary: We implement [`torch.mean(input, dim, keepdim)`](https://pytorch.org/docs/stable/generated/torch.mean.html) for tensors of 2d to 4d. Since 0-dim tensor hasn't been supported yet, we only support `dim.size() < input.dim()` for now. We will support following cases in the future work: - `dim.size() == input.dim()` - `input.dim() == 1` Test Plan: ``` [luwei@devbig984.prn1 /data/users/luwei/fbsource (970fcd90c)]$ LD_LIBRARY_PATH=third-party/swiftshader/lib/linux-x64/ buck run fbcode/mode/dev-nosan //xplat/caffe2:pt_vulkan_api_test_bin -- --gtest_filter="*mean*" Building: finished in 0.1 sec (100%) 339/339 jobs, 0/339 updated Total time: 0.1 sec BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc Note: Google Test filter = *mean* [==========] Running 7 tests from 1 test suite. [----------] Global test environment set-up. [----------] 7 tests from VulkanAPITest [ RUN ] VulkanAPITest.mean_invalid_inputs [ OK ] VulkanAPITest.mean_invalid_inputs (46 ms) [ RUN ] VulkanAPITest.mean_dim_2d [ OK ] VulkanAPITest.mean_dim_2d (127 ms) [ RUN ] VulkanAPITest.mean_dim_3d [ OK ] VulkanAPITest.mean_dim_3d (103 ms) [ RUN ] VulkanAPITest.mean_dim_4d [ OK ] VulkanAPITest.mean_dim_4d (89 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_2d [ OK ] VulkanAPITest.mean_dim_keepdim_2d (66 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_3d [ OK ] VulkanAPITest.mean_dim_keepdim_3d (127 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_4d [ OK ] VulkanAPITest.mean_dim_keepdim_4d (4 ms) [----------] 7 tests from VulkanAPITest (564 ms total) [----------] Global test environment tear-down [==========] 7 tests from 1 test suite ran. (564 ms total) [ PASSED ] 7 tests. ``` Reviewed By: yipjustin Differential Revision: D50312990
e26f8c5
to
4784ab7
Compare
This pull request was exported from Phabricator. Differential Revision: D50312990 |
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Summary: We implement [`torch.mean(input, dim, keepdim)`](https://pytorch.org/docs/stable/generated/torch.mean.html) for tensors of 2d to 4d. Since 0-dim tensor hasn't been supported yet, we only support `dim.size() < input.dim()` for now. We will support following cases in the future work: - `dim.size() == input.dim()` - `input.dim() == 1` Test Plan: ``` [luwei@devbig984.prn1 /data/users/luwei/fbsource (970fcd90c)]$ LD_LIBRARY_PATH=third-party/swiftshader/lib/linux-x64/ buck run fbcode/mode/dev-nosan //xplat/caffe2:pt_vulkan_api_test_bin -- --gtest_filter="*mean*" Building: finished in 0.1 sec (100%) 339/339 jobs, 0/339 updated Total time: 0.1 sec BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc Note: Google Test filter = *mean* [==========] Running 7 tests from 1 test suite. [----------] Global test environment set-up. [----------] 7 tests from VulkanAPITest [ RUN ] VulkanAPITest.mean_invalid_inputs [ OK ] VulkanAPITest.mean_invalid_inputs (46 ms) [ RUN ] VulkanAPITest.mean_dim_2d [ OK ] VulkanAPITest.mean_dim_2d (127 ms) [ RUN ] VulkanAPITest.mean_dim_3d [ OK ] VulkanAPITest.mean_dim_3d (103 ms) [ RUN ] VulkanAPITest.mean_dim_4d [ OK ] VulkanAPITest.mean_dim_4d (89 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_2d [ OK ] VulkanAPITest.mean_dim_keepdim_2d (66 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_3d [ OK ] VulkanAPITest.mean_dim_keepdim_3d (127 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_4d [ OK ] VulkanAPITest.mean_dim_keepdim_4d (4 ms) [----------] 7 tests from VulkanAPITest (564 ms total) [----------] Global test environment tear-down [==========] 7 tests from 1 test suite ran. (564 ms total) [ PASSED ] 7 tests. ``` Reviewed By: yipjustin Differential Revision: D50312990 Pull Request resolved: pytorch#111609 Approved by: https://github.com/yipjustin
Summary: We implement [`torch.mean(input, dim, keepdim)`](https://pytorch.org/docs/stable/generated/torch.mean.html) for tensors of 2d to 4d. Since 0-dim tensor hasn't been supported yet, we only support `dim.size() < input.dim()` for now. We will support following cases in the future work: - `dim.size() == input.dim()` - `input.dim() == 1` Test Plan: ``` [luwei@devbig984.prn1 /data/users/luwei/fbsource (970fcd90c)]$ LD_LIBRARY_PATH=third-party/swiftshader/lib/linux-x64/ buck run fbcode/mode/dev-nosan //xplat/caffe2:pt_vulkan_api_test_bin -- --gtest_filter="*mean*" Building: finished in 0.1 sec (100%) 339/339 jobs, 0/339 updated Total time: 0.1 sec BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc Note: Google Test filter = *mean* [==========] Running 7 tests from 1 test suite. [----------] Global test environment set-up. [----------] 7 tests from VulkanAPITest [ RUN ] VulkanAPITest.mean_invalid_inputs [ OK ] VulkanAPITest.mean_invalid_inputs (46 ms) [ RUN ] VulkanAPITest.mean_dim_2d [ OK ] VulkanAPITest.mean_dim_2d (127 ms) [ RUN ] VulkanAPITest.mean_dim_3d [ OK ] VulkanAPITest.mean_dim_3d (103 ms) [ RUN ] VulkanAPITest.mean_dim_4d [ OK ] VulkanAPITest.mean_dim_4d (89 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_2d [ OK ] VulkanAPITest.mean_dim_keepdim_2d (66 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_3d [ OK ] VulkanAPITest.mean_dim_keepdim_3d (127 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_4d [ OK ] VulkanAPITest.mean_dim_keepdim_4d (4 ms) [----------] 7 tests from VulkanAPITest (564 ms total) [----------] Global test environment tear-down [==========] 7 tests from 1 test suite ran. (564 ms total) [ PASSED ] 7 tests. ``` Reviewed By: yipjustin Differential Revision: D50312990 Pull Request resolved: pytorch#111609 Approved by: https://github.com/yipjustin
Summary: We implement [`torch.mean(input, dim, keepdim)`](https://pytorch.org/docs/stable/generated/torch.mean.html) for tensors of 2d to 4d. Since 0-dim tensor hasn't been supported yet, we only support `dim.size() < input.dim()` for now. We will support following cases in the future work: - `dim.size() == input.dim()` - `input.dim() == 1` Test Plan: ``` [luwei@devbig984.prn1 /data/users/luwei/fbsource (970fcd90c)]$ LD_LIBRARY_PATH=third-party/swiftshader/lib/linux-x64/ buck run fbcode/mode/dev-nosan //xplat/caffe2:pt_vulkan_api_test_bin -- --gtest_filter="*mean*" Building: finished in 0.1 sec (100%) 339/339 jobs, 0/339 updated Total time: 0.1 sec BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc Note: Google Test filter = *mean* [==========] Running 7 tests from 1 test suite. [----------] Global test environment set-up. [----------] 7 tests from VulkanAPITest [ RUN ] VulkanAPITest.mean_invalid_inputs [ OK ] VulkanAPITest.mean_invalid_inputs (46 ms) [ RUN ] VulkanAPITest.mean_dim_2d [ OK ] VulkanAPITest.mean_dim_2d (127 ms) [ RUN ] VulkanAPITest.mean_dim_3d [ OK ] VulkanAPITest.mean_dim_3d (103 ms) [ RUN ] VulkanAPITest.mean_dim_4d [ OK ] VulkanAPITest.mean_dim_4d (89 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_2d [ OK ] VulkanAPITest.mean_dim_keepdim_2d (66 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_3d [ OK ] VulkanAPITest.mean_dim_keepdim_3d (127 ms) [ RUN ] VulkanAPITest.mean_dim_keepdim_4d [ OK ] VulkanAPITest.mean_dim_keepdim_4d (4 ms) [----------] 7 tests from VulkanAPITest (564 ms total) [----------] Global test environment tear-down [==========] 7 tests from 1 test suite ran. (564 ms total) [ PASSED ] 7 tests. ``` Reviewed By: yipjustin Differential Revision: D50312990 Pull Request resolved: pytorch#111609 Approved by: https://github.com/yipjustin
Summary:
We implement
torch.mean(input, dim, keepdim)
for tensors of 2d to 4d.Since 0-dim tensor hasn't been supported yet, we only support
dim.size() < input.dim()
for now. We will support following cases in the future work:dim.size() == input.dim()
input.dim() == 1
Test Plan:
Reviewed By: yipjustin
Differential Revision: D50312990