From 3e9844ed3383704aa531781ec497f8fdad6761d6 Mon Sep 17 00:00:00 2001 From: Kdump Date: Thu, 29 Feb 2024 14:35:45 +0800 Subject: [PATCH] [Fix]Fixed the problem of never entering task.run() mode in local scheduling mode. (#930) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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. --- opencompass/runners/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencompass/runners/local.py b/opencompass/runners/local.py index 9a335fe7..35f3928a 100644 --- a/opencompass/runners/local.py +++ b/opencompass/runners/local.py @@ -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)