mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
[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:
parent
4c45a71bbc
commit
3e9844ed33
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user