You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/12/11 19:19:09 UTC

[GitHub] [incubator-mxnet] waytrue17 opened a new pull request #19661: [v1.x] Support _contrib_interleaved_matmul_selfatt_valatt to ONNX

waytrue17 opened a new pull request #19661:
URL: https://github.com/apache/incubator-mxnet/pull/19661


   ## Description ##
   Support _contrib_interleaved_matmul_selfatt_valatt to ONNX
   
   ## Checklist ##
   ### Essentials ###
   - [ ] PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], [FEATURE], [DOC], etc)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage
   - [ ] Code is well-documented
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #19661: [v1.x] Support _contrib_interleaved_matmul_selfatt_valatt to ONNX

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #19661:
URL: https://github.com/apache/incubator-mxnet/pull/19661#issuecomment-743379717


   Hey @waytrue17 , Thanks for submitting the PR 
   All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands: 
   - To trigger all jobs: @mxnet-bot run ci [all] 
   - To trigger specific jobs: @mxnet-bot run ci [job1, job2] 
   *** 
   **CI supported jobs**: [website, miscellaneous, windows-gpu, windows-cpu, centos-gpu, clang, unix-gpu, unix-cpu, edge, centos-cpu, sanity]
   *** 
   _Note_: 
    Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin. 
   All CI tests must pass before the PR can be merged. 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] Zha0q1 commented on a change in pull request #19661: [WIP] Support _contrib_interleaved_matmul_selfatt_valatt to ONNX

Posted by GitBox <gi...@apache.org>.
Zha0q1 commented on a change in pull request #19661:
URL: https://github.com/apache/incubator-mxnet/pull/19661#discussion_r544037529



##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -53,6 +53,7 @@
 """
 
 import re
+import sys

Review comment:
       nit: we can probably remove this line now




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] Zha0q1 commented on a change in pull request #19661: [WIP] Support _contrib_interleaved_matmul_selfatt_valatt to ONNX

Posted by GitBox <gi...@apache.org>.
Zha0q1 commented on a change in pull request #19661:
URL: https://github.com/apache/incubator-mxnet/pull/19661#discussion_r543692213



##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -1656,16 +1657,15 @@ def convert_slice_axis(node, **kwargs):
     if not ends or ends == 'None':
         # ONNX doesn't support None for ends. Since ends=None depicts
         # length of dimension, passing dimension in this case.
-        in_shape = kwargs['in_shape'][0]
-        ends = in_shape[axes]
+        ends = sys.maxsize

Review comment:
       I rewrote conversion logic for slice_axis with the new onnx slice so you might need to rebase to my pr.
   https://github.com/apache/incubator-mxnet/pull/19677

##########
File path: tests/python-pytest/onnx/test_operators.py
##########
@@ -98,11 +98,14 @@ def test_onnx_export_arange_like(tmp_path, dtype):
 
 
 def test_onnx_export_layernorm(tmp_path):
-    M = def_model('LayerNorm', axis=1)
-    x = mx.nd.array([[1,3],[2,4]], dtype='float32')
-    gamma = mx.random.uniform(0, 1, x[0].shape, dtype='float32')
-    beta = mx.random.uniform(0, 1, x[0].shape, dtype='float32')
-    op_export_test('LayerNorm', M, [x, gamma, beta], tmp_path)
+    x = mx.nd.random.uniform(1, 2, (3, 4, 5), dtype=dtype)

Review comment:
       I think dtype is not defined?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] waytrue17 commented on a change in pull request #19661: [WIP] Support _contrib_interleaved_matmul_selfatt_valatt to ONNX

Posted by GitBox <gi...@apache.org>.
waytrue17 commented on a change in pull request #19661:
URL: https://github.com/apache/incubator-mxnet/pull/19661#discussion_r544511605



##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -53,6 +53,7 @@
 """
 
 import re
+import sys

Review comment:
       Removed it, thanks!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] waytrue17 commented on a change in pull request #19661: [WIP] Support _contrib_interleaved_matmul_selfatt_valatt to ONNX

Posted by GitBox <gi...@apache.org>.
waytrue17 commented on a change in pull request #19661:
URL: https://github.com/apache/incubator-mxnet/pull/19661#discussion_r543712296



##########
File path: tests/python-pytest/onnx/test_operators.py
##########
@@ -98,11 +98,14 @@ def test_onnx_export_arange_like(tmp_path, dtype):
 
 
 def test_onnx_export_layernorm(tmp_path):
-    M = def_model('LayerNorm', axis=1)
-    x = mx.nd.array([[1,3],[2,4]], dtype='float32')
-    gamma = mx.random.uniform(0, 1, x[0].shape, dtype='float32')
-    beta = mx.random.uniform(0, 1, x[0].shape, dtype='float32')
-    op_export_test('LayerNorm', M, [x, gamma, beta], tmp_path)
+    x = mx.nd.random.uniform(1, 2, (3, 4, 5), dtype=dtype)

Review comment:
       Added dtype, thanks for pointing it out




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] waytrue17 commented on a change in pull request #19661: [WIP] Support _contrib_interleaved_matmul_selfatt_valatt to ONNX

Posted by GitBox <gi...@apache.org>.
waytrue17 commented on a change in pull request #19661:
URL: https://github.com/apache/incubator-mxnet/pull/19661#discussion_r543711979



##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -1656,16 +1657,15 @@ def convert_slice_axis(node, **kwargs):
     if not ends or ends == 'None':
         # ONNX doesn't support None for ends. Since ends=None depicts
         # length of dimension, passing dimension in this case.
-        in_shape = kwargs['in_shape'][0]
-        ends = in_shape[axes]
+        ends = sys.maxsize

Review comment:
       I reverted this change so we can have it fixed from you PR




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] Zha0q1 merged pull request #19661: [WIP] ONNX _contrib_interleaved_matmul_selfatt_valatt and LayerNorm

Posted by GitBox <gi...@apache.org>.
Zha0q1 merged pull request #19661:
URL: https://github.com/apache/incubator-mxnet/pull/19661


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org