Skip to content

Adding support for Accelerate launch#4

Open
hmcgovern wants to merge 3 commits intoTomLippincott:masterfrom
hmcgovern:accelerate-launch
Open

Adding support for Accelerate launch#4
hmcgovern wants to merge 3 commits intoTomLippincott:masterfrom
hmcgovern:accelerate-launch

Conversation

@hmcgovern
Copy link

@hmcgovern hmcgovern commented Oct 21, 2024

In this pull request, I modify the regex found in src/steamroller/engines/local_engine.py and src/steamroller/engines/slurm_engine.py to allow for launching either with Python or with 'accelerate launch' to allow compatibility with the accelerate module for multi-GPU training/inference.

N.B. accelerate config should still be run prior to launching scripts, as this regex does not parse additional command line arguments given to accelerate, such as --num_processes.

# old
m = re.match(r"^\s*(\S*[Pp]ython3?)\s+(.*?\.py)\s+(.*)$", commands[0])
# new
m = re.match(r"^\s*((?:\S*[Pp]ython3?)|(?:accelerate launch))\s+(.*?\.py)\s+(.*)$", commands[0])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant