未验证 提交 5618f140 编写于 作者: L Leo Chen 提交者: GitHub

fix reading flags from env (#31329)

上级 a1ddff81
...@@ -218,7 +218,7 @@ def __bootstrap__(): ...@@ -218,7 +218,7 @@ def __bootstrap__():
read_env_flags.append('tracer_mkldnn_ops_on') read_env_flags.append('tracer_mkldnn_ops_on')
read_env_flags.append('tracer_mkldnn_ops_off') read_env_flags.append('tracer_mkldnn_ops_off')
if core.is_compiled_with_cuda() or core.is_compiled_with_npu(): if core.is_compiled_with_cuda():
read_env_flags += [ read_env_flags += [
'fraction_of_gpu_memory_to_use', 'fraction_of_gpu_memory_to_use',
'initial_gpu_memory_in_mb', 'initial_gpu_memory_in_mb',
...@@ -236,7 +236,13 @@ def __bootstrap__(): ...@@ -236,7 +236,13 @@ def __bootstrap__():
] ]
if core.is_compiled_with_npu(): if core.is_compiled_with_npu():
read_env_flags += ['selected_npus', ] read_env_flags += [
'selected_npus',
'fraction_of_gpu_memory_to_use',
'initial_gpu_memory_in_mb',
'reallocate_gpu_memory_in_mb',
'gpu_memory_limit_mb',
]
core.init_gflags(["--tryfromenv=" + ",".join(read_env_flags)]) core.init_gflags(["--tryfromenv=" + ",".join(read_env_flags)])
core.init_glog(sys.argv[0]) core.init_glog(sys.argv[0])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册