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

Commit

Permalink
[MXNET-33] SSD example not working with mkl-dnn (#10021)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ashokei authored and anirudh2290 committed Jun 13, 2018
1 parent bc9a2d2 commit db24cc0
Show file tree
Hide file tree
Showing 5 changed files with 889 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ def python3_ut(docker_container_name) {
}
}

def python3_ut_mkldnn(docker_container_name) {
timeout(time: max_time, unit: 'MINUTES') {
sh "ci/build.py --build --platform ${docker_container_name} /work/runtime_functions.sh unittest_ubuntu_python3_cpu_mkldnn"
}
}

// GPU test has two parts. 1) run unittest on GPU, 2) compare the results on
// both CPU and GPU
// Python 2
Expand Down Expand Up @@ -438,7 +444,7 @@ try {
ws('workspace/ut-python3-mkldnn-cpu') {
init_git()
unpack_lib('mkldnn_cpu', mx_mkldnn_lib)
python3_ut('ubuntu_cpu')
python3_ut_mkldnn('ubuntu_cpu')
}
}
},
Expand Down
12 changes: 12 additions & 0 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,18 @@ unittest_ubuntu_python3_cpu() {
nosetests-3.4 --verbose tests/python/quantization
}

unittest_ubuntu_python3_cpu_mkldnn() {
set -ex
export PYTHONPATH=./python/
# MXNET_MKLDNN_DEBUG is buggy and produces false positives
# https://github.com/apache/incubator-mxnet/issues/10026
#export MXNET_MKLDNN_DEBUG=1 # Ignored if not present
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
nosetests-3.4 --verbose tests/python/unittest
nosetests-3.4 --verbose tests/python/quantization
nosetests-3.4 --verbose tests/python/mkl
}

unittest_ubuntu_python2_gpu() {
set -ex
export PYTHONPATH=./python/
Expand Down
6 changes: 6 additions & 0 deletions src/operator/nn/mkldnn/mkldnn_pooling-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,18 @@ inline bool SupportMKLDNNPooling(const PoolingParam &param,

if (param.pooling_convention == pool_enum::kValid)
return true;
else
return false;

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

inline bool MKLDNNRequireWorkspace(const PoolingParam &param) {
Expand Down
Loading

0 comments on commit db24cc0

Please sign in to comment.