[Fix]Fixed the problem of never entering task.run() mode in local scheduling mode. (#930)

* Fixed the problem of never entering task.run() mode in local scheduling mode.

get_command_template方法中为命令行前缀添加了CUDA_VISIBLE_DEVICES=或set CUDA_VISIBLE_DEVICES=。导致task.run()分支失效。
---------
CUDA_VISIBLE_DEVICES= or set CUDA_VISIBLE_DEVICES= is added to the command line prefix in the get_command_template method. Causes the task.run() branch to fail.

* [Fix]Fixed the problem of never entering task.run() mode in local scheduling mode.

get_command_template方法中为命令行前缀添加了CUDA_VISIBLE_DEVICES=或set CUDA_VISIBLE_DEVICES=。导致task.run()分支失效。
---
CUDA_VISIBLE_DEVICES= or set CUDA_VISIBLE_DEVICES= is added to the command line prefix in the get_command_template method. Causes the task.run() branch to fail.

* [Fix]Fixed the problem of never entering task.run() mode in local scheduling mode.

get_command_template方法中为命令行前缀添加了CUDA_VISIBLE_DEVICES=或set CUDA_VISIBLE_DEVICES=。导致task.run()分支失效。
CUDA_VISIBLE_DEVICES= or set CUDA_VISIBLE_DEVICES= is added to the command line prefix in the get_command_template method. Causes the task.run() branch to fail.
This commit is contained in:
Kdump 2024-02-29 14:35:45 +08:00 committed by GitHub
parent 4c45a71bbc
commit 3e9844ed33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,7 +99,7 @@ class LocalRunner(BaseRunner):
tmpl = get_command_template(all_gpu_ids[:num_gpus])
cmd = task.get_command(cfg_path=param_file, template=tmpl)
# run in subprocess if starts with torchrun etc.
if cmd.startswith('python'):
if 'python3 ' in cmd or 'python ' in cmd:
task.run()
else:
subprocess.run(cmd, shell=True, text=True)