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

[ONNX] Update Reducesum operator for opset 13 #50532

Merged
merged 20 commits into from Jan 20, 2021

Conversation

hwangdeyu
Copy link
Collaborator

embedding_bag which contains reducesum has also been updated.

@facebook-github-bot facebook-github-bot added cla signed oncall: jit Add this issue/PR to JIT oncall triage queue labels Jan 14, 2021
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jan 14, 2021

💊 CI failures summary and remediations

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



🕵️ 5 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_linux_bionic_py3_8_gcc9_coverage_test1 (1/5)

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

Jan 14 11:44:04 AssertionError: mypy failed: torch/onnx/symbolic_opset13.py:134: error: Name '_unimplemented' is not defined [name-defined]
Jan 14 11:43:41   test_type_hint_examples (__main__.TestTypeHints)
Jan 14 11:44:04 Runs mypy over all the test examples present in ... ok (22.273s)
Jan 14 11:44:04 
Jan 14 11:44:04 ======================================================================
Jan 14 11:44:04 FAIL [75.370s]: test_run_mypy (__main__.TestTypeHints)
Jan 14 11:44:04 Runs mypy over all files specified in mypy.ini
Jan 14 11:44:04 ----------------------------------------------------------------------
Jan 14 11:44:04 Traceback (most recent call last):
Jan 14 11:44:04   File "test_type_hints.py", line 214, in test_run_mypy
Jan 14 11:44:04     self.fail(f"mypy failed: {stdout} {stderr}")
Jan 14 11:44:04 AssertionError: mypy failed: torch/onnx/symbolic_opset13.py:134: error: Name '_unimplemented' is not defined  [name-defined]
Jan 14 11:44:04 torch/onnx/symbolic_opset13.py:140: error: Name '_unimplemented' is not defined  [name-defined]
Jan 14 11:44:04 Found 2 errors in 1 file (checked 1192 source files)
Jan 14 11:44:04  
Jan 14 11:44:04 
Jan 14 11:44:04 ----------------------------------------------------------------------
Jan 14 11:44:04 Ran 4 tests in 113.944s
Jan 14 11:44:04 
Jan 14 11:44:04 FAILED (failures=1)
Jan 14 11:44:04 
Jan 14 11:44:04 Generating XML reports...

See CircleCI build pytorch_linux_bionic_py3_6_clang9_test (2/5)

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

Jan 14 11:38:02 AssertionError: mypy failed: torch/onnx/symbolic_opset13.py:134: error: Name '_unimplemented' is not defined [name-defined]
Jan 14 11:37:37   test_run_mypy (__main__.TestTypeHints) ... FAIL (63.217s)
Jan 14 11:37:40   test_run_mypy_strict (__main__.TestTypeHints) ... ok (3.242s)
Jan 14 11:38:02   test_type_hint_examples (__main__.TestTypeHints) ... ok (21.603s)
Jan 14 11:38:02 
Jan 14 11:38:02 ======================================================================
Jan 14 11:38:02 FAIL [63.217s]: test_run_mypy (__main__.TestTypeHints)
Jan 14 11:38:02 ----------------------------------------------------------------------
Jan 14 11:38:02 Traceback (most recent call last):
Jan 14 11:38:02   File "test_type_hints.py", line 214, in test_run_mypy
Jan 14 11:38:02     self.fail(f"mypy failed: {stdout} {stderr}")
Jan 14 11:38:02 AssertionError: mypy failed: torch/onnx/symbolic_opset13.py:134: error: Name '_unimplemented' is not defined  [name-defined]
Jan 14 11:38:02 torch/onnx/symbolic_opset13.py:140: error: Name '_unimplemented' is not defined  [name-defined]
Jan 14 11:38:02 Found 2 errors in 1 file (checked 1192 source files)
Jan 14 11:38:02  
Jan 14 11:38:02 
Jan 14 11:38:02 ----------------------------------------------------------------------
Jan 14 11:38:02 Ran 4 tests in 99.196s
Jan 14 11:38:02 
Jan 14 11:38:02 FAILED (failures=1)
Jan 14 11:38:02 
Jan 14 11:38:02 Generating XML reports...

See CircleCI build pytorch_linux_xenial_py3_clang5_asan_test1 (3/5)

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

Jan 14 11:44:27 AssertionError: mypy failed: torch/onnx/symbolic_opset13.py:134: error: Name '_unimplemented' is not defined [name-defined]
Jan 14 11:44:02   test_run_mypy (__main__.TestTypeHints) ... FAIL (68.430s)
Jan 14 11:44:05   test_run_mypy_strict (__main__.TestTypeHints) ... ok (3.502s)
Jan 14 11:44:27   test_type_hint_examples (__main__.TestTypeHints) ... ok (22.212s)
Jan 14 11:44:27 
Jan 14 11:44:27 ======================================================================
Jan 14 11:44:27 FAIL [68.430s]: test_run_mypy (__main__.TestTypeHints)
Jan 14 11:44:27 ----------------------------------------------------------------------
Jan 14 11:44:27 Traceback (most recent call last):
Jan 14 11:44:27   File "test_type_hints.py", line 214, in test_run_mypy
Jan 14 11:44:27     self.fail(f"mypy failed: {stdout} {stderr}")
Jan 14 11:44:27 AssertionError: mypy failed: torch/onnx/symbolic_opset13.py:134: error: Name '_unimplemented' is not defined  [name-defined]
Jan 14 11:44:27 torch/onnx/symbolic_opset13.py:140: error: Name '_unimplemented' is not defined  [name-defined]
Jan 14 11:44:27 Found 2 errors in 1 file (checked 1192 source files)
Jan 14 11:44:27  
Jan 14 11:44:27 
Jan 14 11:44:27 ----------------------------------------------------------------------
Jan 14 11:44:27 Ran 4 tests in 106.452s
Jan 14 11:44:27 
Jan 14 11:44:27 FAILED (failures=1)
Jan 14 11:44:27 
Jan 14 11:44:27 Generating XML reports...

See CircleCI build pytorch_linux_xenial_cuda10_2_cudnn7_py3_gcc7_test1 (4/5)

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

Jan 14 11:53:35 AssertionError: mypy failed: torch/onnx/symbolic_opset13.py:134: error: Name '_unimplemented' is not defined [name-defined]
Jan 14 11:53:14   test_run_mypy (__main__.TestTypeHints) ... FAIL (63.069s)
Jan 14 11:53:17   test_run_mypy_strict (__main__.TestTypeHints) ... ok (2.956s)
Jan 14 11:53:35   test_type_hint_examples (__main__.TestTypeHints) ... ok (18.239s)
Jan 14 11:53:35 
Jan 14 11:53:35 ======================================================================
Jan 14 11:53:35 FAIL [63.069s]: test_run_mypy (__main__.TestTypeHints)
Jan 14 11:53:35 ----------------------------------------------------------------------
Jan 14 11:53:35 Traceback (most recent call last):
Jan 14 11:53:35   File "test_type_hints.py", line 214, in test_run_mypy
Jan 14 11:53:35     self.fail(f"mypy failed: {stdout} {stderr}")
Jan 14 11:53:35 AssertionError: mypy failed: torch/onnx/symbolic_opset13.py:134: error: Name '_unimplemented' is not defined  [name-defined]
Jan 14 11:53:35 torch/onnx/symbolic_opset13.py:140: error: Name '_unimplemented' is not defined  [name-defined]
Jan 14 11:53:35 Found 2 errors in 1 file (checked 1192 source files)
Jan 14 11:53:35  
Jan 14 11:53:35 
Jan 14 11:53:35 ----------------------------------------------------------------------
Jan 14 11:53:35 Ran 4 tests in 95.333s
Jan 14 11:53:35 
Jan 14 11:53:35 FAILED (failures=1)
Jan 14 11:53:35 
Jan 14 11:53:35 Generating XML reports...

See CircleCI build pytorch_linux_xenial_py3_6_gcc5_4_test (5/5)

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

Jan 14 11:38:56 AssertionError: mypy failed: torch/onnx/symbolic_opset13.py:134: error: Name '_unimplemented' is not defined [name-defined]
Jan 14 11:38:33   test_run_mypy (__main__.TestTypeHints) ... FAIL (60.728s)
Jan 14 11:38:36   test_run_mypy_strict (__main__.TestTypeHints) ... ok (3.045s)
Jan 14 11:38:56   test_type_hint_examples (__main__.TestTypeHints) ... ok (19.767s)
Jan 14 11:38:56 
Jan 14 11:38:56 ======================================================================
Jan 14 11:38:56 FAIL [60.728s]: test_run_mypy (__main__.TestTypeHints)
Jan 14 11:38:56 ----------------------------------------------------------------------
Jan 14 11:38:56 Traceback (most recent call last):
Jan 14 11:38:56   File "test_type_hints.py", line 214, in test_run_mypy
Jan 14 11:38:56     self.fail(f"mypy failed: {stdout} {stderr}")
Jan 14 11:38:56 AssertionError: mypy failed: torch/onnx/symbolic_opset13.py:134: error: Name '_unimplemented' is not defined  [name-defined]
Jan 14 11:38:56 torch/onnx/symbolic_opset13.py:140: error: Name '_unimplemented' is not defined  [name-defined]
Jan 14 11:38:56 Found 2 errors in 1 file (checked 1192 source files)
Jan 14 11:38:56  
Jan 14 11:38:56 
Jan 14 11:38:56 ----------------------------------------------------------------------
Jan 14 11:38:56 Ran 4 tests in 93.847s
Jan 14 11:38:56 
Jan 14 11:38:56 FAILED (failures=1)
Jan 14 11:38:56 
Jan 14 11:38:56 Generating XML reports...

❄️ 2 failures tentatively classified as flaky

but reruns have not yet been triggered to confirm:

See CircleCI build pytorch_linux_xenial_cuda10_2_cudnn7_py3_gcc7_test2 (1/2)

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

Waiting for a VM assignment: ............................................................................................................................................................................................................................................................................................................
Build-agent version 1.0.50617-fbf8220b (2021-01-14T08:47:18+0000)
Creating a dedicated VM with ubuntu-1604:202007-01 image
Waiting for a VM assignment: ............................................................................................................................................................................................................................................................................................................

We timed out preparing a VM for this build, potentially due to our infrastructure or cloud provider.  Please retry the build in a few minutes

Unexpected capacity error: error caused by capacity

See CircleCI build pytorch_linux_xenial_cuda10_2_cudnn7_py3_jit_legacy_test (2/2)

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

Waiting for a VM assignment: ............................................................................................................................................................................................................................................................................................................
Build-agent version 1.0.50617-fbf8220b (2021-01-14T08:47:18+0000)
Creating a dedicated VM with ubuntu-1604:202007-01 image
Waiting for a VM assignment: ............................................................................................................................................................................................................................................................................................................

We timed out preparing a VM for this build, potentially due to our infrastructure or cloud provider.  Please retry the build in a few minutes

Unexpected capacity error: error caused by capacity


Extra GitHub checks: 1 failed


ci.pytorch.org: 1 failed


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.

@hwangdeyu hwangdeyu changed the title update reducesum opset 13 [ONNX] Update reducesum opset 13 Jan 14, 2021
@hwangdeyu hwangdeyu changed the title [ONNX] Update reducesum opset 13 [ONNX] Update Reducesum operator for opset 13 Jan 14, 2021
Copy link
Contributor

@neginraoof neginraoof left a comment

Choose a reason for hiding this comment

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

Is pending squeeze/unsqueeze PR.


block_listed_operators = ['embedding_bag']
block_listed_operators = ['']
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. If block_listed_operators is empty and not used, please remove this and lines 15-16.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, removed it. And also update the code in reducesum symbolics to use the helper function.

@@ -108,3 +111,102 @@ def unbind(g, self, dim=0, _outputs=None):
def glu(g, input, dim):
first, second = g.op('Split', input, dim, outputs=2)
return g.op('Mul', first, g.op('Sigmoid', second))


def _reduce_op_symbolic(onnx_op_name):
Copy link
Contributor

Choose a reason for hiding this comment

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

Changes for sum and embedding_bag look good. Thanks.

Copy link
Contributor

@neginraoof neginraoof 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.

@neginraoof neginraoof merged commit 2b845b8 into pytorch:onnx_ms_1 Jan 20, 2021
BowenBao added a commit that referenced this pull request Jan 21, 2021
* udpate symbolic for squeeze/unsqueeze

* update c++ unsqueeze/squeeze creation

* clang format

* enable tests

* clang format

* remove prints

* remove magic number

* add helper function

* fix build issue

* update opset9 symbolic with helper function

* fix utility test

* fix prim_fallthrough opset skip

* enable reducesum opset 13

* enable embedding_bag which contain reducesum op

* add ReduceSum helper

* remove block_listed_operators

* remove local test code

* remove embedding_bag() in opset13 file

* remove unuse import

Co-authored-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: hwangdeyu <deyhuang@qq.com>

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 21, 2021
* udpate symbolic for squeeze/unsqueeze

* update c++ unsqueeze/squeeze creation

* clang format

* enable tests

* clang format

* remove prints

* remove magic number

* add helper function

* fix build issue

* update opset9 symbolic with helper function

* fix utility test

* fix prim_fallthrough opset skip

* enable reducesum opset 13

* enable embedding_bag which contain reducesum op

* add ReduceSum helper

* remove block_listed_operators

* remove local test code

* remove embedding_bag() in opset13 file

* remove unuse import

Co-authored-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: hwangdeyu <deyhuang@qq.com>

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 22, 2021
* udpate symbolic for squeeze/unsqueeze

* update c++ unsqueeze/squeeze creation

* clang format

* enable tests

* clang format

* remove prints

* remove magic number

* add helper function

* fix build issue

* update opset9 symbolic with helper function

* fix utility test

* fix prim_fallthrough opset skip

* enable reducesum opset 13

* enable embedding_bag which contain reducesum op

* add ReduceSum helper

* remove block_listed_operators

* remove local test code

* remove embedding_bag() in opset13 file

* remove unuse import

Co-authored-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: hwangdeyu <deyhuang@qq.com>

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 22, 2021
* udpate symbolic for squeeze/unsqueeze

* update c++ unsqueeze/squeeze creation

* clang format

* enable tests

* clang format

* remove prints

* remove magic number

* add helper function

* fix build issue

* update opset9 symbolic with helper function

* fix utility test

* fix prim_fallthrough opset skip

* enable reducesum opset 13

* enable embedding_bag which contain reducesum op

* add ReduceSum helper

* remove block_listed_operators

* remove local test code

* remove embedding_bag() in opset13 file

* remove unuse import

Co-authored-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: hwangdeyu <deyhuang@qq.com>

Differential Revision: [D26023940](https://our.internmc.facebook.com/intern/diff/D26023940)

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 25, 2021
* udpate symbolic for squeeze/unsqueeze

* update c++ unsqueeze/squeeze creation

* clang format

* enable tests

* clang format

* remove prints

* remove magic number

* add helper function

* fix build issue

* update opset9 symbolic with helper function

* fix utility test

* fix prim_fallthrough opset skip

* enable reducesum opset 13

* enable embedding_bag which contain reducesum op

* add ReduceSum helper

* remove block_listed_operators

* remove local test code

* remove embedding_bag() in opset13 file

* remove unuse import

Co-authored-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: hwangdeyu <deyhuang@qq.com>

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 25, 2021
* udpate symbolic for squeeze/unsqueeze

* update c++ unsqueeze/squeeze creation

* clang format

* enable tests

* clang format

* remove prints

* remove magic number

* add helper function

* fix build issue

* update opset9 symbolic with helper function

* fix utility test

* fix prim_fallthrough opset skip

* enable reducesum opset 13

* enable embedding_bag which contain reducesum op

* add ReduceSum helper

* remove block_listed_operators

* remove local test code

* remove embedding_bag() in opset13 file

* remove unuse import

Co-authored-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: hwangdeyu <deyhuang@qq.com>

Differential Revision: [D26050888](https://our.internmc.facebook.com/intern/diff/D26050888)

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 26, 2021
* udpate symbolic for squeeze/unsqueeze

* update c++ unsqueeze/squeeze creation

* clang format

* enable tests

* clang format

* remove prints

* remove magic number

* add helper function

* fix build issue

* update opset9 symbolic with helper function

* fix utility test

* fix prim_fallthrough opset skip

* enable reducesum opset 13

* enable embedding_bag which contain reducesum op

* add ReduceSum helper

* remove block_listed_operators

* remove local test code

* remove embedding_bag() in opset13 file

* remove unuse import

Co-authored-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: hwangdeyu <deyhuang@qq.com>

Differential Revision: [D26050888](https://our.internmc.facebook.com/intern/diff/D26050888)

[ghstack-poisoned]
facebook-github-bot pushed a commit that referenced this pull request Jan 28, 2021
Summary:
Pull Request resolved: #50907

* udpate symbolic for squeeze/unsqueeze

* update c++ unsqueeze/squeeze creation

* clang format

* enable tests

* clang format

* remove prints

* remove magic number

* add helper function

* fix build issue

* update opset9 symbolic with helper function

* fix utility test

* fix prim_fallthrough opset skip

* enable reducesum opset 13

* enable embedding_bag which contain reducesum op

* add ReduceSum helper

* remove block_listed_operators

* remove local test code

* remove embedding_bag() in opset13 file

* remove unuse import

Test Plan: Imported from OSS

Reviewed By: pbelevich

Differential Revision: D26050888

Pulled By: SplitInfinity

fbshipit-source-id: 88307af6a7880abf94eac126ec1638e962de8c1f

Co-authored-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: hwangdeyu <deyhuang@qq.com>
BowenBao added a commit to BowenBao/pytorch that referenced this pull request Jan 28, 2021
* udpate symbolic for squeeze/unsqueeze

* update c++ unsqueeze/squeeze creation

* clang format

* enable tests

* clang format

* remove prints

* remove magic number

* add helper function

* fix build issue

* update opset9 symbolic with helper function

* fix utility test

* fix prim_fallthrough opset skip

* enable reducesum opset 13

* enable embedding_bag which contain reducesum op

* add ReduceSum helper

* remove block_listed_operators

* remove local test code

* remove embedding_bag() in opset13 file

* remove unuse import

Co-authored-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: hwangdeyu <deyhuang@qq.com>

ghstack-source-id: b85885bf9e6e504f0f4e265d2ed6bf4b7b1551ba
Pull Request resolved: pytorch#50907
@hwangdeyu hwangdeyu deleted the deyu/ReduceSum_op13 branch August 30, 2021 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed oncall: jit Add this issue/PR to JIT oncall triage queue open source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants