Skip to content

Commit db8961a

Browse files
authored
Merge pull request #107 from njzjz/patch-2
set environment variable for Anaconda's numpy 1.17
2 parents d17c857 + 825bf3d commit db8961a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/train/env.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ def set_env_if_empty(key, value):
1818
def set_mkl():
1919
"""Tuning MKL for the best performance
2020
https://www.tensorflow.org/guide/performance/overview
21+
22+
Fixing an issue in numpy built by MKL. See
23+
https://github.com/ContinuumIO/anaconda-issues/issues/11367
24+
https://github.com/numpy/numpy/issues/12374
2125
"""
2226

23-
if 'mkl_info' in np.__config__.__dict__:
27+
# check whether the numpy is built by mkl, see
28+
# https://github.com/numpy/numpy/issues/14751
29+
if 'mkl_rt' in np.__config__.get_info("blas_mkl_info").get('libraries', []):
2430
set_env_if_empty("KMP_BLOCKTIME", "0")
2531
set_env_if_empty("KMP_AFFINITY", "granularity=fine,verbose,compact,1,0")
2632
reload(np)

0 commit comments

Comments
 (0)