Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

MKLDNN can be turned off with env var #12058

Merged
merged 9 commits into from
Aug 17, 2018

Conversation

azai91
Copy link
Contributor

@azai91 azai91 commented Aug 7, 2018

Description

MKLDNN can be turned off with USE_MKLDNN env flag

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • add fallback logic in storagetype to fallback if USE_MKLDNN var set

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@azai91
Copy link
Contributor Author

azai91 commented Aug 7, 2018

python example/image-classification/benchmark_score.py
INFO:root:batch size  1, dtype float32, images/sec: 18.603268
INFO:root:batch size  2, dtype float32, images/sec: 28.085829
INFO:root:batch size  4, dtype float32, images/sec: 40.856433
INFO:root:batch size  8, dtype float32, images/sec: 47.194993
INFO:root:batch size 16, dtype float32, images/sec: 50.532706
INFO:root:batch size 32, dtype float32, images/sec: 51.747587
USE_MKLDNN=0 python example/image-classification/benchmark_score.py
INFO:root:batch size  1, dtype float32, images/sec: 5.174663
INFO:root:batch size  2, dtype float32, images/sec: 5.668587
INFO:root:batch size  4, dtype float32, images/sec: 5.831225
INFO:root:batch size  8, dtype float32, images/sec: 5.870498
INFO:root:batch size 16, dtype float32, images/sec: 5.856749
INFO:root:batch size 32, dtype float32, images/sec: 5.871009

if (dev_mask == mshadow::cpu::kDevMask
if (!MKLDNNEnvSet()) {
*dispatch_mode = DispatchMode::kFComputeFallback;
} else if (dev_mask == mshadow::cpu::kDevMask
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also align the 2 lines below with this one.

@pengzhao-intel
Copy link
Contributor

@TaoLv @ZhennanQin

@TaoLv
Copy link
Member

TaoLv commented Aug 8, 2018

Maybe the env variable should start with MXNET_, like what we did for other MXNet env variables. Please also add document for it in this page: https://mxnet.incubator.apache.org/faq/env_var.html

Another question, what's the behavior of enabling this variable when MKL-DNN is not compiled into MXNet? Should we give a proper warning or tip for that?

@@ -137,6 +137,10 @@ static inline bool SupportMKLDNN(const NDArray &input) {
&& SupportStorageMKLDNN(input.storage_type());
}

static inline bool MKLDNNEnvSet() {
return dmlc::GetEnv("USE_MKLDNN", true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you're setting the default to be true, would you please also add corresponding documentation for this env var on the webpage so that we're not causing surprise for users?

Copy link
Contributor

@ZhennanQin ZhennanQin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we assume mkldnn is the only backend for kFComputeEx on cpu, shouldn't we make the change inside the caller of InferStorageType? Then we don't need to change it in every ops.

@@ -116,6 +116,10 @@ inline static bool ActivationStorageType(const nnvm::NodeAttrs& attrs,
if (dev_mask == mshadow::cpu::kDevMask && SupportMKLDNNAct(param)) {
*dispatch_mode = DispatchMode::kFComputeEx;
}
if (!MKLDNNEnvSet()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to check (dev_mask == mshadow::cpu::kDevMask) here?

Copy link
Contributor

@lupesko lupesko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Some notes:

  • I suggest we align the env var name with the conventional prefix "MXNET_"
  • As part of the PR, please also update env_var.md where all env vars are documented.

@@ -158,6 +162,10 @@ inline static bool BackwardActStorageType(const nnvm::NodeAttrs& attrs,
if (dev_mask == mshadow::cpu::kDevMask && SupportMKLDNNAct(param)) {
*dispatch_mode = DispatchMode::kFComputeEx;
}
if (!MKLDNNEnvSet()) {
*dispatch_mode = DispatchMode::kFComputeFallback;
return ret;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this return statement redundant due to the statement in line 170?

@azai91 azai91 requested a review from szha as a code owner August 8, 2018 19:39
@azai91
Copy link
Contributor Author

azai91 commented Aug 8, 2018

@ZhennanQin there are some fcomputeex ops that are not mkldnn (customop is one example). something I did in another PR (#12019) was set an attr on all MKLDNN operators. if we wait for that merge we could then check if the operator is mkldnn and if the flag is set and fallback before calling inferstorage type.

@nswamy nswamy added MKLDNN pr-awaiting-review PR is waiting for code review labels Aug 9, 2018
@azai91
Copy link
Contributor Author

azai91 commented Aug 14, 2018

@pengzhao-intel review / approve please

@pengzhao-intel
Copy link
Contributor

Looks good.

One tip: Could we add an info message to let the user know the MKLDNN is disabled now by "MXNET_MKLDNN_ENABLED=0" and it can be switched on with env setting again?

I afraid the user will forget this env setting in some bash file and then can't get the correct performance.

@azai91
Copy link
Contributor Author

azai91 commented Aug 15, 2018

No problem. Do you know the best place to put that info? I asked around last week and there doesn't seem to be a consensus.

@pengzhao-intel
Copy link
Contributor

I look into the code. The message should be in the top level of OP but seem no proper place now.
So, how about waiting the #12019 is merged and then we only need to change InferStorageType where we can write the message too?

@pengzhao-intel
Copy link
Contributor

Looks fine now even the fallback log is appeared many times :)
The good thing is the user would not miss this important info.

[patric@mlt-skx084 image-classification]$ export MXNET_MKLDNN_ENABLED=0
[patric@mlt-skx084 image-classification]$ python benchmark_score.py
/home/patric/.local/lib/python2.7/site-packages/h5py/__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
INFO:root:network: alexnet
INFO:root:device: cpu(0)
/home/patric/develop/mxnet-mkldnn-env/python/mxnet/module/base_module.py:66: UserWarning: Data provided by label_shapes don't match names specified by label_names ([] vs. ['softmax_label'])
  warnings.warn(msg)
[23:26:40] src/executor/../operator/../common/utils.h:447:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, default, ]
output storage types = [default, ]
params = {"num_filter" : 96, "stride" : (4, 4), "kernel" : (11, 11), }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:26:40] src/executor/../operator/../common/utils.h:447:
Storage type fallback detected:
operator = Activation
input storage types = [default, ]
output storage types = [default, ]
params = {"act_type" : relu, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:26:40] src/executor/../operator/../common/utils.h:447:
Storage type fallback detected:
operator = LRN
input storage types = [default, ]
output storage types = [default, default, ]
params = {"knorm" : 2, "beta" : 0.75, "nsize" : 5, "alpha" : 0.0001, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:26:40] src/executor/../operator/../common/utils.h:447:
Storage type fallback detected:
operator = Pooling
input storage types = [default, ]
output storage types = [default, default, ]
params = {"stride" : (2, 2), "pool_type" : max, "kernel" : (3, 3), }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:26:40] src/executor/../operator/../common/utils.h:447:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, default, ]
output storage types = [default, ]
params = {"num_filter" : 256, "pad" : (2, 2), "kernel" : (5, 5), }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:26:40] src/executor/../operator/../common/utils.h:447:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, default, ]
output storage types = [default, ]
params = {"num_filter" : 384, "pad" : (1, 1), "kernel" : (3, 3), }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:26:40] src/executor/../operator/../common/utils.h:447:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, default, ]
output storage types = [default, ]
params = {"num_filter" : 256, "pad" : (1, 1), "kernel" : (3, 3), }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:26:40] src/executor/../operator/../common/utils.h:447:
Storage type fallback detected:
operator = FullyConnected
input storage types = [default, default, default, ]
output storage types = [default, ]
params = {"num_hidden" : 4096, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:26:40] src/executor/../operator/../common/utils.h:447:
Storage type fallback detected:
operator = FullyConnected
input storage types = [default, default, default, ]
output storage types = [default, ]
params = {"num_hidden" : 1000, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:26:40] src/executor/../common/utils.h:447: MXNET_MKLDNN_ENABLED flag is off. You can re-enable by setting MXNET_MKLDNN_ENABLED=1
INFO:root:batch size  1, dtype float32, images/sec: 82.074852
INFO:root:batch size  2, dtype float32, images/sec: 79.050781
INFO:root:batch size  4, dtype float32, images/sec: 96.430868
INFO:root:batch size  8, dtype float32, images/sec: 110.427058
INFO:root:batch size 16, dtype float32, images/sec: 117.611687
INFO:root:batch size 32, dtype float32, images/sec: 114.142417

"You can re-enable by setting MXNET_MKLDNN_ENABLED=1");
#endif


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This warning only gets printed for symbolic. What about imperative/Gluon?

@@ -137,6 +137,10 @@ static inline bool SupportMKLDNN(const NDArray &input) {
&& SupportStorageMKLDNN(input.storage_type());
}

static inline bool MKLDNNEnvSet() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we declare a static var so the linear time env lookup only happen once ?

@azai91 azai91 force-pushed the fix/mkldnn-env-flag branch 2 times, most recently from 3bc949f to e4bda35 Compare August 15, 2018 22:58
@azai91
Copy link
Contributor Author

azai91 commented Aug 15, 2018

ubuntu@ip-172-31-11-93:~/incubator-mxnet-2/example/image-classification$ python benchmark_score.py
Assertion failure at kmp_runtime.cpp(2582): __kmp_init_serial.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(2582).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.
Assertion failure at kmp_runtime.cpp(2582): __kmp_init_serial.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(2582).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.
Assertion failure at kmp_runtime.cpp(2582): __kmp_init_serial.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(2582).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.
Assertion failure at kmp_runtime.cpp(2582): __kmp_init_serial.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(2582).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.
Assertion failure at kmp_runtime.cpp(2582): __kmp_init_serial.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(2582).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.
Assertion failure at kmp_runtime.cpp(2582): __kmp_init_serial.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(2582).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.
INFO:root:network: resnet-50
INFO:root:device: cpu(0)
/home/ubuntu/incubator-mxnet-2/python/mxnet/module/base_module.py:66: UserWarning: Data provided by label_shapes don't match names specified by label_names ([] vs. ['softmax_label'])
  warnings.warn(msg)
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = BatchNorm
input storage types = [default, default, default, default, default, ]
output storage types = [default, default, default, ]
params = {"fix_gamma" : True, "momentum" : 0.9, "eps" : 2e-05, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450: MXNET_MKLDNN_ENABLED flag is off. You can re-enable by setting MXNET_MKLDNN_ENABLED=1
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (7, 7), "stride" : (2, 2), "pad" : (3, 3), "num_filter" : 64, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = BatchNorm
input storage types = [default, default, default, default, default, ]
output storage types = [default, default, default, ]
params = {"fix_gamma" : False, "momentum" : 0.9, "eps" : 2e-05, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Activation
input storage types = [default, ]
output storage types = [default, ]
params = {"act_type" : relu, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Pooling
input storage types = [default, ]
output storage types = [default, default, ]
params = {"pad" : (1, 1), "stride" : (2, 2), "pool_type" : max, "kernel" : (3, 3), }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (1, 1), "stride" : (1, 1), "pad" : (0, 0), "num_filter" : 64, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (3, 3), "stride" : (1, 1), "pad" : (1, 1), "num_filter" : 64, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (1, 1), "stride" : (1, 1), "pad" : (0, 0), "num_filter" : 256, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"no_bias" : True, "kernel" : (1, 1), "workspace" : 256, "stride" : (1, 1), "num_filter" : 256, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = elemwise_add
input storage types = [default, default, ]
output storage types = [default, ]
params = {}
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (1, 1), "stride" : (1, 1), "pad" : (0, 0), "num_filter" : 128, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (3, 3), "stride" : (2, 2), "pad" : (1, 1), "num_filter" : 128, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (1, 1), "stride" : (1, 1), "pad" : (0, 0), "num_filter" : 512, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"no_bias" : True, "kernel" : (1, 1), "workspace" : 256, "stride" : (2, 2), "num_filter" : 512, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (3, 3), "stride" : (1, 1), "pad" : (1, 1), "num_filter" : 128, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (3, 3), "stride" : (2, 2), "pad" : (1, 1), "num_filter" : 256, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (1, 1), "stride" : (1, 1), "pad" : (0, 0), "num_filter" : 1024, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"no_bias" : True, "kernel" : (1, 1), "workspace" : 256, "stride" : (2, 2), "num_filter" : 1024, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (3, 3), "stride" : (1, 1), "pad" : (1, 1), "num_filter" : 256, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (3, 3), "stride" : (2, 2), "pad" : (1, 1), "num_filter" : 512, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (1, 1), "stride" : (1, 1), "pad" : (0, 0), "num_filter" : 2048, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"no_bias" : True, "kernel" : (1, 1), "workspace" : 256, "stride" : (2, 2), "num_filter" : 2048, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Convolution
input storage types = [default, default, ]
output storage types = [default, ]
params = {"workspace" : 256, "no_bias" : True, "kernel" : (3, 3), "stride" : (1, 1), "pad" : (1, 1), "num_filter" : 512, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = Pooling
input storage types = [default, ]
output storage types = [default, ]
params = {"global_pool" : True, "pool_type" : avg, "kernel" : (7, 7), }
context.dev_mask = cpu
The 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 0 to suppress this warning.
[23:16:54] ../src/executor/../operator/../common/utils.h:450:
Storage type fallback detected:
operator = FullyConnected
input storage types = [default, default, default, ]
output storage types = [default, ]
params = {"num_hidden" : 1000, }
context.dev_mask = cpu
The 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 0 to suppress this warning.
INFO:root:batch size  1, dtype float32, images/sec: 5.386060
INFO:root:batch size  2, dtype float32, images/sec: 5.743624
INFO:root:batch size  4, dtype float32, images/sec: 5.823662
INFO:root:batch size  8, dtype float32, images/sec: 5.858996
INFO:root:batch size 16, dtype float32, images/sec: 5.866382
INFO:root:batch size 32, dtype float32, images/sec: 5.865309

@azai91
Copy link
Contributor Author

azai91 commented Aug 15, 2018

moved the log into the fallback code so it should work for gluon / imperative as well. that being said, we should probably clean up the logs in a future cause it's becoming messy.

@azai91
Copy link
Contributor Author

azai91 commented Aug 15, 2018

@eric-haibin-lin <3

@anirudh2290 anirudh2290 merged commit 6843914 into apache:master Aug 17, 2018
XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
* fallback when env set

* fix mkdnn default env

* update docs to include desc about MXNET_MKLDNN_ENABLED

* update env name to MXNET_MKLDNN_ENABLED

* check dev_mask is cpu before fallback

* log if flag is off

* cache mkldnn check output

* move logonce inside fallback

* retrigger
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
MKLDNN pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants