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
e57c3e12
Unverified
Commit
e57c3e12
authored
Nov 19, 2024
by
HAI
Committed by
GitHub
Nov 19, 2024
Browse files
Use native fp8 format on MI300X (#2094)
parent
f239268f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
python/sglang/srt/model_executor/model_runner.py
python/sglang/srt/model_executor/model_runner.py
+5
-1
No files found.
python/sglang/srt/model_executor/model_runner.py
View file @
e57c3e12
...
...
@@ -60,6 +60,7 @@ from sglang.srt.utils import (
crash_on_warnings
,
enable_show_time_cost
,
get_available_gpu_memory
,
is_hip
,
monkey_patch_vllm_model_config
,
monkey_patch_vllm_p2p_access_check
,
)
...
...
@@ -440,7 +441,10 @@ class ModelRunner:
if
self
.
server_args
.
kv_cache_dtype
==
"auto"
:
self
.
kv_cache_dtype
=
self
.
dtype
elif
self
.
server_args
.
kv_cache_dtype
==
"fp8_e5m2"
:
self
.
kv_cache_dtype
=
torch
.
float8_e5m2
if
is_hip
():
# Using natively supported format
self
.
kv_cache_dtype
=
torch
.
float8_e5m2fnuz
else
:
self
.
kv_cache_dtype
=
torch
.
float8_e5m2
else
:
raise
ValueError
(
f
"Unsupported kv_cache_dtype:
{
self
.
server_args
.
kv_cache_dtype
}
."
...
...
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