Skip to content

Commit 05c5280

Browse files
committed
[fix]fix ring-atten-bugs
1 parent 0a6e214 commit 05c5280

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

fastvideo/tests/distributed/test_ring_attention.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ def test_blockwise_lse_merge_matches_full_attention() -> None:
200200

201201
from flash_attn import flash_attn_func
202202

203-
from fastvideo.attention.ring._fa_kernels import _fa_forward
203+
from fastvideo.attention.ring.kernels.attention import (
204+
flash_attn_forward,
205+
)
204206
from fastvideo.attention.ring.utils import update_out_and_lse
205207

206208
device = torch.device("cuda:0")
@@ -255,22 +257,24 @@ def test_blockwise_lse_merge_matches_full_attention() -> None:
255257

256258
softmax_scale = HEAD_SIZE**-0.5
257259

258-
block_out_0, block_lse_0 = _fa_forward(
260+
block_out_0, block_lse_0 = flash_attn_forward(
259261
q,
260262
k0,
261263
v0,
262264
dropout_p=0.0,
263265
softmax_scale=softmax_scale,
264266
causal=False,
267+
softcap=0.0,
265268
)
266269

267-
block_out_1, block_lse_1 = _fa_forward(
270+
block_out_1, block_lse_1 = flash_attn_forward(
268271
q,
269272
k1,
270273
v1,
271274
dropout_p=0.0,
272275
softmax_scale=softmax_scale,
273276
causal=False,
277+
softcap=0.0,
274278
)
275279

276280
merged_out, merged_lse = update_out_and_lse(
@@ -298,7 +302,10 @@ def test_blockwise_lse_merge_matches_full_attention() -> None:
298302
causal=False,
299303
)
300304

301-
_assert_attention_close(merged_out, full_output)
305+
_assert_attention_close(
306+
merged_out,
307+
full_output,
308+
)
302309

303310

304311
def _run_multi_gpu_worker(output_path: Path) -> None:

0 commit comments

Comments
 (0)