From 35ac049ac748aff0f0412c1c5081d55efe6e68d6 Mon Sep 17 00:00:00 2001 From: Bartosz Kuncer Date: Mon, 25 Oct 2021 15:27:25 +0200 Subject: [PATCH 1/3] Make warning message when oneDNN is turned off less confusing Co-authored-by: Anna, Karbownik --- src/common/utils.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/common/utils.h b/src/common/utils.h index c62fafab10a3..76fbe0857708 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -503,20 +503,24 @@ inline void LogStorageFallback(const nnvm::NodeAttrs& attrs, const std::string op_str = operator_stype_string(attrs, dev_mask, *in_attrs, *out_attrs); std::ostringstream os; const char* warning = - "\nThe operator with default storage type will be dispatched " - "for execution. You're seeing this warning message because the operator above is unable " - "to process the given ndarrays with specified storage types, context and parameter. " - "Temporary dense ndarrays are generated in order to execute the operator. " - "This does not affect the correctness of the programme. " - "You can set environment variable MXNET_STORAGE_FALLBACK_LOG_VERBOSE to " + "\n WARNING:\n" + " Execution of the operator above will fallback to the generic implementation " +#if MXNET_USE_ONEDNN == 1 + "(not utilizing kernels from oneDNN library) " +#endif + "with default dense storage type. You are seeing this warning message because " +#if MXNET_USE_ONEDNN == 1 + "MXNET_ONEDNN_ENABLED flag is set to 0, in which case you can re-enable the default execution path by setting MXNET_ONEDNN_ENABLED back to 1, or " +#endif + "the operator above is unable to process the given ndarrays with specified storage types, context and/or parameter " + ", in which case temporary dense ndarrays are generated in order to execute the operator. " + "The fallback does not affect the correctness of the programme. " + "Using default storage type performance degradation might be observed. " + "\nYou can set environment variable MXNET_STORAGE_FALLBACK_LOG_VERBOSE to " "0 to suppress this warning."; os << "\nStorage type fallback detected:\n" << op_str << warning; LogOnce(os.str()); #if MXNET_USE_ONEDNN == 1 - if (!DNNLEnvSet()) - common::LogOnce( - "MXNET_ONEDNN_ENABLED flag is off. " - "You can re-enable by setting MXNET_ONEDNN_ENABLED=1"); if (GetDNNLCacheSize() != -1) common::LogOnce( "MXNET_ONEDNN_CACHE_NUM is set." From ba7401717747cf1ee6ae98927a00dad57fa3445d Mon Sep 17 00:00:00 2001 From: Bartosz Kuncer Date: Mon, 25 Oct 2021 15:31:40 +0200 Subject: [PATCH 2/3] Apply clang-format --- src/common/utils.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/utils.h b/src/common/utils.h index 76fbe0857708..537b3e7cc31c 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -510,14 +510,14 @@ inline void LogStorageFallback(const nnvm::NodeAttrs& attrs, #endif "with default dense storage type. You are seeing this warning message because " #if MXNET_USE_ONEDNN == 1 - "MXNET_ONEDNN_ENABLED flag is set to 0, in which case you can re-enable the default execution path by setting MXNET_ONEDNN_ENABLED back to 1, or " + "MXNET_ONEDNN_ENABLED flag is set to 0, in which case you can re-enable the default " + "execution path by setting MXNET_ONEDNN_ENABLED back to 1, or " #endif - "the operator above is unable to process the given ndarrays with specified storage types, context and/or parameter " - ", in which case temporary dense ndarrays are generated in order to execute the operator. " - "The fallback does not affect the correctness of the programme. " - "Using default storage type performance degradation might be observed. " - "\nYou can set environment variable MXNET_STORAGE_FALLBACK_LOG_VERBOSE to " - "0 to suppress this warning."; + "the operator above is unable to process the given ndarrays with specified storage types, " + "context and/or parameter, in which case temporary dense ndarrays are generated in order to " + "execute the operator. The fallback does not affect the correctness of the programme. Using " + "default storage type performance degradation might be observed. \nYou can set environment " + "variable MXNET_STORAGE_FALLBACK_LOG_VERBOSE to 0 to suppress this warning."; os << "\nStorage type fallback detected:\n" << op_str << warning; LogOnce(os.str()); #if MXNET_USE_ONEDNN == 1 From 0f832f0d253f549f77784926c53724d739a2593f Mon Sep 17 00:00:00 2001 From: bartekkuncer Date: Tue, 26 Oct 2021 10:43:13 +0200 Subject: [PATCH 3/3] Update utils.h --- src/common/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/utils.h b/src/common/utils.h index 537b3e7cc31c..15e676c816c9 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -504,7 +504,7 @@ inline void LogStorageFallback(const nnvm::NodeAttrs& attrs, std::ostringstream os; const char* warning = "\n WARNING:\n" - " Execution of the operator above will fallback to the generic implementation " + "Execution of the operator above will fallback to the generic implementation " #if MXNET_USE_ONEDNN == 1 "(not utilizing kernels from oneDNN library) " #endif