Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix style #3420

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer/core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def _iteration_length(self):
def _iteration_length(self, iteration_length: Optional[Union[str, Time[int]]]):
"""Sets the length of an iteration.

An iteration must be defined as multiple epochs. See composer/core/event.py.
An iteration must be defined as multiple epochs or tokens. See composer/core/event.py.
"""
if iteration_length is None:
self.__iteration_length = None
Expand All @@ -777,7 +777,7 @@ def stop_training(self):
logging, and evaluation for that batch, as well as any epoch end events.
"""
# Set the max_duration to the current time in its unit, except if the unit is TimeUnit.EPOCH. This is because TimeUnit.EPOCH is a very crude way to measure max duration. For example, it will result in division by zero error while computing get_elapsed_duration: https://github.com/mosaicml/composer/blob/1b9c6d3c0592183b947fd89890de0832366e33a7/composer/core/state.py#L641
if self.max_duration is not None and Time.from_input(self.max_duration,).unit != TimeUnit.EPOCH:
if self.max_duration is not None and Time.from_input(self.max_duration).unit != TimeUnit.EPOCH:
max_duration_unit = Time.from_input(self.max_duration).unit
self.max_duration = self.timestamp.get(max_duration_unit)
else:
Expand Down
Loading