Skip to content

Commit

Permalink
Merge branch 'fix-assert-warning' into 'main'
Browse files Browse the repository at this point in the history
Fix assert warning in !2282

See merge request ADLR/megatron-lm!2443
  • Loading branch information
ericharper committed Dec 12, 2024
2 parents 371feef + 2816445 commit fd69c2f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions megatron/core/rerun_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ def train_step(data_iterator, ...):
for d in data_iterators:
assert (
isinstance(d, RerunDataIterator),
"data iterator is not wrapped with RerunDataIterator",
)
), "data iterator is not wrapped with RerunDataIterator"

# Are we about to start the initial run?
if self.state == RerunState.NOT_RUNNING_YET:
Expand All @@ -263,8 +262,7 @@ def train_step(data_iterator, ...):
if self.data_iterator_checkpoints is not None:
assert (
len(self.data_iterator_checkpoints) == len(data_iterators),
"data_iterator has different length than checkpointed data iterator",
)
), "data iterator has different length than checkpointed data iterator"
for i, d in enumerate(data_iterators):
d.set_checkpoint_state(self.data_iterator_checkpoints[i])
self.data_iterator_checkpoints = None
Expand Down Expand Up @@ -667,8 +665,7 @@ def save_my_model_checkpoint(data_iterator, ...):
for d in data_iterators:
assert (
isinstance(d, RerunDataIterator),
"data iterator is not wrapped with RerunDataIterator",
)
), "data iterator is not wrapped with RerunDataIterator"

state: dict[str, Any] = {
'mode': self.mode,
Expand Down

0 comments on commit fd69c2f

Please sign in to comment.