Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/mcore_bridge/model/gpt_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def forward(
full_attention_mask = full_attention_mask['full_attention']
if mcore_016 and full_attention_mask is not None:
assert packed_seq_params is None
padding_mask = ~((~full_attention_mask).sum(dim=(1, 2)) > 0)
padding_mask = full_attention_mask.all(dim=(1, 2))
if self.config.context_parallel_size > 1:
padding_mask = split_cp_inputs(padding_mask, None, 1)
tp_size = self.config.tensor_model_parallel_size
Expand Down
2 changes: 1 addition & 1 deletion src/mcore_bridge/model/hybrid_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _get_padding_mask(self, attention_mask) -> Optional[torch.Tensor]:
attention_mask = attention_mask['full_attention']
if attention_mask is None:
return None
padding_mask = ~((~attention_mask).sum(dim=(1, 2)) > 0)
padding_mask = attention_mask.all(dim=(1, 2))
if self.config.context_parallel_size > 1:
padding_mask = split_cp_inputs(padding_mask, None, 1)
tp_size = self.config.tensor_model_parallel_size
Expand Down