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 2018/11/09 01:14:36 UTC

[GitHub] nswamy commented on a change in pull request #12746: Add env flag to disable MKLDNN cache (MXNET_MKLDNN_CACHE_ENABLED)

nswamy commented on a change in pull request #12746: Add env flag to disable MKLDNN cache (MXNET_MKLDNN_CACHE_ENABLED)
URL: https://github.com/apache/incubator-mxnet/pull/12746#discussion_r232116958
 
 

 ##########
 File path: src/operator/nn/mkldnn/mkldnn_act.cc
 ##########
 @@ -135,24 +135,21 @@ static MKLDNNActForward &GetActForward(const ActivationParam& param,
                                        const OpContext &ctx, const NDArray &in_data,
                                        const mkldnn::memory &in_mem) {
 #if DMLC_CXX11_THREAD_LOCAL
-  static thread_local std::unordered_map<MKLDNNActSignature, MKLDNNActForward, OpHash> fwds;
+  static thread_local MKLDNNCache<MKLDNNActSignature, MKLDNNActForward, OpHash> fwds;
 
 Review comment:
   one of the reason why the memory usage is high could be because it maintains a cache for each thread? 
   I am wondering if the original authors measured contention and performance impact if we maintained one cache for the process? 
   I understand it *might* need some kind of locking, has someone explored non-blocking/lockfree data structures? 
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services