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
b3710d2c
Unverified
Commit
b3710d2c
authored
Sep 17, 2024
by
Ke Bao
Committed by
GitHub
Sep 17, 2024
Browse files
Fix attention backend (#1448)
parent
c6b6d2e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
python/sglang/srt/model_executor/model_runner.py
python/sglang/srt/model_executor/model_runner.py
+8
-0
python/sglang/srt/server_args.py
python/sglang/srt/server_args.py
+0
-4
No files found.
python/sglang/srt/model_executor/model_runner.py
View file @
b3710d2c
...
@@ -86,6 +86,14 @@ class ModelRunner:
...
@@ -86,6 +86,14 @@ class ModelRunner:
self
.
is_multimodal_model
=
is_multimodal_model
(
self
.
is_multimodal_model
=
is_multimodal_model
(
self
.
model_config
.
hf_config
.
architectures
self
.
model_config
.
hf_config
.
architectures
)
)
if
(
self
.
model_config
.
attention_arch
==
AttentionArch
.
MLA
and
not
self
.
server_args
.
disable_mla
):
logger
.
info
(
"MLA optimization is tunred on. Use triton backend."
)
self
.
server_args
.
attention_backend
=
"triton"
global_server_args_dict
.
update
(
global_server_args_dict
.
update
(
{
{
"attention_backend"
:
server_args
.
attention_backend
,
"attention_backend"
:
server_args
.
attention_backend
,
...
...
python/sglang/srt/server_args.py
View file @
b3710d2c
...
@@ -173,10 +173,6 @@ class ServerArgs:
...
@@ -173,10 +173,6 @@ class ServerArgs:
self
.
sampling_backend
=
"pytorch"
self
.
sampling_backend
=
"pytorch"
# Default kernel backends
# Default kernel backends
if
not
self
.
disable_mla
:
logger
.
info
(
"MLA optimization is tunred on. Use triton backend."
)
self
.
attention_backend
=
"triton"
if
self
.
attention_backend
is
None
:
if
self
.
attention_backend
is
None
:
self
.
attention_backend
=
"flashinfer"
self
.
attention_backend
=
"flashinfer"
...
...
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