Skip to content

Commit

Permalink
patch maxseqlen handling
Browse files Browse the repository at this point in the history
  • Loading branch information
francoishernandez committed Jan 28, 2025
1 parent 4bf4cab commit 4766b0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eole/modules/rope.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def forward_1d(self, maxseqlen, step=0, prefetch=1024):
step = 0
offset = 32 # make sure we have at least 32 positions for flash_attn_with_kvcache
if step == 0:
maxseqlen = 1024 # reset as in init() with self.update(1024)
maxseqlen = max(maxseqlen, 1024) # reset as in init() with self.update(1024)
elif hasattr(self, "cos") and self.cos.size(0) >= max(offset + (step or 0), 0) + maxseqlen:
return self.cos, self.sin

Expand Down

0 comments on commit 4766b0e

Please sign in to comment.