mirror of https://github.com/InternLM/InternLM
fix is_no_pp_or_last_stage logic
parent
6480e03949
commit
83c47d07d1
|
@ -329,7 +329,8 @@ class ParallelContext(metaclass=SingletonMeta):
|
||||||
return self.is_last_rank(ParallelMode.PIPELINE)
|
return self.is_last_rank(ParallelMode.PIPELINE)
|
||||||
|
|
||||||
def is_no_pp_or_last_stage(self):
|
def is_no_pp_or_last_stage(self):
|
||||||
return not self.is_initialized(ParallelMode.PIPELINE) or self.is_pipeline_last_stage()
|
# NOTICE!!!, this will ignore virutal stage
|
||||||
|
return not self.is_initialized(ParallelMode.PIPELINE) or self.is_last_rank(ParallelMode.PIPELINE)
|
||||||
|
|
||||||
def get_world_size(self, parallel_mode: ParallelMode):
|
def get_world_size(self, parallel_mode: ParallelMode):
|
||||||
"""Returns the world size for `parallel_mode`.
|
"""Returns the world size for `parallel_mode`.
|
||||||
|
|
Loading…
Reference in New Issue