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
67c424cc
"vscode:/vscode.git/clone" did not exist on "be3dfa5049d588d8e1e5dc7c256b45dbcb3af8d4"
Unverified
Commit
67c424cc
authored
Nov 07, 2024
by
HAI
Committed by
GitHub
Nov 07, 2024
Browse files
[Performance, Triton Kernel Args] extend_attention, optimize kern args to _fwd_kernel (#1941)
parent
1ae270c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
python/sglang/srt/layers/attention/triton_ops/extend_attention.py
...glang/srt/layers/attention/triton_ops/extend_attention.py
+6
-0
No files found.
python/sglang/srt/layers/attention/triton_ops/extend_attention.py
View file @
67c424cc
...
...
@@ -25,6 +25,7 @@ import triton.language as tl
from
sglang.srt.layers.attention.triton_ops.prefill_attention
import
(
context_attention_fwd
,
)
from
sglang.srt.utils
import
is_hip
is_cuda_available
=
torch
.
cuda
.
is_available
()
if
is_cuda_available
:
...
...
@@ -311,6 +312,10 @@ def extend_attention_fwd(
num_warps
=
4
if
Lk
<=
64
else
8
num_stages
=
1
extra_kargs
=
{}
if
is_hip
():
extra_kargs
=
{
"waves_per_eu"
:
4
,
"matrix_instr_nonkdim"
:
16
,
"kpack"
:
2
}
_fwd_kernel
[
grid
](
q_extend
,
k_extend
,
...
...
@@ -348,6 +353,7 @@ def extend_attention_fwd(
Lv
=
Lv
,
num_warps
=
num_warps
,
num_stages
=
num_stages
,
**
extra_kargs
,
)
...
...
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