Skip to content

feat(training): add max_time support to Trainer.fit - #10

Merged
mattia-spider merged 2 commits into
developfrom
feat/timer-listener
Jul 6, 2026
Merged

feat(training): add max_time support to Trainer.fit#10
mattia-spider merged 2 commits into
developfrom
feat/timer-listener

Conversation

@muhrin

@muhrin muhrin commented Jun 23, 2026

Copy link
Copy Markdown
Member

This PR introduces time-based termination for training in reax. Users can now specify a max_time argument when calling trainer.fit(...) to limit training duration, allowing for graceful interruption mid-epoch.

This includes:

  • Implementation of StageTimer to handle time-based termination logic.
  • Integration of max_time into the Fit stage and the Trainer.fit interface.
  • Updated documentation in docs/source/user_guide/trainer.rst with examples demonstrating max_time usage.

Changes:

  • feat: Added max_time support to Trainer and Fit stages.
  • feat: Implemented StageTimer listener.
  • docs: Added usage examples for max_time in trainer.fit().
  • test: Standardized jax config in test/conftest.py and removed jax_debug_nans.

muhrin added 2 commits June 23, 2026 17:29
- Implement StageTimer to handle time-based termination of training.
- Add max_time parameter to Fit stage and integrate the timer as a listener.
- Expose max_time parameter in Trainer to allow passing it down to Fit.
- Update __init__.py to export StageTimer.
- Add unit tests for StageTimer and verify integration with Trainer.fit.
- Add reax_config fixture to test/conftest.py for standardizing jax config in tests.
@muhrin
muhrin requested a review from mattia-spider June 23, 2026 16:01
@muhrin

muhrin commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

@mattia-spider , could you please review this? Are you happy with it?

@mattia-spider mattia-spider 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.

Looks perfect to me. I did some tests locally and seems to work smoothly.

@mattia-spider
mattia-spider merged commit da31ece into develop Jul 6, 2026
18 checks passed
@muhrin

muhrin commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

Thanks!

@muhrin
muhrin deleted the feat/timer-listener branch July 10, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants