浏览代码

Adjust KMP and interop thread settings

/develop/adjust-cpu-settings-experiment
Ervin Teng 4 年前
当前提交
31675a11
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
      ml-agents/mlagents/torch_utils/torch.py

6
ml-agents/mlagents/torch_utils/torch.py


import os
# Detect availability of torch package here.
# NOTE: this try/except is temporary until torch is required for ML-Agents.
try:

torch.set_num_interop_threads(2)
os.environ["KMP_AFFINITY"] = "granularity=fine,compact,1,0"
os.environ["KMP_BLOCKTIME"] = "0"
# Known PyLint compatibility with PyTorch https://github.com/pytorch/pytorch/issues/701
# pylint: disable=E1101

正在加载...
取消
保存