Skip to content

Commit 3a8ff0f

Browse files
committed
Merge branch 'lm-rope-bugfix' into 'main'
change megatron-lm to use core rope api See merge request ADLR/megatron-lm!842
2 parents 8ca2d59 + 32749ea commit 3a8ff0f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

megatron/model/language_model.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,12 @@ def __init__(self,
366366
rotary_dim = args.hidden_size // args.num_attention_heads \
367367
if args.kv_channels is None else args.kv_channels
368368

369-
if args.rotary_percent < 1.0:
370-
rotary_dim = int(rotary_dim * args.rotary_percent)
371-
372369
# partial rotary embeddings, which is better than full rotary
373370
# Wang and Komatsuzaki et al
374371
# https://github.com/kingoflolz/mesh-transformer-jax/
375372
self.rotary_pos_emb = RotaryEmbedding(
376373
rotary_dim,
374+
args.rotary_percent,
377375
seq_len_interpolation_factor=args.rotary_seq_len_interpolation_factor
378376
)
379377

0 commit comments

Comments
 (0)