Skip to content

Commit

Permalink
perf: remove unnecessary contiguous operation in block sparse attenti…
Browse files Browse the repository at this point in the history
…on (#561)

The contiguous operation is no longer required after #513
  • Loading branch information
yzh119 authored Oct 26, 2024
1 parent 3fbf028 commit 7a7ad46
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/flashinfer/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,8 @@ def run(
rope_scale = 1.0
if rope_theta is None:
rope_theta = 1e4

k = k.reshape(-1, self.C, *k.shape[-2:]).contiguous()
v = v.reshape(-1, self.C, *v.shape[-2:]).contiguous()
k = k.reshape(-1, self.C, *k.shape[-2:])
v = v.reshape(-1, self.C, *v.shape[-2:])

lse = None
if return_lse:
Expand Down

0 comments on commit 7a7ad46

Please sign in to comment.