Skip to content

Commit 1f1b56d

Browse files
set MKL_NUM_THREADS (PaddlePaddle#75880)
* MKL_NUM_THREADS * fix * str(os.cpu_count()) * fix2
1 parent c34161d commit 1f1b56d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/paddle/base/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ def __bootstrap__():
167167
if os.getenv('NVIDIA_TF32_OVERRIDE', None) is None:
168168
os.environ['NVIDIA_TF32_OVERRIDE'] = '0'
169169

170+
if os.getenv('MKL_NUM_THREADS', None) is None:
171+
os.environ['MKL_NUM_THREADS'] = str(int(0.8 * os.cpu_count()))
172+
170173
flag_prefix = "FLAGS_"
171174
read_env_flags = [
172175
key[len(flag_prefix) :]

0 commit comments

Comments
 (0)