Skip to content

Commit

Permalink
Change parameter order for TimeLimitInterrupter (#749)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #749

Reviewed By: JKSenthil

Differential Revision: D55095781

fbshipit-source-id: e87e0e0d5f29201d748fbd6716a5242fb607b22f
  • Loading branch information
diego-urgell authored and facebook-github-bot committed Mar 20, 2024
1 parent 8e5bad6 commit 92c2822
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchtnt/framework/callbacks/time_limit_interrupter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class TimeLimitInterrupter(Callback):
Args:
duration: Optional, the maximum amount of time to spend in training. Can be specified as a string in the form of DD:HH:MM (days, hours, minutes) or as a timedelta.
For example, to specify 20 hours is "00:20:00".
interval: Can be either "epoch" or "step". Determines whether to check for time limit exceeding on every epoch or step.
interval_freq: How often to check for time limit exceeding. For example, if interval is "epoch" and interval_freq is 2, then the callback will check every two epochs.
timestamp: Optional datetime object indicating the timestamp at which the training should end. The training will be stopped even if the maximum
job duration has not been reached yet. Object must be timezone aware.
interval: Can be either "epoch" or "step". Determines whether to check for time limit exceeding on every epoch or step.
interval_freq: How often to check for time limit exceeding. For example, if interval is "epoch" and interval_freq is 2, then the callback will check every two epochs.
Raises:
ValueError:
Expand All @@ -45,9 +45,9 @@ class TimeLimitInterrupter(Callback):
def __init__(
self,
duration: Optional[Union[str, timedelta]] = None,
timestamp: Optional[datetime] = None,
interval: Literal["epoch", "step"] = "epoch",
interval_freq: int = 1,
timestamp: Optional[datetime] = None,
) -> None:
if not (duration or timestamp):
raise ValueError(
Expand Down

0 comments on commit 92c2822

Please sign in to comment.