Skip to content

Commit b7f2142

Browse files
authored
set environment variable for Anaconda's numpy 1.17
1 parent d17c857 commit b7f2142

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/train/env.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ 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+
if 'mkl_info' in np.__config__.__dict__ or 'mkl_rt' in np.__config__.blas_mkl_info['libraries']:
2428
set_env_if_empty("KMP_BLOCKTIME", "0")
2529
set_env_if_empty("KMP_AFFINITY", "granularity=fine,verbose,compact,1,0")
2630
reload(np)

0 commit comments

Comments
 (0)