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

update BM to use MKL BM V2 API #3953

Closed
wants to merge 9 commits into from
Closed

update BM to use MKL BM V2 API #3953

wants to merge 9 commits into from

Conversation

glingyan
Copy link
Contributor

only compilable for MKL release after 1115

Signed-off-by: lingyan lingyan.guo@intel.com

only compilable for MKL release after 1115

Signed-off-by: lingyan <lingyan.guo@intel.com>
@piiswrong
Copy link
Contributor

Please ping my after you fixed the path issue and we can merge

move old mkl version to ~/mklml_release/mkl_$version automatically

Signed-off-by: lingyan <lingyan.guo@intel.com>
@glingyan
Copy link
Contributor Author

hi Eric: any update ?

@piiswrong
Copy link
Contributor

piiswrong commented Nov 30, 2016

Is path fixed here? Also could you add the old version back to webdata? Its causing 404 errors for people with old code

please rebase

@glingyan
Copy link
Contributor Author

glingyan commented Nov 30, 2016 via email

@glingyan
Copy link
Contributor Author

glingyan commented Dec 1, 2016 via email

@piiswrong
Copy link
Contributor

piiswrong commented Dec 1, 2016

So it gets downloaded to root now? Is there any documentation that mention this change?
Why not put mklroot in config.mk? Also the instruction for setting mklroot and LD_LIBRARY_PATH should be in config.mk. Its better if the user can, for example, set mklroot=/usr/local and install it to /usr/local/include and /usr/local/lib

@glingyan
Copy link
Contributor Author

glingyan commented Dec 1, 2016

  1. Enable USE_MKL2017=1 in make/config.mk
1.1 USE_BLAS should be atlas by default

1.2 if you need USE_BLAS to be mkl, please navigate here to do a full MKL installation: https://registrationcenter.intel.com/en/forms/?productid=2558&licensetype=2

1.3 By default, MKL_2017_EXPRIEMENTAL=0. If setting MKL_2017_EXPRIEMENTAL=1, MKL buffer will be created and transferred between layers to achiever much higher performance.
  1. Run 'make -jX'
2.1 Makefile will execute "prepare_mkl.sh" to download the mkl under ~/mklml_release/mklml folder

    2.2.1 if previous mkl version exist, e.g. previous mkl is 20120601, ~/mklml_release/mklml will rename to ~/mklml_release/mklml.20120601
    
        2.2.1.1 if previous mkl is 20120601 and mklml.20120601 is exist, this is unlikely to happen ,default behaviour is remove mklml to avoid compiling error

2.2 if the download failed because of proxy setting, please download it manually before make

2.2.1 wget https://github.com/dmlc/web-data/raw/master/mxnet/mklml-release/mklml_lnx_<MKL VERSION>.tgz

2.2.2 tar zxvf mklml_lnx_<MKL VERSION>.tgz

2.2.3 mv mklml_lnx_<MKL VERSION> ~/mklml_release/mklml

   2.2.3.1 mkdir mklml_release if not exists
  1. Navigate into the python directory

@glingyan
Copy link
Contributor Author

glingyan commented Dec 1, 2016

will checkin soon

@glingyan
Copy link
Contributor Author

glingyan commented Dec 1, 2016

put mklroot in config.mk is a good idea, will check then

@piiswrong
Copy link
Contributor

Also pooling still fails. Could you fallback to mxnet implementation for pooling until its fixed for mkl?

@piiswrong
Copy link
Contributor

@glingyan Also keep the tar.gz under mxnet, extract it to mklroot and remove the superfluous directory hierachies. So MKLROOT=~ to lead to things extracted to ~/include/mkl_xxx.h and ~/lib/libmklxxx.so

@piiswrong
Copy link
Contributor

Please simplify the intructions in MKL_README and put it in config.mk under the relevent variables

@glingyan
Copy link
Contributor Author

glingyan commented Dec 1, 2016 via email

Signed-off-by: lingyan <lingyan.guo@intel.com>
Signed-off-by: lingyan <lingyan.guo@intel.com>
Signed-off-by: lingyan <lingyan.guo@intel.com>
@glingyan
Copy link
Contributor Author

glingyan commented Dec 2, 2016

MKLML_ROOT feature done
MKL_README.mk updated and move to make folder , the same folder with config.mk

@@ -59,6 +59,9 @@ USE_OPENCV = 1
# use openmp for parallelization
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for not being clear. I didn't mean to move MKL_README to make/. I meant picking out the relevant sentences and put them here.
The MKLML_ROOT, USE_MKL2016 and UES_MKL_EXPERIMENTAL options should have detailed explanation of what they do. Or at least point the user to MKL_README for more details

wget --no-check-certificate -P $MXNET_ROOT $MKLURL -O $MXNET_ROOT/$ARCHIVE_BASENAME
tar -xzf $MXNET_ROOT/$ARCHIVE_BASENAME -C $MXNET_ROOT
#echo $HOME_MKL
yes | cp -rf $MXNET_ROOT/$MKL_CONTENT_DIR/* $HOME_MKL
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you confirmed this works? Do you need sudo cp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested:

  1. root user, put it in /usr/local
  2. normal user, put it in ~
    but for sudo , it is hard to do , becuase makefile need to get output from prepare_mkl.sh
    if need sudo to input password, it will not work
    do you have seem any solution for this?

Signed-off-by: lingyan <lingyan.guo@intel.com>
Signed-off-by: lingyan <lingyan.guo@intel.com>
Signed-off-by: lingyan <lingyan.guo@intel.com>
@glingyan
Copy link
Contributor Author

glingyan commented Dec 5, 2016

Support Pooling Asymmetric padding filled by zeros , it will pass the test when cudnn use CUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING mode

@@ -50,13 +48,6 @@ struct PoolingParam : public dmlc::Parameter<PoolingParam> {
.add_enum("sum", pool_enum::kSumPooling)
.describe("Pooling type to be applied.");

DMLC_DECLARE_FIELD(pooling_convention).set_default(pool_enum::kValid)
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is include by MKL2017 implemented layers integration to improve IA perf. on mxnet (#3581)
at that time , mkl pooling do not support Asymmetric padding filled by zeros, by default pool_enum::kValid will use mxnet pooling implmenetation

Copy link
Contributor

Choose a reason for hiding this comment

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

pooling_convention is a useful option. We should keep it

@glingyan
Copy link
Contributor Author

glingyan commented Dec 6, 2016 via email

@piiswrong
Copy link
Contributor

piiswrong commented Dec 6, 2016

Please rebase,
make the comment in config.mk more descriptive (atleast "Please refer to MKL_README.md for details)
verify that test_operator_gpu passes when mkl is on
and we can merge

@glingyan
Copy link
Contributor Author

glingyan commented Dec 7, 2016

done, please check #4128

@futurely
Copy link

This PR should be closed since #4128 has been merged.

@glingyan
Copy link
Contributor Author

glingyan commented Dec 13, 2016 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants