-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[misc][installation] build from source without compilation #8818
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# enable python only development | ||
# copy compiled files to the current directory directly | ||
|
||
import os | ||
import shutil | ||
import subprocess | ||
import sys | ||
|
||
# cannot directly `import vllm` , because it will try to | ||
# import from the current directory | ||
output = subprocess.run([sys.executable, "-m", "pip", "show", "vllm"], | ||
capture_output=True) | ||
|
||
assert output.returncode == 0, "vllm is not installed" | ||
|
||
text = output.stdout.decode("utf-8") | ||
|
||
package_path = None | ||
for line in text.split("\n"): | ||
if line.startswith("Location: "): | ||
package_path = line.split(": ")[1] | ||
break | ||
|
||
assert package_path is not None, "could not find package path" | ||
|
||
cwd = os.getcwd() | ||
|
||
assert cwd != package_path, "should not import from the current directory" | ||
|
||
files_to_copy = [ | ||
"vllm/_C.abi3.so", | ||
"vllm/_core_C.abi3.so", | ||
"vllm/_moe_C.abi3.so", | ||
"vllm/vllm_flash_attn/vllm_flash_attn_c.abi3.so", | ||
"vllm/vllm_flash_attn/flash_attn_interface.py", | ||
"vllm/vllm_flash_attn/__init__.py", | ||
# "vllm/_version.py", # not available in nightly wheels yet | ||
] | ||
|
||
for file in files_to_copy: | ||
src = os.path.join(package_path, file) | ||
dst = file | ||
print(f"Copying {src} to {dst}") | ||
shutil.copyfile(src, dst) | ||
|
||
pre_built_vllm_path = os.path.join(package_path, "vllm") | ||
tmp_path = os.path.join(package_path, "vllm_pre_built") | ||
current_vllm_path = os.path.join(cwd, "vllm") | ||
|
||
print(f"Renaming {pre_built_vllm_path} to {tmp_path}") | ||
os.rename(pre_built_vllm_path, tmp_path) | ||
|
||
print(f"linking {current_vllm_path} to {pre_built_vllm_path}") | ||
os.symlink(current_vllm_path, pre_built_vllm_path) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could find a way to make this a little easier -- either by wrapping this in a script that's version invariant, or maybe we could always upload the latest wheel to
https://vllm-wheels.s3.us-west-2.amazonaws.com/nightly/vllm-latest-cp38-abi3-manylinux1_x86_64.whl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @simon-mo @khluu if this is possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe push to
nightly
during the scheduled build at 9PM daily? or we can push tolatest/vllm-{VLLM_VERSION}...
for every commitThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we shouldn't have to update this when we put a new version out, and ideally users could have one command that always. works.
Isn't
export VLLM_VERSION=0.6.1.post1
already out of date, btw?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lastest is always pushed. but the version string will always be there. a thing I have known worked in the pass is to set dev versions something like v1.0.0.dev0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we omit the version in the wheel name? i.e. a unified link that always points to the latest wheel. an url re-direction should work I think.