Skip to content

[feature] Extend fast_dev_run to accept an integer representing num_batches for unit testing #4228

@tchaton

Description

@tchaton

🚀 Feature

Motivation

Currently fast_dev_run accept only a boolean value.

fast_dev_run meaning: Runs 1 batch of train, test and val to find any bugs (ie: a sort of unit test).

Trainer(fast_dev_run=True)

The new feature will extend fast_dev_run to accept a integer representing the number of batches to use for fast_dev_run allowing better coverage for unit testing.

Trainer(fast_dev_run=2 )

Therefore,

if isinstance(fast_dev_run, int):
    num_batches_for_fast_dev_run = fast_dev_run
    fast_dev_run = fast_dev_run > 0

Pitch

fast_dev_run is really useful for debugging and unit testing. However, sometimes, we want to make aggregation over several batches to make sure everything is correct handled.
Setting fast_dev_run =2 could allow to run 2 batch of train, test and val to find any bugs (ie: better coverage).

Alternatives

Additional context

Metadata

Metadata

Assignees

Labels

featureIs an improvement or enhancementgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions