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

Support iterators with incompletely defined __len__ functions #2445

Merged
merged 3 commits into from
Sep 8, 2023
Merged
Changes from 1 commit
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
Next Next commit
support iterators with incompletely defined __len__ functions
  • Loading branch information
codedecde committed Oct 25, 2022
commit bf6b6d7d207bb0e79ce41780ba450c6217bfba44
13 changes: 5 additions & 8 deletions deepspeed/runtime/pipe/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@

import torch
from deepspeed import comm as dist

from deepspeed.utils import logger
from deepspeed.utils.timer import ThroughputTimer

from ..engine import DeepSpeedEngine, MEMORY_OPT_ALLREDUCE_SIZE
from ..utils import PartitionedTensor
from ..dataloader import RepeatingLoader

from .module import PipelineModule, PipelineError
from . import p2p
from . import schedule
from ..engine import MEMORY_OPT_ALLREDUCE_SIZE, DeepSpeedEngine
loadams marked this conversation as resolved.
Show resolved Hide resolved
from ..utils import PartitionedTensor
from . import p2p, schedule
from .module import PipelineError, PipelineModule

TARGET_ID = -2
LOG_STAGE = -2
Expand Down Expand Up @@ -332,7 +329,7 @@ def train_batch(self, data_iter=None):
self.global_steps):
self.reset_activation_shape()

if data_iter:
if data_iter is not None:
self.set_dataiterator(data_iter)

self.module.train()
Expand Down