Lightning-AI / Lightning-AI/pytorch-lightning

`BatchSizeFinder` with method `fit` and separate batch_size attributes for train and val (e.g., `self.train_batch_size` and `self.val_batch_size`)

Open
#20,562 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactor tuner
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

### Outline & Motivation

I suggest allowing `batch_arg_name` to accept a list of arg names. E.g. `tuner.scale_batch_size(..., batch_arg_name=["train_batch_size", "val_batch_size").

### Pitch

Fit uses both train and val dataloaders. They can have their own batch sizes.

### Additional context

_No response_

cc @lantiga @justusschock

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 by locating BatchSizeFinder and the scale_batch_size entry point, then trace how fit handles its train and validation dataloaders. Define the behavior for a list passed as batch_arg_name, including how separate train and validation batch sizes are tuned, and verify the existing batch-size tuning tests cover the new API.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.