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

Remove broadcast from T5 prompt learning inference #5558

Merged
merged 1 commit into from
Dec 7, 2022
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 @@ -464,15 +464,6 @@ def predict_step(self, batch: Any, batch_idx: int, dataloader_idx: int = 0) -> A
else:
encoder_input = torch.zeros((batch_size, seq_length, self.hidden_size), dtype=self.autocast_dtype).cuda()

if self.cfg.get('pipeline_model_parallel_size', 1) > 1:
# Broadcasting encoder inputs to all ranks for now, but this is inefficent.
# TODO: Make Enc-Dec improvement to only boardcast encoder_ids/embeddings when needed
torch.distributed.broadcast(
encoder_input,
parallel_state.get_pipeline_model_parallel_first_rank(),
group=parallel_state.get_pipeline_model_parallel_group(),
)

predicted_token_ids, log_probs = self.frozen_model.decode(
tokens_enc=input_ids,
enc_mask=enc_mask,
Expand Down