Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
f256ebe4
Unverified
Commit
f256ebe4
authored
Feb 02, 2025
by
Kunshang Ji
Committed by
GitHub
Feb 02, 2025
Browse files
[Hardware][Intel GPU] add XPU bf16 support (#12392)
Signed-off-by:
Kunshang Ji
<
kunshang.ji@intel.com
>
parent
f8ece6e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
docs/source/getting_started/installation/gpu/xpu.inc.md
docs/source/getting_started/installation/gpu/xpu.inc.md
+1
-1
vllm/platforms/xpu.py
vllm/platforms/xpu.py
+20
-3
No files found.
docs/source/getting_started/installation/gpu/xpu.inc.md
View file @
f256ebe4
...
...
@@ -36,7 +36,7 @@ VLLM_TARGET_DEVICE=xpu python setup.py install
:::{note}
-
FP16 is the default data type in the current XPU backend. The BF16 data
type
will be
supported
i
n
the future
.
type
is supported on Intel Data Center GPU, not
supported
o
n
Intel Arc GPU yet
.
:::
## Set up using Docker
...
...
vllm/platforms/xpu.py
View file @
f256ebe4
...
...
@@ -66,9 +66,14 @@ class XPUPlatform(Platform):
# check and update model config
model_config
=
vllm_config
.
model_config
if
model_config
.
dtype
==
torch
.
bfloat16
:
logger
.
warning
(
"bfloat16 is not fully supported on XPU, casting to float16."
)
model_config
.
dtype
=
torch
.
float16
bf16_supported
=
cls
.
device_support_bf16
()
if
not
bf16_supported
:
logger
.
warning
(
"bfloat16 is only supported on Intel Data Center GPU, "
"Intel Arc GPU is not supported yet. Your device is %s,"
"which is not supported. will fallback to float16"
,
cls
.
get_device_name
())
model_config
.
dtype
=
torch
.
float16
if
not
model_config
.
enforce_eager
:
logger
.
warning
(
"CUDA graph is not supported on XPU, fallback to the eager "
...
...
@@ -116,3 +121,15 @@ class XPUPlatform(Platform):
)
->
float
:
torch
.
xpu
.
reset_peak_memory_stats
(
device
)
return
torch
.
xpu
.
max_memory_allocated
(
device
)
@
classmethod
def
device_support_bf16
(
cls
)
->
bool
:
device_name
=
cls
.
get_device_name
().
lower
()
if
device_name
.
count
(
"arc"
)
>
0
:
return
False
elif
device_name
.
count
(
"data center gpu"
)
>
0
:
return
True
else
:
logger
.
warning
(
"Unknown device name %s, always use float16"
,
device_name
)
return
False
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