This commit is contained in:
Eugene Rakhmatulin
2026-03-18 13:26:39 -07:00
parent f327b92abe
commit 2755b62d12

View File

@@ -462,12 +462,13 @@ def generate_launch_script(recipe: dict[str, Any], overrides: dict[str, Any], is
# (not needed for solo; no-ray uses PyTorch distributed instead)
if is_solo or no_ray:
import re
# Remove the entire line containing --distributed-executor-backend
# This handles multi-line commands with backslash continuations
# Remove just the flag and its value, not the whole line
command = re.sub(r'--distributed-executor-backend\s+\S+', '', command)
# Remove lines that are now empty or just a backslash continuation
lines_list = command.split('\n')
filtered_lines = [
line for line in lines_list
if '--distributed-executor-backend' not in line
if line.strip() not in ('', '\\')
]
command = '\n'.join(filtered_lines)