[feature request] making the use of the `accelerate` launcher optional

Open
#2,585 6 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python, pytorch

Research direction

Review the linked Lightning and srun launcher examples, especially how they set RANK and LOCAL_RANK before starting the Python program. Define how the existing Accelerate config can be reused without the accelerate launcher while retaining DeepSpeed and FSDP support; done when both launcher-based and externally launched distributed runs are supported.

Written by the indexing model from the issue text.

Description

enhancement feature request

Sometimes there is a need to be able to launch an Accelerate-based program w/o the accelerate launcher - for example, in case once wants to use the super-optimized SLURM resource placements and having srun launch all the individual per-gpu processes.

e.g. Lightning doesn't use a launcher, e.g. see here and here is how I can launch a normal torch.distributed multi-gpu program w/o torchrun: here -or more specifically it's just:

srun bash -c "RANK=\$SLURM_PROCID LOCAL_RANK=\$SLURM_LOCALID python my-dist-prog.py"

which to the program is just:

RANK=... LOCAL_RANK=... python my-dist-prog.py

Of course, we want the advanced features supported - so Deepspeed/FSDP, etc.

And ideally, it'd be the same accelerate config file - so it can be re-used w/ and w/o the launcher.

Thank you.

Dominant language
Python
Stars
9.9k
Forks
1.6k
Avg merge
2d 13h
Merged PRs (30d)
13

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from huggingface/accelerate

All issues in huggingface/accelerate

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.