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

Fix restore sequence parallel #7273

Merged
merged 4 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,8 @@ def _reset_sequence_parallelism_args(self):

# Reset config values. Needed for calling generate.
self.cfg.sequence_parallel = False
self.model_parallel_config.sequence_parallel = False
self.transformer_config.sequence_parallel = False

# Reset model parameters.
for module in self.get_gpt_module_list():
Expand All @@ -1362,6 +1364,8 @@ def _restore_sequence_parallelism_args(self):
"""
# Restore config values.
self.cfg.sequence_parallel = self.last_sequence_parallel
self.model_parallel_config.sequence_parallel = self.last_sequence_parallel
self.transformer_config.sequence_parallel = self.last_sequence_parallel

# Restore model parameters.
for module in self.get_gpt_module_list():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ def inference_epoch_end(self, outputs, mode, data_cfg):
# Merge the functionality of previous on_inference_epoch_end() within inference_epoch_end() func here
app_state = AppState()
self._restore_activation_checkpointing_args()
self._restore_sequence_parallelism_args()
if hasattr(self, "_train_ds"):
_reconfigure_microbatch_calculator(
rank=app_state.global_rank,
Expand Down
Loading