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

Bug fix to reset sequence parallelism #6756

Merged
merged 3 commits into from
May 31, 2023
Merged
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 @@ -1170,12 +1170,13 @@ def _reset_sequence_parallelism_args(self):
self.last_sequence_parallel = self.cfg.sequence_parallel

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

# Reset model parameters.

for module in self.get_gpt_module_list():
module.language_model.encoder.sequence_parallel = None
for mod in module.modules():
if hasattr(mod, "sequence_parallel"):
mod.sequence_parallel = self.last_sequence_parallel

def _restore_sequence_parallelism_args(self):
""" Restores the sequence parallelism parameters using the values saved by
Expand All @@ -1187,4 +1188,6 @@ def _restore_sequence_parallelism_args(self):

# Restore model parameters.
for module in self.get_gpt_module_list():
module.language_model.encoder.sequence_parallel = self.last_sequence_parallel
for mod in module.modules():
if hasattr(mod, "sequence_parallel"):
mod.sequence_parallel = self.last_sequence_parallel