Skip to content

Commit 7a7ad46

Browse files
authored
perf: remove unnecessary contiguous operation in block sparse attention (#561)
The contiguous operation is no longer required after #513
1 parent 3fbf028 commit 7a7ad46

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

python/flashinfer/sparse.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,8 @@ def run(
435435
rope_scale = 1.0
436436
if rope_theta is None:
437437
rope_theta = 1e4
438-
439-
k = k.reshape(-1, self.C, *k.shape[-2:]).contiguous()
440-
v = v.reshape(-1, self.C, *v.shape[-2:]).contiguous()
438+
k = k.reshape(-1, self.C, *k.shape[-2:])
439+
v = v.reshape(-1, self.C, *v.shape[-2:])
441440

442441
lse = None
443442
if return_lse:

0 commit comments

Comments
 (0)