-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into granitemoe
- Loading branch information
Showing
22 changed files
with
247 additions
and
59 deletions.
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
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
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) |
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
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
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
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 |
---|---|---|
@@ -1,15 +1,9 @@ | ||
import pytest | ||
import transformers | ||
|
||
from vllm.model_executor.models import _MODELS, ModelRegistry | ||
|
||
|
||
@pytest.mark.parametrize("model_cls", _MODELS) | ||
def test_registry_imports(model_cls): | ||
if (model_cls in ("LlavaOnevisionForConditionalGeneration", | ||
"Qwen2VLForConditionalGeneration") | ||
and transformers.__version__ < "4.45"): | ||
pytest.skip("Waiting for next transformers release") | ||
|
||
# Ensure all model classes can be imported successfully | ||
ModelRegistry.resolve_model_cls([model_cls]) |
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
Oops, something went wrong.