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
debbdb51
Unverified
Commit
debbdb51
authored
Sep 12, 2024
by
Zihao Ye
Committed by
GitHub
Sep 12, 2024
Browse files
kernel: use tensor cores for flashinfer gqa kernels (#1403)
parent
3efa7981
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
python/sglang/srt/layers/attention_backend.py
python/sglang/srt/layers/attention_backend.py
+11
-3
No files found.
python/sglang/srt/layers/attention_backend.py
View file @
debbdb51
...
@@ -79,9 +79,17 @@ class FlashInferAttnBackend(AttentionBackend):
...
@@ -79,9 +79,17 @@ class FlashInferAttnBackend(AttentionBackend):
super
().
__init__
()
super
().
__init__
()
self
.
model_runner
=
model_runner
self
.
model_runner
=
model_runner
if
not
_grouped_size_compiled_for_decode_kernels
(
local_num_qo_heads
=
(
model_runner
.
model_config
.
num_attention_heads
//
model_runner
.
tp_size
,
model_runner
.
model_config
.
num_attention_heads
//
model_runner
.
tp_size
model_runner
.
model_config
.
get_num_kv_heads
(
model_runner
.
tp_size
),
)
local_num_kv_heads
=
model_runner
.
model_config
.
get_num_kv_heads
(
model_runner
.
tp_size
)
if
(
not
_grouped_size_compiled_for_decode_kernels
(
local_num_qo_heads
,
local_num_kv_heads
)
or
local_num_qo_heads
//
local_num_kv_heads
>
4
):
):
self
.
decode_use_tensor_cores
=
True
self
.
decode_use_tensor_cores
=
True
else
:
else
:
...
...
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