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/05/27 23:06:23 UTC

[GitHub] [incubator-mxnet] DominikaJedynak opened a new pull request, #21043: [master] Fix for fc with sum when types are incompatible

DominikaJedynak opened a new pull request, #21043:
URL: https://github.com/apache/incubator-mxnet/pull/21043

   ## Description ##
   Change analogous to https://github.com/apache/incubator-mxnet/pull/21042 for v1.x.
   
   This PR fixes the problem occurring when data_2, which is to be added to quantized fc output, happens to be all non-negative (and treated as u8) while fc output is s8. In this situation, data_2 will be rescaled to s8 as well to prevent truncation of fc output.
   This change also prevents the situation when fc output is u8 and data_2 is s8.
   


-- 
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] anko-intel commented on a diff in pull request #21043: [master] Fix for fc with sum when types are incompatible

Posted by GitBox <gi...@apache.org>.
anko-intel commented on code in PR #21043:
URL: https://github.com/apache/incubator-mxnet/pull/21043#discussion_r905001518


##########
src/operator/subgraph/dnnl/dnnl_fc.cc:
##########
@@ -152,6 +153,26 @@ void SgDNNLFCOp::Forward(const OpContext& ctx,
             dnnl::reorder(*in_dnnl_mem, *tmp_mem),
             {{DNNL_ARG_FROM, *in_dnnl_mem}, {DNNL_ARG_TO, *tmp_mem}});
         output = NDArray(tmp_mem);
+      } else if (in_data[idx.sum].dtype() == mshadow::kUint8 &&
+                 out_data[out_index].dtype() == mshadow::kInt8) {
+        auto sum_mem_desc           = in_dnnl_mem->get_desc();
+        auto out_dtype              = get_dnnl_type(mshadow::kInt8);
+        sum_mem_desc.data.data_type = static_cast<dnnl_data_type_t>(out_dtype);
+        dnnl_mem_ptr tmp_mem(new dnnl::memory(
+            sum_mem_desc, CpuEngine::Get()->get_engine(), out_dnnl_mem->get_data_handle()));
+        DNNLStream::Get()->RegisterMem(tmp_mem);
+        const float u8_reorder_scale     = 0.5;

Review Comment:
   You can define 0.5 as const or macro in this file and use it in both places - to make it clear for the reader



-- 
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 #21043: [master] Fix for fc with sum when types are incompatible

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

   Jenkins CI successfully triggered : [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] mxnet-bot commented on pull request #21043: [master] Fix for fc with sum when types are incompatible

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

   Jenkins CI successfully triggered : [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] DominikaJedynak commented on pull request #21043: [master] Fix for fc with sum when types are incompatible

Posted by GitBox <gi...@apache.org>.
DominikaJedynak commented on PR #21043:
URL: https://github.com/apache/incubator-mxnet/pull/21043#issuecomment-1158741935

   @mxnet-bot run ci [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] mxnet-bot commented on pull request #21043: [master] Fix for fc with sum when types are incompatible

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

   Jenkins CI successfully triggered : [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] DominikaJedynak commented on pull request #21043: [master] Fix for fc with sum when types are incompatible

Posted by GitBox <gi...@apache.org>.
DominikaJedynak commented on PR #21043:
URL: https://github.com/apache/incubator-mxnet/pull/21043#issuecomment-1162728813

   @mxnet-bot run ci [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] DominikaJedynak commented on pull request #21043: [master] Fix for fc with sum when types are incompatible

Posted by GitBox <gi...@apache.org>.
DominikaJedynak commented on PR #21043:
URL: https://github.com/apache/incubator-mxnet/pull/21043#issuecomment-1161966458

   @mxnet-bot run ci [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] mxnet-bot commented on pull request #21043: [master] Fix for fc with sum when types are incompatible

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

   Hey @DominikaJedynak , 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**: [unix-cpu, unix-gpu, centos-gpu, clang, miscellaneous, centos-cpu, windows-gpu, website, windows-cpu, edge, 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.

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 merged pull request #21043: [master] Fix for fc with sum when types are incompatible

Posted by GitBox <gi...@apache.org>.
bgawrych merged PR #21043:
URL: https://github.com/apache/incubator-mxnet/pull/21043


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