Lightning-AI / Lightning-AI/pytorch-lightning
Easier access to train_batch_idx for control
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
### Description & Motivation
Global step is defined in terms of optimizer steps, for multi optimizer training most flow control is easier defined in terms of train batches
### Pitch
There are possibilities to access the train batch index for example with `self.trainer.fit_loop.batch_idx` but for example there is no option to use instead of Trainer `max_steps`. The suggestion is to provide an option to use train_batch_idx instead of steps in all APIs.
### Alternatives
Leave unchanged
### Additional context
_No response_
cc @borda
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the exposed self.trainer.fit_loop.batch_idx entry point and the Trainer max_steps API mentioned in the issue. Trace how step limits are consumed across the training APIs, then define the affected scope and verify that train-batch-based control works consistently with multi-optimizer training.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100