Skip to content

Commit

Permalink
Add patches for Virtual Parallel conversion (#6589)
Browse files Browse the repository at this point in the history
* Add patches for Virtual Parllel conversion

Signed-off-by: smajumdar <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: smajumdar <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
titu1994 and pre-commit-ci[bot] committed May 8, 2023
1 parent da6bbec commit 1d813a3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def set_virtual_parallel_rank_safely(rank: int):
parallel_state.set_virtual_pipeline_model_parallel_rank(rank)

if rank is None:
parallel_state.set_virtual_pipeline_model_parallel_world_size(0)
parallel_state.set_virtual_pipeline_model_parallel_world_size(None)

except (ImportError, ModuleNotFoundError):
logging.warning("`megatron-core` not installed, cannot set virtual parallel rank !")
Expand Down Expand Up @@ -861,6 +861,10 @@ def main():

convert_vp = vp_size > 1
if convert_vp:
from megatron.core import parallel_state

parallel_state.set_virtual_pipeline_model_parallel_world_size(vp_size)

hparams_filepath = args.hparams_file
if hparams_filepath is None:
logging.warning(
Expand Down

0 comments on commit 1d813a3

Please sign in to comment.