Skip to content

Commit

Permalink
Add batch dimension for cos, sin in unsloath test
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei-Aksionov committed Dec 31, 2024
1 parent 1b1b592 commit e20b7d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_unsloth_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def test_unsloth_rope():

B, nh, T, hs = 2, 32, 64, 16
cos, sin = build_rope_cache(T, hs, device="cuda")
cos = cos.unsqueeze(0)
sin = sin.unsqueeze(0)
q = torch.rand((B, nh, T, hs), device="cuda", requires_grad=True)

def foo(x, cos, sin):
Expand Down

0 comments on commit e20b7d9

Please sign in to comment.