比较提交

...
此合并请求有变更与目标分支冲突。
/ml-agents/mlagents/torch_utils/cpu_utils.py
/ml-agents/mlagents/trainers/stats.py

4 次代码提交

作者 SHA1 备注 提交日期
vincentpierre 022c52de _ 4 年前
vincentpierre 8d81ba36 _ 4 年前
vincentpierre 3e978ab7 _ 4 年前
vincentpierre a2149922 _ 4 年前
共有 2 个文件被更改,包括 12 次插入0 次删除
  1. 3
      ml-agents/mlagents/trainers/stats.py
  2. 9
      ml-agents/mlagents/torch_utils/cpu_utils.py

3
ml-agents/mlagents/trainers/stats.py


from mlagents.tf_utils import tf, generate_session_config
from mlagents.tf_utils.globals import get_rank
from mlagents.torch_utils import cpu_utils
logger = get_logger(__name__)

else:
log_info.append("No episode was completed since last summary")
log_info.append(is_training)
log_info.append("NUM CPU " + str(cpu_utils.get_num_threads_to_use()))
logger.info(". ".join(log_info))
def add_property(

9
ml-agents/mlagents/torch_utils/cpu_utils.py


import os
from mlagents_envs.logging_util import get_logger
logger = get_logger(__name__)
def get_num_threads_to_use() -> Optional[int]:
"""

"""
num_cpus = _get_num_available_cpus()
print("NUM_CPU ", num_cpus)
logger.info("\n\n\n\n\n NUMCPU " + str(num_cpus) + "\n\n\n\n\n")
return max(min(num_cpus // 2, 4), 1) if num_cpus is not None else None

for Docker containers that are limited in cores.
"""
period = _read_in_integer_file("/sys/fs/cgroup/cpu/cpu.cfs_period_us")
logger.info("period "+str(period))
logger.info("quota " + str(quota))
shares = _read_in_integer_file("/sys/fs/cgroup/cpu/cpu.shares")
logger.info("shares "+str(shares))
if period > 0 and quota > 0:
return int(quota // period)
else:

正在加载...
取消
保存