Skip to content

Commit 000af49

Browse files
ashokeipiiswrong
authored andcommitted
[MXNET-33] SSD example not working with mkl-dnn (apache#10021)
* use mkl-dnn for 'valid' pooling_convention only * pooling convention full not supported by current mkl-dnn impl * disable unreachable code * add sample model test for mkldnn * fix review feedback * add jira link to comment * fix lint issue * rename python test for mkl * enable python tests for mkldnn in CI * use vgg16 with convention full * fix unittest
1 parent 3675945 commit 000af49

5 files changed

Lines changed: 889 additions & 1 deletion

File tree

Jenkinsfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ def python3_ut(docker_container_name) {
107107
}
108108
}
109109

110+
def python3_ut_mkldnn(docker_container_name) {
111+
timeout(time: max_time, unit: 'MINUTES') {
112+
sh "ci/build.py --build --platform ${docker_container_name} /work/runtime_functions.sh unittest_ubuntu_python3_cpu_mkldnn"
113+
}
114+
}
115+
110116
// GPU test has two parts. 1) run unittest on GPU, 2) compare the results on
111117
// both CPU and GPU
112118
// Python 2
@@ -478,7 +484,7 @@ try {
478484
ws('workspace/ut-python3-mkldnn-cpu') {
479485
init_git()
480486
unpack_lib('mkldnn_cpu', mx_mkldnn_lib)
481-
python3_ut('ubuntu_cpu')
487+
python3_ut_mkldnn('ubuntu_cpu')
482488
}
483489
}
484490
},

ci/docker/runtime_functions.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,18 @@ unittest_ubuntu_python3_cpu() {
376376
nosetests-3.4 --verbose tests/python/quantization
377377
}
378378

379+
unittest_ubuntu_python3_cpu_mkldnn() {
380+
set -ex
381+
export PYTHONPATH=./python/
382+
# MXNET_MKLDNN_DEBUG is buggy and produces false positives
383+
# https://github.com/apache/incubator-mxnet/issues/10026
384+
#export MXNET_MKLDNN_DEBUG=1 # Ignored if not present
385+
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
386+
nosetests-3.4 --verbose tests/python/unittest
387+
nosetests-3.4 --verbose tests/python/quantization
388+
nosetests-3.4 --verbose tests/python/mkl
389+
}
390+
379391
unittest_ubuntu_python2_gpu() {
380392
set -ex
381393
export PYTHONPATH=./python/

src/operator/nn/mkldnn/mkldnn_pooling-inl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,18 @@ inline bool SupportMKLDNNPooling(const PoolingParam &param,
9292

9393
if (param.pooling_convention == pool_enum::kValid)
9494
return true;
95+
else
96+
return false;
9597

98+
// need to support pooling convention full
99+
// https://issues.apache.org/jira/browse/MXNET-33
100+
#if 0
96101
if (((dshape[2] + 2 * param.pad[0] - param.kernel[0]) % param.stride[0] == 0) &&
97102
((dshape[3] + 2 * param.pad[1] - param.kernel[1]) % param.stride[1] == 0))
98103
return true;
99104
else
100105
return false;
106+
#endif
101107
}
102108

103109
inline bool MKLDNNRequireWorkspace(const PoolingParam &param) {

0 commit comments

Comments
 (0)