Skip to content

Commit

Permalink
Fix assertion to run pipeline engine with a compiled module (#5197)
Browse files Browse the repository at this point in the history
This PR fixes assertion in the pipeline engine to compute a compile
module with pipeline parallelism.
  • Loading branch information
tohtana authored Feb 27, 2024
1 parent 07a1ede commit aed599b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deepspeed/runtime/pipe/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ class PipelineEngine(DeepSpeedEngine):

def __init__(self, has_bool_tensors=False, *super_args, **super_kwargs):
super().__init__(*super_args, **super_kwargs)
assert isinstance(self.module, PipelineModule), "model must base PipelineModule"
assert isinstance(self.module, PipelineModule) \
or (hasattr(self.module, 'wrapped') and isinstance(self.module.wrapped, PipelineModule)), \
"model must base PipelineModule"

assert self.zero_optimization_stage(
) < ZeroStageEnum.gradients, "ZeRO-2 and ZeRO-3 are incompatible with pipeline parallelism"
Expand Down

0 comments on commit aed599b

Please sign in to comment.