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
0e40ac9b
Unverified
Commit
0e40ac9b
authored
Sep 21, 2024
by
youkaichao
Committed by
GitHub
Sep 21, 2024
Browse files
[ci][build] fix vllm-flash-attn (#8699)
parent
13d88d41
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
CMakeLists.txt
CMakeLists.txt
+3
-0
setup.py
setup.py
+15
-0
vllm/vllm_flash_attn/.gitkeep
vllm/vllm_flash_attn/.gitkeep
+0
-0
No files found.
CMakeLists.txt
View file @
0e40ac9b
...
@@ -382,6 +382,9 @@ endif()
...
@@ -382,6 +382,9 @@ endif()
# Set the parent build flag so that the vllm-flash-attn library does not redo compile flag and arch initialization.
# Set the parent build flag so that the vllm-flash-attn library does not redo compile flag and arch initialization.
set
(
VLLM_PARENT_BUILD ON
)
set
(
VLLM_PARENT_BUILD ON
)
# Ensure the vllm/vllm_flash_attn directory exists before installation
install
(
CODE
"file(MAKE_DIRECTORY
\"\$
{CMAKE_INSTALL_PREFIX}/vllm/vllm_flash_attn
\"
)"
COMPONENT vllm_flash_attn_c
)
# Make sure vllm-flash-attn install rules are nested under vllm/
# Make sure vllm-flash-attn install rules are nested under vllm/
install
(
CODE
"set(CMAKE_INSTALL_LOCAL_ONLY FALSE)"
COMPONENT vllm_flash_attn_c
)
install
(
CODE
"set(CMAKE_INSTALL_LOCAL_ONLY FALSE)"
COMPONENT vllm_flash_attn_c
)
install
(
CODE
"set(OLD_CMAKE_INSTALL_PREFIX
\"\$
{CMAKE_INSTALL_PREFIX}
\"
)"
COMPONENT vllm_flash_attn_c
)
install
(
CODE
"set(OLD_CMAKE_INSTALL_PREFIX
\"\$
{CMAKE_INSTALL_PREFIX}
\"
)"
COMPONENT vllm_flash_attn_c
)
...
...
setup.py
View file @
0e40ac9b
...
@@ -258,6 +258,21 @@ class cmake_build_ext(build_ext):
...
@@ -258,6 +258,21 @@ class cmake_build_ext(build_ext):
]
]
subprocess
.
check_call
(
install_args
,
cwd
=
self
.
build_temp
)
subprocess
.
check_call
(
install_args
,
cwd
=
self
.
build_temp
)
def
run
(
self
):
# First, run the standard build_ext command to compile the extensions
super
().
run
()
# copy vllm/vllm_flash_attn/*.py from self.build_lib to current
# directory so that they can be included in the editable build
import
glob
files
=
glob
.
glob
(
os
.
path
.
join
(
self
.
build_lib
,
"vllm"
,
"vllm_flash_attn"
,
"*.py"
))
for
file
in
files
:
dst_file
=
os
.
path
.
join
(
"vllm/vllm_flash_attn"
,
os
.
path
.
basename
(
file
))
print
(
f
"Copying
{
file
}
to
{
dst_file
}
"
)
self
.
copy_file
(
file
,
dst_file
)
def
_no_device
()
->
bool
:
def
_no_device
()
->
bool
:
return
VLLM_TARGET_DEVICE
==
"empty"
return
VLLM_TARGET_DEVICE
==
"empty"
...
...
vllm/vllm_flash_attn/.gitkeep
0 → 100644
View file @
0e40ac9b
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