Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
FlashMLA
Commits
87709cf4
Commit
87709cf4
authored
Sep 24, 2025
by
Shengyu Liu
Browse files
Add a comment
parent
c28eca99
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/test_flash_mla_prefill.py
tests/test_flash_mla_prefill.py
+1
-1
No files found.
tests/test_flash_mla_prefill.py
View file @
87709cf4
...
...
@@ -45,7 +45,7 @@ def generate_testcase(t: TestParam) -> Testcase:
for
b
in
range
(
t
.
b
):
for
s
in
range
(
t
.
s_q
):
for
h
in
range
(
t
.
h_kv
):
#
TODO Comment
#
NOTE We use the following method to generate indices so that most indices lies within [s_kv-20000, s_kv), which is more realistic for sparse attention
near_mask
=
torch
.
randint
(
0
,
32
,
(
min
(
t
.
topk
,
t
.
s_kv
),))
<
31
cur_indices
=
torch
.
randperm
(
t
.
s_kv
)[:
t
.
topk
]
cur_indices
[
near_mask
]
=
torch
.
randint
(
max
(
0
,
t
.
s_kv
-
20000
),
t
.
s_kv
-
1
,
(
near_mask
.
sum
().
item
(),))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment