Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
db71c38f
"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "edf22c052e0d91eca4687ee678b06a485f78666d"
Unverified
Commit
db71c38f
authored
Sep 18, 2025
by
Yi Zhang
Committed by
GitHub
Sep 18, 2025
Browse files
Scale kkt after reduction (#10604)
parent
7a68b422
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
python/sglang/srt/layers/attention/fla/chunk_scaled_dot_kkt.py
...n/sglang/srt/layers/attention/fla/chunk_scaled_dot_kkt.py
+2
-2
No files found.
python/sglang/srt/layers/attention/fla/chunk_scaled_dot_kkt.py
View file @
db71c38f
...
@@ -74,8 +74,7 @@ def chunk_scaled_dot_kkt_fwd_kernel(
...
@@ -74,8 +74,7 @@ def chunk_scaled_dot_kkt_fwd_kernel(
(
1
,
0
),
(
1
,
0
),
)
)
b_k
=
tl
.
load
(
p_k
,
boundary_check
=
(
0
,
1
))
b_k
=
tl
.
load
(
p_k
,
boundary_check
=
(
0
,
1
))
b_kb
=
b_k
*
b_beta
[:,
None
]
b_A
+=
tl
.
dot
(
b_k
,
tl
.
trans
(
b_k
))
b_A
+=
tl
.
dot
(
b_kb
.
to
(
b_k
.
dtype
),
tl
.
trans
(
b_k
))
if
USE_G
:
if
USE_G
:
p_g
=
tl
.
make_block_ptr
(
p_g
=
tl
.
make_block_ptr
(
...
@@ -85,6 +84,7 @@ def chunk_scaled_dot_kkt_fwd_kernel(
...
@@ -85,6 +84,7 @@ def chunk_scaled_dot_kkt_fwd_kernel(
b_g_diff
=
b_g
[:,
None
]
-
b_g
[
None
,
:]
b_g_diff
=
b_g
[:,
None
]
-
b_g
[
None
,
:]
b_A
=
b_A
*
safe_exp
(
b_g_diff
)
b_A
=
b_A
*
safe_exp
(
b_g_diff
)
b_A
*=
b_beta
[:,
None
]
b_A
=
tl
.
where
(
o_t
[:,
None
]
>
o_t
[
None
,
:],
b_A
,
0
)
b_A
=
tl
.
where
(
o_t
[:,
None
]
>
o_t
[
None
,
:],
b_A
,
0
)
p_A
=
tl
.
make_block_ptr
(
p_A
=
tl
.
make_block_ptr
(
A
+
(
bos
*
H
+
i_h
)
*
BT
,
(
T
,
BT
),
(
BT
*
H
,
1
),
(
i_t
*
BT
,
0
),
(
BT
,
BT
),
(
1
,
0
)
A
+
(
bos
*
H
+
i_h
)
*
BT
,
(
T
,
BT
),
(
BT
*
H
,
1
),
(
i_t
*
BT
,
0
),
(
BT
,
BT
),
(
1
,
0
)
...
...
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