Skip to content

Commit

Permalink
fix inclusion of vllm_flash_attn python/compiled files
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrifiro committed Oct 28, 2024
1 parent 2acec04 commit 76a3131
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,15 +496,23 @@ def _read_requirements(filename: str) -> List[str]:
f"Failed to get vLLM wheel from {wheel_location}") from exc

with zipfile.ZipFile(wheel_filename) as wheel:
for lib in filter(lambda file: file.filename.endswith(".so"),
wheel.filelist):
for lib in filter(
lambda file: file.filename.endswith(".so") or file.filename.
startswith("vllm/vllm_flash_attn"), wheel.filelist):
print("Extracting and including {lib.filename} from existing wheel")
package_name = os.path.dirname(lib.filename).replace("/", ".")
file_name = os.path.basename(lib.filename)

if package_name not in package_data:
package_data[package_name] = []

wheel.extract(lib)
package_data[package_name].append(lib.filename)
print(f"Added {lib.filename} to package_data[\"{package_name}\"]")
if file_name.endswith(".py"):
# python files shouldn't be added to package_data
continue

package_data[package_name].append(file_name)


if _no_device():
ext_modules = []
Expand Down

0 comments on commit 76a3131

Please sign in to comment.