Skip to content

Commit

Permalink
Update transformer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ofirpress authored Sep 16, 2021
1 parent 7ad5b48 commit 85c73f2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions megatron/model/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ def build_layer(layer_number):
if args.position_embedding_type == PositionEmbeddingType.alibi:
self.alibi = self._build_alibi_tensor(args.seq_length, args.num_attention_heads, args.micro_batch_size).to(torch.cuda.current_device())
if args.params_dtype == torch.float16:
self.alibi = self.alibi.half()
self.alibi = self.alibi.to(torch.bfloat16)
else:
self.alibi = None

Expand Down Expand Up @@ -794,4 +794,3 @@ def forward(self, hidden_states, attention_mask, layer_past=None,
output = [output, presents]

return output

0 comments on commit 85c73f2

Please sign in to comment.