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
bc84829b
Commit
bc84829b
authored
Sep 18, 2024
by
zhuwenwen
Browse files
update platforms init
parent
ad58e9b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
vllm/attention/selector.py
vllm/attention/selector.py
+1
-2
vllm/platforms/__init__.py
vllm/platforms/__init__.py
+10
-7
No files found.
vllm/attention/selector.py
View file @
bc84829b
...
...
@@ -203,8 +203,7 @@ def which_attn_to_use(
selected_backend
=
(
_Backend
.
ROCM_FLASH
if
selected_backend
==
_Backend
.
FLASH_ATTN
else
selected_backend
)
if
selected_backend
==
_Backend
.
ROCM_FLASH
:
# if current_platform.get_device_capability()[0] != 9:
if
torch
.
cuda
.
get_device_capability
()[
0
]
!=
9
:
if
current_platform
.
get_device_capability
()[
0
]
!=
9
:
# not Instinct series GPUs.
logger
.
info
(
"flash_attn is not supported on NAVI GPUs."
)
else
:
...
...
vllm/platforms/__init__.py
View file @
bc84829b
import
torch
from
.interface
import
Platform
,
PlatformEnum
,
UnspecifiedPlatform
current_platform
:
Platform
...
...
@@ -32,13 +33,15 @@ except Exception:
is_rocm
=
False
try
:
import
amdsmi
amdsmi
.
amdsmi_init
()
try
:
if
len
(
amdsmi
.
amdsmi_get_processor_handles
())
>
0
:
is_rocm
=
True
finally
:
amdsmi
.
amdsmi_shut_down
()
if
torch
.
version
.
hip
is
not
None
:
is_rocm
=
True
# import amdsmi
# amdsmi.amdsmi_init()
# try:
# if len(amdsmi.amdsmi_get_processor_handles()) > 0:
# is_rocm = True
# finally:
# amdsmi.amdsmi_shut_down()
except
Exception
:
pass
...
...
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