Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Softmax refactor #7

Open
wants to merge 274 commits into
base: refactor
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
5bb99c8
Make pooling stateless.
zheng-da Nov 28, 2017
046eb81
Make dropout stateless.
zheng-da Nov 28, 2017
f4c6f1c
Make batchnorm stateless.
zheng-da Nov 28, 2017
30b5fd9
Make SoftmaxActivation stateless.
zheng-da Nov 27, 2017
95ef90e
Fix a code style problem.
zheng-da Nov 28, 2017
921859a
pass amalgamation test for batch norm.
zheng-da Nov 28, 2017
485f58f
pass amalgamation test for dropout.
zheng-da Nov 28, 2017
660968f
Get convolution ops from a function.
zheng-da Nov 28, 2017
26e9430
Fix compilation errors for GPU.
zheng-da Nov 28, 2017
5504e2c
Fix thread local in diff platforms.
zheng-da Nov 28, 2017
6324176
Avoid using thread_local for non-CuDNN conv/deconv.
zheng-da Nov 28, 2017
36c466f
Remove TODO in deconv.
zheng-da Nov 28, 2017
6410684
Fix a compilation error in dropout.
zheng-da Nov 28, 2017
1fa3898
Fix a bug in batch norm.
zheng-da Nov 29, 2017
588383a
Fix a bug in fully connected.
zheng-da Nov 29, 2017
66a281a
Don't set #inputs for backward convolution.
zheng-da Nov 29, 2017
d3ce902
Remove MKL code.
zheng-da Oct 20, 2017
caa3bf3
Update MXNet for MKLDNN.
zheng-da Oct 21, 2017
db10bb1
Enable MKLDNN Relu.
zheng-da Oct 24, 2017
99c1e08
Fix a compilation error.
zheng-da Nov 29, 2017
a6c2c82
Change Makefile for MKLDNN.
zheng-da Oct 24, 2017
3f75f52
Remove infer storage in convolution.
zheng-da Oct 25, 2017
edf6842
Update MXNet for MKLDNN.
zheng-da Oct 25, 2017
c96ca26
Support MKLDNN storage type in python.
zheng-da Oct 31, 2017
1a6e06e
Update activation.
zheng-da Oct 25, 2017
ca30cac
Add MKLDNN base classes.
zheng-da Oct 26, 2017
79c563c
Implement MKLDNN fully connected.
zheng-da Oct 28, 2017
2f5ed28
Add MKLDNN convolution.
zheng-da Oct 31, 2017
126b85e
Update MKLDNN interface in NDArray.
zheng-da Nov 2, 2017
7672608
MKLDNN convolution handle CreateMKLDNNData failure.
zheng-da Nov 2, 2017
4064bef
Add another GetMKLDNNData in NDArray.
zheng-da Nov 3, 2017
9c6bf6f
Have mkldnn to define the data format.
zheng-da Nov 3, 2017
3bdc871
Create output MKLDNN memory explicitly for FC.
zheng-da Nov 3, 2017
551c66d
Fix a bug in NDArray.
zheng-da Nov 3, 2017
b6abf35
Fix a bug in GetWeightDesc.
zheng-da Nov 3, 2017
dff9c0f
Convert data layout if necessary in FC.
zheng-da Nov 3, 2017
310be84
remove unnecessary print in MKLDNN convolution.
zheng-da Nov 3, 2017
b1f17c5
Add MKLDNN deconvolution.
zheng-da Nov 2, 2017
926289c
Add MKLDNNStream to manage primitives and memories.
zheng-da Nov 6, 2017
fae1fc3
Use MKLDNNStream to register memory in NDArray.
zheng-da Nov 6, 2017
474f847
Use MKLDNNStream to manage resources in operators.
zheng-da Nov 6, 2017
d750f86
Handle kAddTo in MKLDNN operators.
zheng-da Nov 7, 2017
3b9395d
Fix a bug in deconvolution.
zheng-da Nov 7, 2017
b3518aa
Fix bugs in NDArray.
zheng-da Nov 7, 2017
c51576c
Revert "Fix bugs in NDArray."
zheng-da Nov 7, 2017
8e4acd1
Fix a bug in NDArray.
zheng-da Nov 7, 2017
e5f9c2f
Fix a bug in NDArray.
zheng-da Nov 7, 2017
7853520
Reorder MKLDNN memory to default format in SetTBlob.
zheng-da Nov 8, 2017
d2af1f3
Disable MKLDNN correctly.
zheng-da Nov 8, 2017
f9cae1b
Fix a bug in activation.
zheng-da Nov 8, 2017
3965435
Reshape of NDArray supports MKLDNN.
zheng-da Nov 8, 2017
69cce01
Fix a memory ref bug in NDArray.
zheng-da Nov 8, 2017
4c4d73c
Reshape NDArray in MKLDNN FullyConnected.
zheng-da Nov 8, 2017
625951c
Fix data format conversion.
zheng-da Nov 8, 2017
15ee484
Remove MKL code in dropout.
zheng-da Nov 29, 2017
8779612
Create MKLDNN NDArray in python.
zheng-da Nov 10, 2017
bc39849
Support Slice for MKLDNN NDArray.
zheng-da Nov 11, 2017
25afbd7
Reduce the overhead of summing the result to the output array.
zheng-da Nov 11, 2017
be6f3e7
Avoid unnecessary memory copy in NDArray.
zheng-da Nov 11, 2017
6f12fb3
Fix a bug in data reordering.
zheng-da Nov 13, 2017
6301b0d
Fix a bug in NDArray.
zheng-da Nov 14, 2017
9c62198
Don't hard code MKLDNN type.
zheng-da Nov 14, 2017
59d2ab4
Support dilation in MKLDNN convolution.
zheng-da Nov 16, 2017
8fa58eb
Fix a bug in sum results.
zheng-da Nov 16, 2017
ba1be8f
Rewrite GetMKLDNNData.
zheng-da Nov 16, 2017
81493c7
Add prepare_mkldnn.sh
zheng-da Nov 16, 2017
28a7880
Enable MKLDNN activation.
zheng-da Nov 16, 2017
6f19874
Fix a bug on FullyConnected.
zheng-da Nov 17, 2017
873cae9
Handle 3 dims for MKLDNN NDArray.
zheng-da Nov 17, 2017
1aab48f
Fix a bug in MKLDNN FC.
zheng-da Nov 17, 2017
e280827
Support MKLDNN storage in KV store.
zheng-da Nov 17, 2017
b76418e
Fix a bug in executor for non-default NDArray.
zheng-da Nov 17, 2017
645e9ae
Fix a link error in cast_storage.cc.
zheng-da Nov 29, 2017
706ae04
Remove unnecessary function def
zheng-da Nov 17, 2017
3a32cb9
Fall back to def storage if the type isn't supported by MKLDNN.
zheng-da Nov 17, 2017
7cf8201
Use NDArray for MKLDNN in python.
zheng-da Nov 17, 2017
d0f806f
Reshape output of MKLDNN convolution.
zheng-da Nov 20, 2017
39f5820
Fix a bug in NDArray.
zheng-da Nov 20, 2017
770050a
Support more operations in MKLDNN NDArray.
zheng-da Nov 21, 2017
23b5e19
Fix a bug in deconvolution.
zheng-da Nov 21, 2017
4bc0290
Fix bugs in MKLDNN deconvolution.
zheng-da Nov 21, 2017
ea3b24c
Have elemwise binary ops to fall to default for MKLDNN.
zheng-da Nov 21, 2017
d8f4672
Limit the cases that MKLDNN operations are called.
zheng-da Nov 21, 2017
68add39
Force the layout of mkldnn::memory from NDArray.
zheng-da Nov 22, 2017
e09ee05
Add MKLDNN softmax.
zheng-da Nov 22, 2017
b6a6ea2
Fix output storage type of MKLDNN softmax.
zheng-da Nov 22, 2017
045d980
Add MKLDNN sum.
zheng-da Nov 22, 2017
852a106
Fix a bug in elemwise sum.
zheng-da Nov 30, 2017
9ebb034
Fix a bug in MKLDNN softmax.
zheng-da Nov 30, 2017
b38c466
Fix a bug in imperative.
zheng-da Nov 30, 2017
d1544d8
Remove redundant code.
zheng-da Nov 30, 2017
2886818
MKLDNN Pooling Op integration
ashokei Nov 21, 2017
1213670
MKLDNN Pooling Op integration add missing file
ashokei Nov 21, 2017
ecfb6b7
fix mkldnn pooling op workspace issue
ashokei Nov 23, 2017
adbec7a
handle workspace in MKLDNN pooling correctly.
zheng-da Dec 1, 2017
70b0399
Use a non-MKLDNN op for testing.
zheng-da Dec 1, 2017
e785e5d
Allow to share arguments and their gradients between executors.
zheng-da Dec 1, 2017
20f1e6a
Avoid using MKLDNN pooling when it's not supported.
zheng-da Dec 1, 2017
23943f2
Support MKLDNN properly.
zheng-da Dec 2, 2017
801bf66
Choose MKLDNN softmax more carefully.
zheng-da Dec 4, 2017
f89ce8a
Fix a bug in MKLDNN pooling.
zheng-da Dec 5, 2017
1d749f0
Fall back if MKLDNN pooling isn't supported.
zheng-da Dec 5, 2017
8f7acab
Fix a bug in Slice of NDArray.
zheng-da Dec 5, 2017
179ac61
Use int32 for workspace memory.
zheng-da Dec 5, 2017
8e6abf9
Exclude MKLDNN act with tanh.
zheng-da Dec 5, 2017
e8cc7e0
Have two Reshape functions in NDArray.
zheng-da Dec 5, 2017
801bebb
Move concat to nn/
zheng-da Dec 5, 2017
bb1570a
Use NNVM interface for concat.
zheng-da Dec 5, 2017
d572bc9
Move lrn to nn/.
zheng-da Dec 5, 2017
539e3e7
Use NNVM interface for LRN.
zheng-da Dec 6, 2017
5439b31
Copy data for NDArray with diff shapes.
zheng-da Dec 6, 2017
6d07be9
Add MKLDNN copy.
zheng-da Dec 6, 2017
ea576dd
Add MKLDNN version of elemwise_add.
zheng-da Dec 7, 2017
94cbaae
Add MKLDNN version of Flatten.
zheng-da Dec 7, 2017
13c0199
add mkldnn surport for concat
wentingj Dec 7, 2017
0e87c49
simplify MKLDNN Flatten.
zheng-da Dec 7, 2017
771bbd4
Enalbe MKLDNN deconvolution with bias.
zheng-da Dec 8, 2017
aebac39
Fix a bug in CuDNN deconvolution.
zheng-da Dec 8, 2017
b9f6f32
avoid using MKLDNNStorage when it's not defined.
zheng-da Dec 8, 2017
9fe92e1
Remove ./cudnn_lrn-inl.h
zheng-da Dec 8, 2017
64a4a28
Fix for make lint.
zheng-da Dec 8, 2017
6a973b9
add mkldnn surport for concat
wentingj Dec 7, 2017
337b2ec
fix the coding style for pr of mkldnn concat
wentingj Dec 8, 2017
c290f6e
Only add input data for MKLDNN concat backward
zheng-da Dec 8, 2017
a2d8906
Remove unnecessary TODO.
zheng-da Dec 8, 2017
57c2b3d
remove unnecessary __repr__ in MKLNDArray.
zheng-da Dec 8, 2017
43b6f5c
better condition check for readability.
zheng-da Dec 8, 2017
b3f7d6e
Use macro when including mkldnn.hpp.
zheng-da Dec 8, 2017
ead065f
Revert "Use CoreOpRunner for refactored Ops."
zheng-da Dec 8, 2017
447c2d2
Fix a bug in test core.
zheng-da Dec 9, 2017
0cf3789
Limit MKLDNN ops being used.
zheng-da Dec 9, 2017
f6654d8
Fix complains from "make pylint"
zheng-da Dec 9, 2017
aa6c19f
Move ContainStorage to common/utils.h
zheng-da Dec 9, 2017
460a0a8
Limit MKLDNN concat being used.
zheng-da Dec 9, 2017
e1d0064
Add license.
zheng-da Dec 9, 2017
b8bfd7f
Fix amalgamation
zheng-da Dec 11, 2017
df63a79
Fix compilation error in mkldnn_ops-inl.h
zheng-da Dec 11, 2017
6934234
Fix a bug in deconvolution.
zheng-da Dec 11, 2017
511ac71
Fix a bug in pooling.
zheng-da Dec 11, 2017
9336bcc
MKLDNN ops allocates temp mem.
zheng-da Dec 11, 2017
a8d4138
Fix a bug in pooling.
zheng-da Dec 12, 2017
bbea66e
Allocate align memory from temp space.
zheng-da Dec 12, 2017
84e60cd
Have parameter gradients stored in the default storage.
zheng-da Dec 12, 2017
ad6c35d
Handle all cases in CopyFrom.
zheng-da Dec 12, 2017
be0d5b9
Ensure NDArray returns memory with right memory descriptors.
zheng-da Dec 12, 2017
e186ee3
use auto to define memory in the operator.
zheng-da Dec 12, 2017
b3d9c16
Use raw pointer for mkldnn memory.
zheng-da Dec 12, 2017
c099520
Move more code to mkldnn_base.cc
zheng-da Dec 12, 2017
04ec945
Fix a compilation error.
zheng-da Dec 12, 2017
9562d96
Address review comments.
zheng-da Dec 13, 2017
5842d56
fix a bug in activation backward.
zheng-da Dec 13, 2017
4811bf2
Miss a macro in mkldnn_base.cc
zheng-da Dec 13, 2017
7735fb6
Fix a bug in data iterator in examples.
zheng-da Dec 13, 2017
b77ceb3
Avoid memory allocation in ReshapeMKLDNN.
zheng-da Dec 13, 2017
724631c
Avoid memory allocation in storage cast.
zheng-da Dec 13, 2017
80a81a4
Fix a bug in cast storage.
zheng-da Dec 13, 2017
aedcfd6
Handle sliced MKLDNN NDArray.
zheng-da Dec 13, 2017
b35b74d
Use memcpy if NDArray uses default format.
zheng-da Dec 14, 2017
2ea3ee2
Revert "Limit MKLDNN ops being used."
zheng-da Dec 14, 2017
025be14
Enable mkldnn act backward has the same input layout.
zheng-da Dec 14, 2017
74f8d75
Fix a bug in mkldnn activation.
zheng-da Dec 14, 2017
aff0541
Use MKLDNN sum in more cases.
zheng-da Dec 15, 2017
0f98ce0
Improve perf of reorder.
zheng-da Dec 16, 2017
aa7afd4
Avoid memory reorder in conv and deconv.
zheng-da Dec 16, 2017
f35fa37
Avoid unnecessary storage cast in fallback path.
zheng-da Dec 16, 2017
449b537
Revert "Use MKLDNN sum in more cases."
zheng-da Dec 16, 2017
db33412
Handle sliced ndarray in more cases.
zheng-da Dec 17, 2017
b9f913d
Fix a complain from make lint.
zheng-da Dec 17, 2017
0f9f75a
Update Jenkins to test MKLDNN.
zheng-da Dec 17, 2017
ce87425
Add Dockerfile for CI.
zheng-da Dec 17, 2017
3c41257
debug compiling mkldnn.
zheng-da Dec 17, 2017
79aa7f3
Use MKLDNN sum in more cases.
zheng-da Dec 17, 2017
e7783f6
Add mkldnn as a submodule.
zheng-da Dec 17, 2017
66a2557
Compile with mkldnn in 3rdparty.
zheng-da Dec 17, 2017
84469a4
Fix some coding styles.
zheng-da Dec 18, 2017
faec6b2
download curl in ci build.
zheng-da Dec 18, 2017
11f58e4
write the path to mkldnn lib in libmxnet.so.
zheng-da Dec 18, 2017
8f61624
use rpath with $ORIGIN.
zheng-da Dec 18, 2017
d9eae20
Pack all lib files in Jenkins.
zheng-da Dec 18, 2017
cb97b07
pack and unpack mxnet with MKLDNN.
zheng-da Dec 18, 2017
5dc3c42
Update Jenkinsfile
zheng-da Dec 19, 2017
456086b
Update Jenkinsfile
zheng-da Dec 19, 2017
9153471
Add mkldnn batch normalization
TaoLv Dec 18, 2017
91fcd10
Fix bugs in BN.
zheng-da Dec 19, 2017
4c3aeb5
Avoid memory allocation in MKLDNNCopy.
zheng-da Dec 19, 2017
6507e82
only use MKLDNN BatchNorm for special cases.
zheng-da Dec 19, 2017
d47b744
Add MKL-DNN based LRN
pengzhao-intel Dec 19, 2017
e7ad056
Code Style Changes
pengzhao-intel Dec 19, 2017
530e2b2
Fix a bug in BN.
zheng-da Dec 19, 2017
72f27d5
Fix a bug in LRN.
zheng-da Dec 19, 2017
9321cf3
Handle non-default storage in memory plan.
zheng-da Dec 19, 2017
8c5414d
Merge branch 'refactor' of https://github.com/zheng-da/incubator-mxne…
zheng-da Dec 19, 2017
ea30336
Fix coding style.
zheng-da Dec 19, 2017
7f74139
Fix a compilation error without mkldnn.
zheng-da Dec 19, 2017
03fd841
Fix some coding styles for batch norm
TaoLv Dec 20, 2017
42a7f7b
Merge pull request #4 from TaoLv/bn-fix
zheng-da Dec 20, 2017
85e020f
a hack to speed up MKLDNN inference.
zheng-da Dec 21, 2017
fbb2fea
Merge branch 'refactor' of https://github.com/zheng-da/incubator-mxne…
zheng-da Dec 21, 2017
7f643ac
Improve forward of convolution.
zheng-da Dec 21, 2017
08a67ed
Add openmp and simd support to BN operator
TaoLv Dec 21, 2017
313b80b
Retrieve MKLDNN Conv primitive based on signature.
zheng-da Dec 21, 2017
550e5e6
Retrieve Act primitive based on its signature.
zheng-da Dec 21, 2017
4122a7a
Fix a bug in pooling.
zheng-da Dec 22, 2017
e2ab086
Diable some MKLDNN activation and pooling.
zheng-da Dec 22, 2017
80c43bd
Cast MKLDNN storage with diff data type.
zheng-da Dec 22, 2017
4fd62cc
Check if it's a view of NDArray.
zheng-da Dec 23, 2017
e9e47c7
Reshaped and sliced arrays share the same chunks.
zheng-da Dec 23, 2017
a1423ef
Implement caching MKLDNN Act correctly.
zheng-da Dec 23, 2017
e2c5374
Fix a bug in check_consistency.
zheng-da Dec 24, 2017
fb040e6
Fix a potential bug when destroying NDArray.
zheng-da Dec 24, 2017
a10075a
Fix bugs when allocating mem in NDArray.
zheng-da Dec 24, 2017
86945b0
Fix coding style.
zheng-da Dec 24, 2017
69c39ac
Add micro when using mkldnn in ndarray.
zheng-da Dec 24, 2017
5cd1adf
Fix a compilation error.
zheng-da Dec 24, 2017
f20f4c9
Add primitive and memory cache for BatchNorm
TaoLv Dec 30, 2017
6836bf1
Remove saving reordered mkldnn mem.
zheng-da Dec 30, 2017
47d9f92
Fix a bug in concat.
zheng-da Dec 31, 2017
a18b3de
Remove MKLDNNStorage.
zheng-da Dec 31, 2017
8dba402
Force weight grad to use default layout.
zheng-da Dec 31, 2017
bcd3253
Reorder weight arrays in (de)conv for faster inference.
zheng-da Dec 31, 2017
c994548
handle diff layouts in CopyFromToDnsImpl.
zheng-da Jan 1, 2018
7756b44
use NDArray::data() instead of fallback for arrays with MKLDNN layout.
zheng-da Jan 1, 2018
bdbc74b
Fix a bug in NDArray.
zheng-da Dec 31, 2017
04ff469
Fix a bug in Flatten.
zheng-da Jan 1, 2018
1bf2037
Fallback correctly.
zheng-da Jan 1, 2018
79ac700
handle ndarray with def layout in mkldnn BN correctly.
zheng-da Jan 1, 2018
f8ff37f
Align to page when mkldnn is enabled.
zheng-da Jan 1, 2018
ac546bd
Use default mem alloc for mkldnn.
zheng-da Jan 1, 2018
fd33a69
Reuse NDArrays.
zheng-da Jan 2, 2018
22fd0e1
Support WriteInplace for sum.
zheng-da Jan 2, 2018
0ff5d85
Merge branch 'master' of https://github.com/apache/incubator-mxnet in…
zheng-da Jan 2, 2018
489603e
Merge branch 'refactor' of https://github.com/zheng-da/incubator-mxne…
zheng-da Jan 2, 2018
4eeffc9
fix complains from "make lint".
zheng-da Jan 2, 2018
f4b73db
Avoid reallocation in NDArray.
zheng-da Jan 2, 2018
c8578c0
Merge branch 'refactor' of https://github.com/zheng-da/incubator-mxne…
zheng-da Jan 2, 2018
ac8f9fd
Handle weight arrays with special MKLDNN layouts.
zheng-da Jan 2, 2018
24200a0
Remove unnecessary GetWeights.
zheng-da Jan 2, 2018
19d8749
Fix compilation error without MKLDNN.
zheng-da Jan 2, 2018
18236fc
Fix a bug in (de)conv for weight arrays.
zheng-da Jan 3, 2018
1cd8bad
Fix a minor bug in MKLDNN conv.
zheng-da Jan 3, 2018
9b3c8b2
Avoid caching TBlob from NDArray.
zheng-da Jan 4, 2018
c426bfa
Fix a bug in MKLDNNOpSignature.
zheng-da Jan 6, 2018
623b994
Merge remote-tracking branch 'da/refactor' into bn-primitive
TaoLv Jan 8, 2018
5825191
1. Fix coding style in BatchNorm;
TaoLv Jan 8, 2018
87fd9d5
Merge pull request #5 from TaoLv/bn-primitive
zheng-da Jan 8, 2018
5cf7882
refact softmax op for mkldnn support
wentingj Jan 9, 2018
5be0cca
fix code format
wentingj Jan 9, 2018
9cf3264
softmax 1.rm not used req input; 2.use input_mem desc to create out_m…
wentingj Jan 10, 2018
2ad8dca
use GetMKLDNNData to get input_mem, then use data_mpd to new this->out
wentingj Jan 10, 2018
1037608
1.rm kMKLDNNStorage 2.key.AddSign mkldnn mem temporally
wentingj Jan 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
[submodule "3rdparty/googletest"]
path = 3rdparty/googletest
url = https://github.com/google/googletest.git
[submodule "3rdparty/mkldnn"]
path = 3rdparty/mkldnn
url = https://github.com/01org/mkl-dnn.git
branch = master
1 change: 1 addition & 0 deletions 3rdparty/mkldnn
Submodule mkldnn added at 82cf37
65 changes: 32 additions & 33 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// mxnet libraries
mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, dmlc-core/libdmlc.a, nnvm/lib/libnnvm.a'
mx_mkldnn_lib = 'lib/libmxnet.so, lib/libmxnet.a, lib/libiomp5.so, lib/libmklml_gnu.so, lib/libmkldnn.so, lib/libmkldnn.so.0, lib/libmklml_intel.so, dmlc-core/libdmlc.a, nnvm/lib/libnnvm.a'
// command to start a docker container
docker_run = 'tests/ci_build/ci_build.sh'
// timeout in minutes
Expand Down Expand Up @@ -120,15 +121,15 @@ def python3_gpu_ut(docker_type) {
}

// Python 2
def python2_mklml_ut(docker_type) {
def python2_mkldnn_ut(docker_type) {
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} ${docker_type} find . -name '*.pyc' -type f -delete"
sh "${docker_run} ${docker_type} PYTHONPATH=./python/ nosetests-2.7 --with-timer --verbose tests/python/cpu"
}
}

// Python 3
def python3_mklml_ut(docker_type) {
def python3_mkldnn_ut(docker_type) {
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} ${docker_type} find . -name '*.pyc' -type f -delete"
sh "${docker_run} ${docker_type} PYTHONPATH=./python/ nosetests-3.4 --with-timer --verbose tests/python/cpu"
Expand Down Expand Up @@ -166,42 +167,40 @@ try {
}
}
},
'CPU: MKLML': {
'CPU: MKLDNN': {
node('mxnetlinux-cpu') {
ws('workspace/build-mklml-cpu') {
ws('workspace/build-mkldnn-cpu') {
init_git()
def flag = """ \
DEV=1 \
USE_PROFILER=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_MKL2017=1 \
USE_MKL2017_EXPERIMENTAL=1 \
USE_MKLDNN=1 \
-j\$(nproc)
"""
make("cpu_mklml", flag)
pack_lib('mklml_cpu')
make("cpu_mkldnn", flag)
pack_lib('mkldnn_cpu', mx_mkldnn_lib)
}
}
},
'GPU: MKLML': {
'GPU: MKLDNN': {
node('mxnetlinux-cpu') {
ws('workspace/build-mklml-gpu') {
ws('workspace/build-mkldnn-gpu') {
init_git()
def flag = """ \
DEV=1 \
USE_PROFILER=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_MKL2017=1 \
USE_MKL2017_EXPERIMENTAL=1 \
USE_MKLDNN=1 \
USE_CUDA=1 \
USE_CUDA_PATH=/usr/local/cuda \
USE_CUDNN=1 \
-j\$(nproc)
"""
make("build_cuda", flag)
pack_lib('mklml_gpu')
pack_lib('mkldnn_gpu', mx_mkldnn_lib)
}
}
},
Expand Down Expand Up @@ -344,43 +343,43 @@ try {
}
}
},
'Python2: MKLML-CPU': {
'Python2: MKLDNN-CPU': {
node('mxnetlinux-cpu') {
ws('workspace/ut-python2-mklml-cpu') {
ws('workspace/ut-python2-mkldnn-cpu') {
init_git()
unpack_lib('mklml_cpu')
python2_ut('cpu_mklml')
python2_mklml_ut('cpu_mklml')
unpack_lib('mkldnn_cpu', mx_mkldnn_lib)
python2_ut('cpu_mkldnn')
python2_mkldnn_ut('cpu_mkldnn')
}
}
},
'Python2: MKLML-GPU': {
'Python2: MKLDNN-GPU': {
node('mxnetlinux-gpu') {
ws('workspace/ut-python2-mklml-gpu') {
ws('workspace/ut-python2-mkldnn-gpu') {
init_git()
unpack_lib('mklml_gpu')
python2_gpu_ut('gpu_mklml')
python2_mklml_ut('gpu_mklml')
unpack_lib('mkldnn_gpu', mx_mkldnn_lib)
python2_gpu_ut('gpu_mkldnn')
python2_mkldnn_ut('gpu_mkldnn')
}
}
},
'Python3: MKLML-CPU': {
'Python3: MKLDNN-CPU': {
node('mxnetlinux-cpu') {
ws('workspace/ut-python3-mklml-cpu') {
ws('workspace/ut-python3-mkldnn-cpu') {
init_git()
unpack_lib('mklml_cpu')
python3_ut('cpu_mklml')
python3_mklml_ut('cpu_mklml')
unpack_lib('mkldnn_cpu', mx_mkldnn_lib)
python3_ut('cpu_mkldnn')
python3_mkldnn_ut('cpu_mkldnn')
}
}
},
'Python3: MKLML-GPU': {
'Python3: MKLDNN-GPU': {
node('mxnetlinux-gpu') {
ws('workspace/ut-python3-mklml-gpu') {
ws('workspace/ut-python3-mkldnn-gpu') {
init_git()
unpack_lib('mklml_gpu')
python3_gpu_ut('gpu_mklml')
python3_mklml_ut('gpu_mklml')
unpack_lib('mkldnn_gpu', mx_mkldnn_lib)
python3_gpu_ut('gpu_mkldnn')
python3_mkldnn_ut('gpu_mkldnn')
}
}
},
Expand Down
44 changes: 21 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ endif
# use customized config file
include $(config)

ifeq ($(USE_MKL2017), 1)
# must run ./prepare_mkl before including mshadow.mk
RETURN_STRING := $(shell ./prepare_mkl.sh $(MKLML_ROOT))
MKLROOT := $(firstword $(RETURN_STRING))
export USE_MKLML = $(lastword $(RETURN_STRING))
ifeq ($(USE_MKLDNN), 1)
RETURN_STRING := $(shell ./prepare_mkldnn.sh $(MKLDNN_ROOT))
MKLDNNROOT := $(firstword $(RETURN_STRING))
MKLROOT := $(lastword $(RETURN_STRING))
export USE_MKLML = 1
endif

include mshadow/make/mshadow.mk
Expand Down Expand Up @@ -112,23 +112,20 @@ ifeq ($(USE_NNPACK), 1)
LDFLAGS += -lnnpack
endif

ifeq ($(USE_MKL2017), 1)
CFLAGS += -DMXNET_USE_MKL2017=1
ifeq ($(USE_MKLDNN), 1)
CFLAGS += -DMXNET_USE_MKLDNN=1
CFLAGS += -DUSE_MKL=1
CFLAGS += -I$(ROOTDIR)/src/operator/mkl/
CFLAGS += -I$(MKLML_ROOT)/include
LDFLAGS += -L$(MKLML_ROOT)/lib
ifeq ($(USE_MKL2017_EXPERIMENTAL), 1)
CFLAGS += -DMKL_EXPERIMENTAL=1
else
CFLAGS += -DMKL_EXPERIMENTAL=0
endif
ifeq ($(UNAME_S), Darwin)
LDFLAGS += -lmklml
else
LDFLAGS += -Wl,--as-needed -lmklml_intel -lmklml_gnu
CFLAGS += -I$(ROOTDIR)/src/operator/nn/mkldnn/
ifneq ($(MKLDNNROOT), $(MKLROOT))
CFLAGS += -I$(MKLROOT)/include
LDFLAGS += -L$(MKLROOT)/lib
endif
LDFLAGS += -liomp5
CFLAGS += -I$(MKLDNNROOT)/include
LDFLAGS += -L$(MKLDNNROOT)/lib -lmkldnn -Wl,-rpath,'$${ORIGIN}'
endif

ifeq ($(BN_DEBUG), 1)
CFLAGS += -DMXNET_BN_DEBUG=1
endif

ifeq ($(USE_OPERATOR_TUNING), 1)
Expand All @@ -142,7 +139,7 @@ endif
# - for Ubuntu, installing atlas will not automatically install the atlas provided lapack library
# silently switching lapack off instead of letting the build fail because of backward compatibility
ifeq ($(USE_LAPACK), 1)
ifeq ($(USE_BLAS),$(filter $(USE_BLAS),blas openblas atlas))
ifeq ($(USE_BLAS),$(filter $(USE_BLAS),blas openblas atlas mkl))
ifeq (,$(wildcard /lib/liblapack.a))
ifeq (,$(wildcard /usr/lib/liblapack.a))
ifeq (,$(wildcard /usr/lib64/liblapack.a))
Expand All @@ -160,7 +157,7 @@ ifeq ($(USE_LAPACK), 1)
ifneq ($(USE_LAPACK_PATH), )
LDFLAGS += -L$(USE_LAPACK_PATH)
endif
ifeq ($(USE_BLAS),$(filter $(USE_BLAS),blas openblas atlas))
ifeq ($(USE_BLAS),$(filter $(USE_BLAS),blas openblas atlas mkl))
LDFLAGS += -llapack
endif
CFLAGS += -DMXNET_USE_LAPACK
Expand Down Expand Up @@ -546,7 +543,8 @@ clean: cyclean $(EXTRA_PACKAGES_CLEAN)
else
clean: cyclean testclean $(EXTRA_PACKAGES_CLEAN)
$(RM) -r build lib bin *~ */*~ */*/*~ */*/*/*~ R-package/NAMESPACE R-package/man R-package/R/mxnet_generated.R \
R-package/inst R-package/src/image_recordio.h R-package/src/*.o R-package/src/*.so mxnet_*.tar.gz
R-package/inst R-package/src/image_recordio.h R-package/src/*.o R-package/src/*.so mxnet_*.tar.gz \
external/mkldnn/install/*
cd $(DMLC_CORE); $(MAKE) clean; cd -
cd $(PS_PATH); $(MAKE) clean; cd -
cd $(NNVM_PATH); $(MAKE) clean; cd -
Expand Down
2 changes: 1 addition & 1 deletion amalgamation/mxnet_predict0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#include "src/operator/operator_util.cc"
#include "src/operator/nn/activation.cc"
#include "src/operator/nn/batch_norm.cc"
#include "src/operator/concat.cc"
#include "src/operator/nn/concat.cc"
#include "src/operator/nn/convolution.cc"
#include "src/operator/nn/deconvolution.cc"
#include "src/operator/nn/dropout.cc"
Expand Down
3 changes: 2 additions & 1 deletion example/image-classification/common/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def get_rec_iter(args, kv=None):
image_shape = tuple([int(l) for l in args.image_shape.split(',')])
if 'benchmark' in args and args.benchmark:
data_shape = (args.batch_size,) + image_shape
train = SyntheticDataIter(args.num_classes, data_shape, 500, np.float32)
train = SyntheticDataIter(args.num_classes, data_shape,
args.num_examples / args.batch_size, np.float32)
return (train, None)
if kv:
(rank, nworker) = (kv.rank, kv.num_workers)
Expand Down
Loading