Skip to content

feat: add --num_sanity_val_steps CLI argument to train_model#694

Open
Kirwa-web wants to merge 2 commits into
mllam:mainfrom
Kirwa-web:feat/num-sanity-val-steps
Open

feat: add --num_sanity_val_steps CLI argument to train_model#694
Kirwa-web wants to merge 2 commits into
mllam:mainfrom
Kirwa-web:feat/num-sanity-val-steps

Conversation

@Kirwa-web

@Kirwa-web Kirwa-web commented Jun 28, 2026

Copy link
Copy Markdown

Describe your changes

Adds a --num_sanity_val_steps argument to control the number of sanity validation steps run before training, as referenced in #138.

  • Adds --num_sanity_val_steps to the Training Options argument group (default: 2, matching PyTorch Lightning's default)
  • Passes the argument to pl.Trainer via num_sanity_val_steps=args.num_sanity_val_steps

This is useful for debugging training runs without waiting through full sanity validation steps.

Checklist before requesting a review

  • My branch is up-to-date with the target branch - if not update your fork with the changes from the target branch (use pull with --rebase option if possible).
  • I have performed a self-review of my code
  • For any new/modified functions/classes I have added docstrings that clearly describe its purpose, expected inputs and returned values
  • I have placed in-line comments to clarify the intent of any hard-to-understand passages of my code
  • I have updated the README to cover introduced code changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have given the PR a name that clearly describes the change, written in imperative form (context).
  • I have requested a reviewer and an assignee (assignee is responsible for merging). This applies only if you have write access to the repo, otherwise feel free to tag a maintainer to add a reviewer and assignee.

Checklist for reviewers

Each PR comes with its own improvements and flaws. The reviewer should check the following:

  • the code is readable
  • the code is well tested
  • the code is documented (including return types and parameters)
  • the code is easy to maintain

Author checklist after completed review

  • I have added a line to the CHANGELOG describing this change, in a section
    reflecting type of change (add section where missing):
    • added: when you have added new functionality
    • changed: when default behaviour of the code has been changed
    • fixes: when your contribution fixes a bug
    • maintenance: when your contribution is relates to repo maintenance, e.g. CI/CD or documentation

Checklist for assignee

  • PR is up to date with the base branch
  • the tests pass
  • (if the PR is not just maintenance/bugfix) the PR is assigned to the next milestone. If it is not, propose it for a future milestone.
  • author has added an entry to the changelog (and designated the change as added, changed, fixed or maintenance)
  • Once the PR is ready to be merged, squash commits and merge the PR.

@Kirwa-web

Copy link
Copy Markdown
Author

@joeloskarsson would appreciate a review when you get a chance. This adds the --num_sanity_val_steps argument referenced in #138.

@joeloskarsson joeloskarsson self-assigned this Jul 3, 2026

@joeloskarsson joeloskarsson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition, this looks good to me!

I don't see a reasonable way to add a test for this, as that would pretty much mean testing pure pytorch lightning functionality. We are here just exposing an argument of the pl.Trainer.

@joeloskarsson joeloskarsson added enhancement New feature or request ready Review complete - proposed for milestone labels Jul 3, 2026
@joeloskarsson joeloskarsson added this to the v0.7.0 (proposed) milestone Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready Review complete - proposed for milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants