-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[pytorch-vulkan] Support zero-dim #111680
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/111680
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 3163294 with merge base b3bb94b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D50347338 |
7ccea75 to
10e1cc4
Compare
|
This pull request was exported from Phabricator. Differential Revision: D50347338 |
10e1cc4 to
0808e21
Compare
|
This pull request was exported from Phabricator. Differential Revision: D50347338 |
0808e21 to
dfeecc1
Compare
|
This pull request was exported from Phabricator. Differential Revision: D50347338 |
dfeecc1 to
768a110
Compare
|
This pull request was exported from Phabricator. Differential Revision: D50347338 |
768a110 to
ae52e31
Compare
|
This pull request was exported from Phabricator. Differential Revision: D50347338 |
ae52e31 to
44414d0
Compare
Summary: 1. Add zero-dim (Tensor with 1 element) support. 2. New operator `_local_scalar_dense` that map a zero-dim tensor into a Scalar 3. `sum_dim`: 3.1. Add zero-dim support. 3.2. Fix bug in negative indices when handling multi-dim reduction call 3.3. Add unittests to test new coverages 4. Add `aten::sum` support. 5. Change bug in `add_tensor` (and other binary ops), when `other` is zero dim, we will use broadcast instead. Test Plan: ## Devserver Full Paste: P858982150 ``` [yipjustin@31799.od ~/fbsource (8593e7559)]$ LD_LIBRARY_PATH=third-party/swiftshader/lib/linux-x64/ buck2 run fbcode/mode/dev-nosan -c pt.has_backtraces=1 //xplat/caffe2:pt_vulkan_api_test_bin -- File changed: fbsource//xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp Buck UI: https://www.internalfb.com/buck2/90cad0ff-ac98-4dbf-8d6f-0e419c06208d Network: Up: 43KiB Down: 1.4MiB (reSessionID-dfc3a318-fd1a-4ad6-b077-c454ebb4c6a8) Jobs completed: 6. Time elapsed: 26.4s. Cache hits: 0%. Commands: 2 (cached: 0, remote: 1, local: 1) BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc [==========] Running 385 tests from 1 test suite. [----------] Global test environment set-up. [----------] 385 tests from VulkanAPITest [ RUN ] VulkanAPITest.zero_size_tensor [ OK ] VulkanAPITest.zero_size_tensor (9 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_1 [ OK ] VulkanAPITest.zero_dim_tensor_1 (84 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_2 [ OK ] VulkanAPITest.zero_dim_tensor_2 (22 ms) [ RUN ] VulkanAPITest.local_scalar_dense [ OK ] VulkanAPITest.local_scalar_dense (10 ms) ... [ OK ] VulkanAPITest.lstm_prepack_success (2 ms) [ RUN ] VulkanAPITest.querypool_flushed_shader_log xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp:7484: Skipped QueryPool is not available [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log (0 ms) [----------] 385 tests from VulkanAPITest (46915 ms total) [----------] Global test environment tear-down [==========] 385 tests from 1 test suite ran. (46915 ms total) [ PASSED ] 382 tests. [ SKIPPED ] 1 test, listed below: [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log [ FAILED ] 2 tests, listed below: [ FAILED ] VulkanAPITest.conv2d_pw_prepack [ FAILED ] VulkanAPITest.conv2d_pw_prepack_bc 2 FAILED TESTS YOU HAVE 7 DISABLED TESTS ``` ## M1 MAC P859975219 ``` buck run //xplat/caffe2:pt_vulkan_api_test_binAppleMac\#macosx-arm64 --target-platforms ovr_config//platform/macos:arm64-fbsource -- --gtest_filter="*" Using additional configuration options from .buckconfig.local Building: finished in 0.2 sec (100%) 269/2875 jobs, 0/2875 updated Total time: 0.2 sec BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc [==========] Running 384 tests from 1 test suite. [----------] Global test environment set-up. [----------] 384 tests from VulkanAPITest [ RUN ] VulkanAPITest.zero_size_tensor [ OK ] VulkanAPITest.zero_size_tensor (40 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_1 [ OK ] VulkanAPITest.zero_dim_tensor_1 (7 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_2 [ OK ] VulkanAPITest.zero_dim_tensor_2 (1 ms) [ RUN ] VulkanAPITest.local_scalar_dense [ OK ] VulkanAPITest.local_scalar_dense (0 ms) [ RUN ] VulkanAPITest.copy_to_texture [ OK ] VulkanAPITest.copy_to_texture (45 ms) ... [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log (0 ms) [----------] 384 tests from VulkanAPITest (5127 ms total) [----------] Global test environment tear-down [==========] 384 tests from 1 test suite ran. (5127 ms total) [ PASSED ] 382 tests. [ SKIPPED ] 1 test, listed below: [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log [ FAILED ] 1 test, listed below: [ FAILED ] VulkanAPITest.normal_large 1 FAILED TEST YOU HAVE 5 DISABLED TESTS ``` Reviewed By: SS-JIA Differential Revision: D50347338
|
This pull request was exported from Phabricator. Differential Revision: D50347338 |
1 similar comment
|
This pull request was exported from Phabricator. Differential Revision: D50347338 |
Summary: Pull Request resolved: pytorch#111680 1. Add zero-dim (Tensor with 1 element) support. 2. New operator `_local_scalar_dense` that map a zero-dim tensor into a Scalar 3. `sum_dim`: 3.1. Add zero-dim support. 3.2. Fix bug in negative indices when handling multi-dim reduction call 3.3. Add unittests to test new coverages 4. Add `aten::sum` support. 5. Change bug in `add_tensor` (and other binary ops), when `other` is zero dim, we will use broadcast instead. Test Plan: ## Devserver Full Paste: P858982150 ``` [yipjustin@31799.od ~/fbsource (8593e7559)]$ LD_LIBRARY_PATH=third-party/swiftshader/lib/linux-x64/ buck2 run fbcode/mode/dev-nosan -c pt.has_backtraces=1 //xplat/caffe2:pt_vulkan_api_test_bin -- File changed: fbsource//xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp Buck UI: https://www.internalfb.com/buck2/90cad0ff-ac98-4dbf-8d6f-0e419c06208d Network: Up: 43KiB Down: 1.4MiB (reSessionID-dfc3a318-fd1a-4ad6-b077-c454ebb4c6a8) Jobs completed: 6. Time elapsed: 26.4s. Cache hits: 0%. Commands: 2 (cached: 0, remote: 1, local: 1) BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc [==========] Running 385 tests from 1 test suite. [----------] Global test environment set-up. [----------] 385 tests from VulkanAPITest [ RUN ] VulkanAPITest.zero_size_tensor [ OK ] VulkanAPITest.zero_size_tensor (9 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_1 [ OK ] VulkanAPITest.zero_dim_tensor_1 (84 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_2 [ OK ] VulkanAPITest.zero_dim_tensor_2 (22 ms) [ RUN ] VulkanAPITest.local_scalar_dense [ OK ] VulkanAPITest.local_scalar_dense (10 ms) ... [ OK ] VulkanAPITest.lstm_prepack_success (2 ms) [ RUN ] VulkanAPITest.querypool_flushed_shader_log xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp:7484: Skipped QueryPool is not available [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log (0 ms) [----------] 385 tests from VulkanAPITest (46915 ms total) [----------] Global test environment tear-down [==========] 385 tests from 1 test suite ran. (46915 ms total) [ PASSED ] 382 tests. [ SKIPPED ] 1 test, listed below: [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log [ FAILED ] 2 tests, listed below: [ FAILED ] VulkanAPITest.conv2d_pw_prepack [ FAILED ] VulkanAPITest.conv2d_pw_prepack_bc 2 FAILED TESTS YOU HAVE 7 DISABLED TESTS ``` ## M1 MAC P859975219 ``` buck run //xplat/caffe2:pt_vulkan_api_test_binAppleMac\#macosx-arm64 --target-platforms ovr_config//platform/macos:arm64-fbsource -- --gtest_filter="*" Using additional configuration options from .buckconfig.local Building: finished in 0.2 sec (100%) 269/2875 jobs, 0/2875 updated Total time: 0.2 sec BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc [==========] Running 384 tests from 1 test suite. [----------] Global test environment set-up. [----------] 384 tests from VulkanAPITest [ RUN ] VulkanAPITest.zero_size_tensor [ OK ] VulkanAPITest.zero_size_tensor (40 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_1 [ OK ] VulkanAPITest.zero_dim_tensor_1 (7 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_2 [ OK ] VulkanAPITest.zero_dim_tensor_2 (1 ms) [ RUN ] VulkanAPITest.local_scalar_dense [ OK ] VulkanAPITest.local_scalar_dense (0 ms) [ RUN ] VulkanAPITest.copy_to_texture [ OK ] VulkanAPITest.copy_to_texture (45 ms) ... [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log (0 ms) [----------] 384 tests from VulkanAPITest (5127 ms total) [----------] Global test environment tear-down [==========] 384 tests from 1 test suite ran. (5127 ms total) [ PASSED ] 382 tests. [ SKIPPED ] 1 test, listed below: [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log [ FAILED ] 1 test, listed below: [ FAILED ] VulkanAPITest.normal_large 1 FAILED TEST YOU HAVE 5 DISABLED TESTS ``` bypass-github-pytorch-ci-checks "linux-focal-cuda12.1-py3.10-gcc9-sm86 / test (default, 4, 5, linux.g5.4xlarge.nvidia.gpu)" is related to this diff. Reviewed By: SS-JIA Differential Revision: D50347338 fbshipit-source-id: 03dc1f4272a7c9dad2b87c981dec6f13194fc645
|
This pull request was exported from Phabricator. Differential Revision: D50347338 |
44414d0 to
3163294
Compare
|
@pytorchbot merge |
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: 1. Add zero-dim (Tensor with 1 element) support. 2. New operator `_local_scalar_dense` that map a zero-dim tensor into a Scalar 3. `sum_dim`: 3.1. Add zero-dim support. 3.2. Fix bug in negative indices when handling multi-dim reduction call 3.3. Add unittests to test new coverages 4. Add `aten::sum` support. 5. Change bug in `add_tensor` (and other binary ops), when `other` is zero dim, we will use broadcast instead. Test Plan: ## Devserver Full Paste: P858982150 ``` [yipjustin@31799.od ~/fbsource (8593e7559)]$ LD_LIBRARY_PATH=third-party/swiftshader/lib/linux-x64/ buck2 run fbcode/mode/dev-nosan -c pt.has_backtraces=1 //xplat/caffe2:pt_vulkan_api_test_bin -- File changed: fbsource//xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp Buck UI: https://www.internalfb.com/buck2/90cad0ff-ac98-4dbf-8d6f-0e419c06208d Network: Up: 43KiB Down: 1.4MiB (reSessionID-dfc3a318-fd1a-4ad6-b077-c454ebb4c6a8) Jobs completed: 6. Time elapsed: 26.4s. Cache hits: 0%. Commands: 2 (cached: 0, remote: 1, local: 1) BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc [==========] Running 385 tests from 1 test suite. [----------] Global test environment set-up. [----------] 385 tests from VulkanAPITest [ RUN ] VulkanAPITest.zero_size_tensor [ OK ] VulkanAPITest.zero_size_tensor (9 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_1 [ OK ] VulkanAPITest.zero_dim_tensor_1 (84 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_2 [ OK ] VulkanAPITest.zero_dim_tensor_2 (22 ms) [ RUN ] VulkanAPITest.local_scalar_dense [ OK ] VulkanAPITest.local_scalar_dense (10 ms) ... [ OK ] VulkanAPITest.lstm_prepack_success (2 ms) [ RUN ] VulkanAPITest.querypool_flushed_shader_log xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp:7484: Skipped QueryPool is not available [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log (0 ms) [----------] 385 tests from VulkanAPITest (46915 ms total) [----------] Global test environment tear-down [==========] 385 tests from 1 test suite ran. (46915 ms total) [ PASSED ] 382 tests. [ SKIPPED ] 1 test, listed below: [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log [ FAILED ] 2 tests, listed below: [ FAILED ] VulkanAPITest.conv2d_pw_prepack [ FAILED ] VulkanAPITest.conv2d_pw_prepack_bc 2 FAILED TESTS YOU HAVE 7 DISABLED TESTS ``` ## M1 MAC P859975219 ``` buck run //xplat/caffe2:pt_vulkan_api_test_binAppleMac\#macosx-arm64 --target-platforms ovr_config//platform/macos:arm64-fbsource -- --gtest_filter="*" Using additional configuration options from .buckconfig.local Building: finished in 0.2 sec (100%) 269/2875 jobs, 0/2875 updated Total time: 0.2 sec BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc [==========] Running 384 tests from 1 test suite. [----------] Global test environment set-up. [----------] 384 tests from VulkanAPITest [ RUN ] VulkanAPITest.zero_size_tensor [ OK ] VulkanAPITest.zero_size_tensor (40 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_1 [ OK ] VulkanAPITest.zero_dim_tensor_1 (7 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_2 [ OK ] VulkanAPITest.zero_dim_tensor_2 (1 ms) [ RUN ] VulkanAPITest.local_scalar_dense [ OK ] VulkanAPITest.local_scalar_dense (0 ms) [ RUN ] VulkanAPITest.copy_to_texture [ OK ] VulkanAPITest.copy_to_texture (45 ms) ... [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log (0 ms) [----------] 384 tests from VulkanAPITest (5127 ms total) [----------] Global test environment tear-down [==========] 384 tests from 1 test suite ran. (5127 ms total) [ PASSED ] 382 tests. [ SKIPPED ] 1 test, listed below: [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log [ FAILED ] 1 test, listed below: [ FAILED ] VulkanAPITest.normal_large 1 FAILED TEST YOU HAVE 5 DISABLED TESTS ``` Differential Revision: D50347338 Pull Request resolved: pytorch#111680 Approved by: https://github.com/SS-JIA
Summary: 1. Add zero-dim (Tensor with 1 element) support. 2. New operator `_local_scalar_dense` that map a zero-dim tensor into a Scalar 3. `sum_dim`: 3.1. Add zero-dim support. 3.2. Fix bug in negative indices when handling multi-dim reduction call 3.3. Add unittests to test new coverages 4. Add `aten::sum` support. 5. Change bug in `add_tensor` (and other binary ops), when `other` is zero dim, we will use broadcast instead. Test Plan: ## Devserver Full Paste: P858982150 ``` [yipjustin@31799.od ~/fbsource (8593e7559)]$ LD_LIBRARY_PATH=third-party/swiftshader/lib/linux-x64/ buck2 run fbcode/mode/dev-nosan -c pt.has_backtraces=1 //xplat/caffe2:pt_vulkan_api_test_bin -- File changed: fbsource//xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp Buck UI: https://www.internalfb.com/buck2/90cad0ff-ac98-4dbf-8d6f-0e419c06208d Network: Up: 43KiB Down: 1.4MiB (reSessionID-dfc3a318-fd1a-4ad6-b077-c454ebb4c6a8) Jobs completed: 6. Time elapsed: 26.4s. Cache hits: 0%. Commands: 2 (cached: 0, remote: 1, local: 1) BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc [==========] Running 385 tests from 1 test suite. [----------] Global test environment set-up. [----------] 385 tests from VulkanAPITest [ RUN ] VulkanAPITest.zero_size_tensor [ OK ] VulkanAPITest.zero_size_tensor (9 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_1 [ OK ] VulkanAPITest.zero_dim_tensor_1 (84 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_2 [ OK ] VulkanAPITest.zero_dim_tensor_2 (22 ms) [ RUN ] VulkanAPITest.local_scalar_dense [ OK ] VulkanAPITest.local_scalar_dense (10 ms) ... [ OK ] VulkanAPITest.lstm_prepack_success (2 ms) [ RUN ] VulkanAPITest.querypool_flushed_shader_log xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp:7484: Skipped QueryPool is not available [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log (0 ms) [----------] 385 tests from VulkanAPITest (46915 ms total) [----------] Global test environment tear-down [==========] 385 tests from 1 test suite ran. (46915 ms total) [ PASSED ] 382 tests. [ SKIPPED ] 1 test, listed below: [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log [ FAILED ] 2 tests, listed below: [ FAILED ] VulkanAPITest.conv2d_pw_prepack [ FAILED ] VulkanAPITest.conv2d_pw_prepack_bc 2 FAILED TESTS YOU HAVE 7 DISABLED TESTS ``` ## M1 MAC P859975219 ``` buck run //xplat/caffe2:pt_vulkan_api_test_binAppleMac\#macosx-arm64 --target-platforms ovr_config//platform/macos:arm64-fbsource -- --gtest_filter="*" Using additional configuration options from .buckconfig.local Building: finished in 0.2 sec (100%) 269/2875 jobs, 0/2875 updated Total time: 0.2 sec BUILD SUCCEEDED Running main() from third-party/googletest/1.11.0/googletest/googletest/src/gtest_main.cc [==========] Running 384 tests from 1 test suite. [----------] Global test environment set-up. [----------] 384 tests from VulkanAPITest [ RUN ] VulkanAPITest.zero_size_tensor [ OK ] VulkanAPITest.zero_size_tensor (40 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_1 [ OK ] VulkanAPITest.zero_dim_tensor_1 (7 ms) [ RUN ] VulkanAPITest.zero_dim_tensor_2 [ OK ] VulkanAPITest.zero_dim_tensor_2 (1 ms) [ RUN ] VulkanAPITest.local_scalar_dense [ OK ] VulkanAPITest.local_scalar_dense (0 ms) [ RUN ] VulkanAPITest.copy_to_texture [ OK ] VulkanAPITest.copy_to_texture (45 ms) ... [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log (0 ms) [----------] 384 tests from VulkanAPITest (5127 ms total) [----------] Global test environment tear-down [==========] 384 tests from 1 test suite ran. (5127 ms total) [ PASSED ] 382 tests. [ SKIPPED ] 1 test, listed below: [ SKIPPED ] VulkanAPITest.querypool_flushed_shader_log [ FAILED ] 1 test, listed below: [ FAILED ] VulkanAPITest.normal_large 1 FAILED TEST YOU HAVE 5 DISABLED TESTS ``` Differential Revision: D50347338 Pull Request resolved: pytorch#111680 Approved by: https://github.com/SS-JIA
Summary:
_local_scalar_densethat map a zero-dim tensor into a Scalarsum_dim:3.1. Add zero-dim support.
3.2. Fix bug in negative indices when handling multi-dim reduction call
3.3. Add unittests to test new coverages
aten::sumsupport.add_tensor(and other binary ops), whenotheris zero dim, we will use broadcast instead.Test Plan:
Devserver
Full Paste: P858982150
M1 MAC
P859975219
Differential Revision: D50347338