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/03/21 21:49:40 UTC

[GitHub] [incubator-mxnet] bartekkuncer opened a new pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   ## Description ##
   Integrate oneDNN eltwise_tanh into _npi_tanh operator to improve its performance.
   
   ## Performance ##
   Without dnnl:
   ![image](https://user-images.githubusercontent.com/59650839/159368913-9296fabb-d64f-48b0-bb32-0e1577735714.png)
   
   With dnnl:
   ![image](https://user-images.githubusercontent.com/59650839/159368997-3a826089-46e1-4b4b-a5eb-4fb486736e55.png)
   
   As it is visible from the screen shots, performance has improved over 10 times. Above benchmarks have been performed on a machine with Intel(R) Core(TM) i9-9940X CPU @ 3.30GHz processor. 


-- 
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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


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


-- 
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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   Jenkins CI successfully triggered : [unix-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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   Jenkins CI successfully triggered : [unix-gpu, website, centos-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] bartekkuncer commented on pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   @mxnet-bot run ci [centos-gpu, unix-gpu, unix-cpu, website, 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] bartekkuncer commented on pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   @mxnet-bot run ci [centos-gpu, unix-gpu, website]


-- 
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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   Jenkins CI successfully triggered : [unix-gpu, centos-gpu, website]


-- 
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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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






-- 
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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   Jenkins CI successfully triggered : [centos-gpu, unix-gpu, website]


-- 
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 pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


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


-- 
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 pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   @mxnet-bot run ci [unix-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] bartekkuncer commented on pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


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


-- 
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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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



##########
File path: src/operator/nn/dnnl/dnnl_tanh.cc
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*!
+ * \file dnnl_tanh.cc
+ */
+
+#if MXNET_USE_ONEDNN == 1
+
+#include "dnnl_tanh-inl.h"
+
+namespace mxnet {
+namespace op {
+
+bool SupportDNNLTanh(const NDArray& input, const NDArray& output) {
+  auto commonChecks = [](const NDArray& tensor) {
+    return tensor.shape().ndim() > 0 && tensor.shape().ndim() <= 12 && tensor.shape().Size() > 0 &&
+           SupportStorageDNNL(tensor.storage_type());
+  };
+  const bool inputIsOK = IsDNNLType(input.dtype()) && commonChecks(input);

Review comment:
       Good catch, 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.

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 pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   @mxnet-bot run ci [centos-gpu, unix-gpu, website]


-- 
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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


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


-- 
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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   Jenkins CI successfully triggered : [unix-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] bartekkuncer commented on pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   @mxnet-bot run ci [unix-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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   Jenkins CI successfully triggered : [unix-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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   Jenkins CI successfully triggered : [unix-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] bartekkuncer commented on pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   @mxnet-bot run ci [unix-gpu, centos-gpu, website]


-- 
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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   Hey @bartekkuncer , 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**: [edge, sanity, unix-cpu, website, windows-cpu, centos-gpu, windows-gpu, unix-gpu, miscellaneous, centos-cpu, clang]
   *** 
   _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 #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   Jenkins CI successfully triggered : [unix-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] bartekkuncer commented on pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   @mxnet-bot run ci [unix-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 a change in pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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



##########
File path: src/operator/nn/dnnl/dnnl_tanh.cc
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*!
+ * \file dnnl_tanh.cc
+ */
+
+#if MXNET_USE_ONEDNN == 1
+
+#include "dnnl_tanh-inl.h"
+
+namespace mxnet {
+namespace op {
+
+bool SupportDNNLTanh(const NDArray& input, const NDArray& output) {
+  auto commonChecks = [](const NDArray& tensor) {
+    return tensor.shape().ndim() > 0 && tensor.shape().ndim() <= 12 && tensor.shape().Size() > 0 &&
+           SupportStorageDNNL(tensor.storage_type());
+  };
+  const bool inputIsOK = IsDNNLType(input.dtype()) && commonChecks(input);

Review comment:
       why input can't be int32?




-- 
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 closed pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

Posted by GitBox <gi...@apache.org>.
bgawrych closed pull request #20972:
URL: https://github.com/apache/incubator-mxnet/pull/20972


   


-- 
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 pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


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


-- 
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 pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   @mxnet-bot run ci [unix-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] bartekkuncer commented on pull request #20972: [operator] Integrate oneDNN eltwise_tanh into _npi_tanh operator

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


   @mxnet-bot run ci [unix-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