Skip to content

Commit 0e40ac9

Browse files
authored
[ci][build] fix vllm-flash-attn (vllm-project#8699)
1 parent 13d88d4 commit 0e40ac9

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ endif()
382382
# Set the parent build flag so that the vllm-flash-attn library does not redo compile flag and arch initialization.
383383
set(VLLM_PARENT_BUILD ON)
384384

385+
# Ensure the vllm/vllm_flash_attn directory exists before installation
386+
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/vllm/vllm_flash_attn\")" COMPONENT vllm_flash_attn_c)
387+
385388
# Make sure vllm-flash-attn install rules are nested under vllm/
386389
install(CODE "set(CMAKE_INSTALL_LOCAL_ONLY FALSE)" COMPONENT vllm_flash_attn_c)
387390
install(CODE "set(OLD_CMAKE_INSTALL_PREFIX \"\${CMAKE_INSTALL_PREFIX}\")" COMPONENT vllm_flash_attn_c)

setup.py

+15
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,21 @@ def build_extensions(self) -> None:
258258
]
259259
subprocess.check_call(install_args, cwd=self.build_temp)
260260

261+
def run(self):
262+
# First, run the standard build_ext command to compile the extensions
263+
super().run()
264+
265+
# copy vllm/vllm_flash_attn/*.py from self.build_lib to current
266+
# directory so that they can be included in the editable build
267+
import glob
268+
files = glob.glob(
269+
os.path.join(self.build_lib, "vllm", "vllm_flash_attn", "*.py"))
270+
for file in files:
271+
dst_file = os.path.join("vllm/vllm_flash_attn",
272+
os.path.basename(file))
273+
print(f"Copying {file} to {dst_file}")
274+
self.copy_file(file, dst_file)
275+
261276

262277
def _no_device() -> bool:
263278
return VLLM_TARGET_DEVICE == "empty"

vllm/vllm_flash_attn/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)