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
a4306527
Unverified
Commit
a4306527
authored
Dec 05, 2024
by
Konrad Zawora
Committed by
GitHub
Dec 05, 2024
Browse files
[Misc][Gaudi] Avoid torch.compile and enable lazy collectives (#10897)
Signed-off-by:
Konrad Zawora
<
kzawora@habana.ai
>
parent
998eeafe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
vllm/plugins/__init__.py
vllm/plugins/__init__.py
+14
-0
No files found.
vllm/plugins/__init__.py
View file @
a4306527
...
@@ -29,6 +29,20 @@ def load_general_plugins():
...
@@ -29,6 +29,20 @@ def load_general_plugins():
if
current_platform
.
is_xpu
():
if
current_platform
.
is_xpu
():
# see https://github.com/pytorch/pytorch/blob/8cada5cbe5450e17c26fb8b358116785324537b2/torch/_dynamo/config.py#L158 # noqa
# see https://github.com/pytorch/pytorch/blob/8cada5cbe5450e17c26fb8b358116785324537b2/torch/_dynamo/config.py#L158 # noqa
os
.
environ
[
'TORCH_COMPILE_DISABLE'
]
=
'True'
os
.
environ
[
'TORCH_COMPILE_DISABLE'
]
=
'True'
if
current_platform
.
is_hpu
():
# NOTE(kzawora): PT HPU lazy backend (PT_HPU_LAZY_MODE = 1)
# does not support torch.compile
# Eager backend (PT_HPU_LAZY_MODE = 0) must be selected for
# torch.compile support
is_lazy
=
os
.
environ
.
get
(
'PT_HPU_LAZY_MODE'
,
'1'
)
==
'1'
if
is_lazy
:
# see https://github.com/pytorch/pytorch/blob/43c5f59/torch/_dynamo/config.py#L158
torch
.
_dynamo
.
config
.
disable
=
True
# NOTE(kzawora) multi-HPU inference with HPUGraphs (lazy-only)
# requires enabling lazy collectives
# see https://docs.habana.ai/en/latest/PyTorch/Inference_on_PyTorch/Inference_Using_HPU_Graphs.html # noqa: E501
os
.
environ
[
'PT_HPU_ENABLE_LAZY_COLLECTIVES'
]
=
'true'
global
plugins_loaded
global
plugins_loaded
if
plugins_loaded
:
if
plugins_loaded
:
return
return
...
...
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