Lightning-AI / Lightning-AI/pytorch-lightning

Make the default auto-requeue signal in SLURM environments configurable

Open
#21,404 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature needs triage
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

### Description & Motivation

I have to use a requeue-signal other than `SIGUSR1` for technical reasons, which is the hard coded default at the moment. While I can use `SLURMEnvironment(requeue_signal=signal.SIGUSR2)` as a plugin, I would like to only set that in cases where I actually am in a SLURM environment without having to re-implement the environment detection inside of lightning. In other words, I still want to be able to just run my script locally in a `LightningEnvironment`.

### Pitch

I want to move the hard-coded constant [here](https://github.com/Lightning-AI/pytorch-lightning/blob/master/src/lightning/fabric/plugins/environments/slurm.py#L51) into a class constant, so that I can change it from the outside.

### Alternatives

Re-implementing environment detection myself so that I can pass an argument to just the SLURM environment, but that seems like too much work and needless duplication.

### Additional context

_No response_

cc @lantiga

Contributor guide

Open the contributing guide

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.

Research direction

Start with src/lightning/fabric/plugins/environments/slurm.py and inspect the hard-coded requeue signal and how SLURMEnvironment is selected. Make the default signal externally configurable while preserving automatic local LightningEnvironment use; done means callers can change the SLURM default without reimplementing environment detection.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
infrastructure
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.