Skip to content
Open
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
3 changes: 1 addition & 2 deletions megatron/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_ltor_masks_and_position_ids(data,
attention_mask = None
if not skip_mask:
attention_mask = torch.tril(torch.ones(
(att_mask_batch, seq_length, seq_length))).view(att_mask_batch, 1, seq_length, seq_length)
(att_mask_batch, seq_length, seq_length), device=data.device)).view(att_mask_batch, 1, seq_length, seq_length)

# Loss mask.
loss_mask = torch.ones(data.size(), dtype=torch.float, device=data.device)
Expand Down Expand Up @@ -218,7 +218,6 @@ def get_ltor_masks_and_position_ids(data,
# Convert attention mask to binary:
if not skip_mask:
attention_mask = (attention_mask < 0.5)
attention_mask = attention_mask.to(data.device)

return attention_mask, loss_mask, position_ids

Expand Down