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 2022/01/10 14:55:37 UTC

[GitHub] [incubator-mxnet] bgawrych opened a new pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   ## Description ##
   Migration guide:
   ![image](https://user-images.githubusercontent.com/59644968/148786387-e9883fbb-918f-4e8c-af73-1771403d6c9f.png)
   
   
   
   Quantization API:
   ![image](https://user-images.githubusercontent.com/59644968/148786516-097c8be4-a977-4015-ba09-59bd3333fc36.png)
   
   
   


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] bgawrych commented on a change in pull request #20813: Add quantization API doc and oneDNN to migration guide

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



##########
File path: docs/python_docs/python/tutorials/getting-started/gluon_migration_guide.md
##########
@@ -432,6 +432,67 @@ A new module called `mxnet.gluon.probability` has been introduced in Gluon 2.0.
 
 3. [Transformation](https://github.com/apache/incubator-mxnet/tree/master/python/mxnet/gluon/probability/transformation): implement invertible transformation with computable log det jacobians.
 
+##  oneDNN Integration
+### Operator Fusion
+In versions 1.x of MXNet pattern fusion in execution graph was enabled by default when using MXNet built with oneDNN library support and could have been disabled by setting 'MXNET_SUBGRAPH_BACKEND' environment flag to `None`. MXNet 2.0 introduced changes in forward inference flow which led to refactor of fusion mechanism. To fuse model in MXNet 2.0 there are two requirements:
+
+ - the model must be defined as a subclass of HybridBlock or Symbol
+
+ - the model must have specific operator patterns which can be fused
+
+Both HybridBlock and Symbol classes provide API to easily run fusion of operators. All we have to do is to add single line of code running fusion passes on our model:

Review comment:
       ```suggestion
   Both HybridBlock and Symbol classes provide API to easily run fusion of operators. Adding only one line of code is needed to run fusion passes on model:
   ```




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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] bartekkuncer commented on a change in pull request #20813: Add quantization API doc and oneDNN to migration guide

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



##########
File path: docs/python_docs/python/tutorials/getting-started/gluon_migration_guide.md
##########
@@ -432,6 +432,67 @@ A new module called `mxnet.gluon.probability` has been introduced in Gluon 2.0.
 
 3. [Transformation](https://github.com/apache/incubator-mxnet/tree/master/python/mxnet/gluon/probability/transformation): implement invertible transformation with computable log det jacobians.
 
+##  oneDNN Integration
+### Operator Fusion
+In versions 1.x of MXNet pattern fusion in execution graph was enabled by default when using MXNet built with oneDNN library support and could have been disabled by setting 'MXNET_SUBGRAPH_BACKEND' environment flag to `None`. MXNet 2.0 introduced changes in forward inference flow which led to refactor of fusion mechanism. To fuse model in MXNet 2.0 there are two requirements:
+
+ - the model must be defined as a subclass of HybridBlock or Symbol
+
+ - the model must have specific operator patterns which can be fused

Review comment:
       ```suggestion
    - the model must have specific operator patterns which can be fused.
   ```

##########
File path: docs/python_docs/python/tutorials/getting-started/gluon_migration_guide.md
##########
@@ -432,6 +432,67 @@ A new module called `mxnet.gluon.probability` has been introduced in Gluon 2.0.
 
 3. [Transformation](https://github.com/apache/incubator-mxnet/tree/master/python/mxnet/gluon/probability/transformation): implement invertible transformation with computable log det jacobians.
 
+##  oneDNN Integration
+### Operator Fusion
+In versions 1.x of MXNet pattern fusion in execution graph was enabled by default when using MXNet built with oneDNN library support and could have been disabled by setting 'MXNET_SUBGRAPH_BACKEND' environment flag to `None`. MXNet 2.0 introduced changes in forward inference flow which led to refactor of fusion mechanism. To fuse model in MXNet 2.0 there are two requirements:
+
+ - the model must be defined as a subclass of HybridBlock or Symbol
+
+ - the model must have specific operator patterns which can be fused
+
+Both HybridBlock and Symbol classes provide API to easily run fusion of operators. All we have to do is to add single line of code running fusion passes on our model:

Review comment:
       Only sentence written in first person.

##########
File path: python/mxnet/contrib/quantization.py
##########
@@ -174,15 +174,16 @@ def __init__(self):
     def collect(self, name, op_name, arr):
         """Function which is registered to Block as monitor callback. Names of layers
         requiring calibration are stored in `self.include_layers` variable.
-            Parameters
-            ----------
-            name : str
-                Node name from which collected data comes from
-            op_name : str
-                Operator name from which collected data comes from. Single operator
-                can have multiple inputs/ouputs nodes - each should have different name
-            arr : NDArray
-                NDArray containing data of monitored node
+
+        Parameters
+        ----------
+        name : str
+            Node name from which collected data comes from
+        op_name : str
+            Operator name from which collected data comes from. Single operator
+            can have multiple inputs/ouputs nodes - each should have different name

Review comment:
       ```suggestion
               can have multiple input/ouput nodes - each should have different name.
   ```
   

##########
File path: python/mxnet/contrib/quantization.py
##########
@@ -174,15 +174,16 @@ def __init__(self):
     def collect(self, name, op_name, arr):
         """Function which is registered to Block as monitor callback. Names of layers
         requiring calibration are stored in `self.include_layers` variable.
-            Parameters
-            ----------
-            name : str
-                Node name from which collected data comes from
-            op_name : str
-                Operator name from which collected data comes from. Single operator
-                can have multiple inputs/ouputs nodes - each should have different name
-            arr : NDArray
-                NDArray containing data of monitored node
+
+        Parameters
+        ----------
+        name : str
+            Node name from which collected data comes from

Review comment:
       ```suggestion
               Node name from which collected data comes from.
   ```

##########
File path: python/mxnet/contrib/quantization.py
##########
@@ -174,15 +174,16 @@ def __init__(self):
     def collect(self, name, op_name, arr):
         """Function which is registered to Block as monitor callback. Names of layers
         requiring calibration are stored in `self.include_layers` variable.
-            Parameters
-            ----------
-            name : str
-                Node name from which collected data comes from
-            op_name : str
-                Operator name from which collected data comes from. Single operator
-                can have multiple inputs/ouputs nodes - each should have different name
-            arr : NDArray
-                NDArray containing data of monitored node
+
+        Parameters
+        ----------
+        name : str
+            Node name from which collected data comes from
+        op_name : str
+            Operator name from which collected data comes from. Single operator
+            can have multiple inputs/ouputs nodes - each should have different name
+        arr : NDArray
+            NDArray containing data of monitored node

Review comment:
       ```suggestion
               NDArray containing data of monitored node.
   ```

##########
File path: docs/python_docs/python/tutorials/getting-started/gluon_migration_guide.md
##########
@@ -432,6 +432,67 @@ A new module called `mxnet.gluon.probability` has been introduced in Gluon 2.0.
 
 3. [Transformation](https://github.com/apache/incubator-mxnet/tree/master/python/mxnet/gluon/probability/transformation): implement invertible transformation with computable log det jacobians.
 
+##  oneDNN Integration
+### Operator Fusion
+In versions 1.x of MXNet pattern fusion in execution graph was enabled by default when using MXNet built with oneDNN library support and could have been disabled by setting 'MXNET_SUBGRAPH_BACKEND' environment flag to `None`. MXNet 2.0 introduced changes in forward inference flow which led to refactor of fusion mechanism. To fuse model in MXNet 2.0 there are two requirements:
+
+ - the model must be defined as a subclass of HybridBlock or Symbol

Review comment:
       ```suggestion
    - the model must be defined as a subclass of HybridBlock or Symbol,
   ```




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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   Jenkins CI successfully triggered : [unix-cpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] bgawrych commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   @mxnet-bot run ci [windows-gpu, unix-cpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] bgawrych commented on a change in pull request #20813: Add quantization API doc and oneDNN to migration guide

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



##########
File path: docs/python_docs/python/tutorials/getting-started/gluon_migration_guide.md
##########
@@ -432,6 +432,67 @@ A new module called `mxnet.gluon.probability` has been introduced in Gluon 2.0.
 
 3. [Transformation](https://github.com/apache/incubator-mxnet/tree/master/python/mxnet/gluon/probability/transformation): implement invertible transformation with computable log det jacobians.
 
+##  oneDNN Integration
+### Operator Fusion
+In versions 1.x of MXNet pattern fusion in execution graph was enabled by default when using MXNet built with oneDNN library support and could have been disabled by setting 'MXNET_SUBGRAPH_BACKEND' environment flag to `None`. MXNet 2.0 introduced changes in forward inference flow which led to refactor of fusion mechanism. To fuse model in MXNet 2.0 there are two requirements:
+
+ - the model must be defined as a subclass of HybridBlock or Symbol
+
+ - the model must have specific operator patterns which can be fused
+
+Both HybridBlock and Symbol classes provide API to easily run fusion of operators. All we have to do is to add single line of code running fusion passes on our model:

Review comment:
       ```suggestion
   Both HybridBlock and Symbol classes provide API to easily run fusion of operators. Adding only single line of code is needed to run fusion passes on model:
   ```




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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] bgawrych commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   @mxnet-bot run ci [unix-cpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   Hey @bgawrych , 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, edge, unix-gpu, centos-cpu, miscellaneous, unix-cpu, clang, sanity, windows-gpu, windows-cpu, centos-gpu]
   *** 
   _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.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   Jenkins CI successfully triggered : [unix-cpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] bgawrych commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   @mxnet-bot run ci [windows-gpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   Jenkins CI successfully triggered : [windows-gpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] bgawrych commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   @mxnet-bot run ci [windows-gpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] bgawrych commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   @mxnet-bot run ci [unix-cpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] szha merged pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   Jenkins CI successfully triggered : [windows-gpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   Jenkins CI successfully triggered : [unix-cpu, windows-gpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   Jenkins CI successfully triggered : [windows-gpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] bgawrych commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   @mxnet-bot run ci [windows-gpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   Jenkins CI successfully triggered : [windows-gpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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



[GitHub] [incubator-mxnet] bgawrych commented on pull request #20813: Add quantization API doc and oneDNN to migration guide

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


   @mxnet-bot run ci [windows-gpu]


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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

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