Skip to content

Commit 26de25d

Browse files
committed
build: add VLLM_PRECOMPILED_WHEEL_COMMIT env
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
1 parent 3108287 commit 26de25d

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

setup.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,6 @@ def run(self):
310310
class precompiled_build_ext(build_ext):
311311
"""Disables extension building when using precompiled binaries."""
312312

313-
def run(self) -> None:
314-
assert _is_cuda(), "VLLM_USE_PRECOMPILED is only supported for CUDA builds"
315-
316313
def build_extensions(self) -> None:
317314
print("Skipping build_ext: using precompiled extensions.")
318315
return
@@ -649,10 +646,11 @@ def _read_requirements(filename: str) -> list[str]:
649646
}
650647

651648

652-
def _fetch_metadata_for_variant(variant: str | None) -> tuple[list[dict], str]:
653-
base_commit = precompiled_wheel_utils.get_base_commit_in_main_branch()
649+
def _fetch_metadata_for_variant(
650+
commit: str, variant: str | None
651+
) -> tuple[list[dict], str]:
654652
variant_dir = f"{variant}/" if variant is not None else ""
655-
repo_url = f"https://wheels.vllm.ai/{base_commit}/{variant_dir}vllm/"
653+
repo_url = f"https://wheels.vllm.ai/{commit}/{variant_dir}vllm/"
656654
meta_url = repo_url + "metadata.json"
657655
logger.info("Trying to fetch metadata from {}", meta_url)
658656
from urllib.request import urlopen
@@ -683,11 +681,17 @@ def _fetch_metadata_for_variant(variant: str | None) -> tuple[list[dict], str]:
683681
# try to fetch the wheel metadata from the nightly wheel repo
684682
main_variant = envs.VLLM_MAIN_CUDA_VERSION.replace(".", "")
685683
variant = os.getenv("VLLM_PRECOMPILED_WHEEL_VARIANT", main_variant)
686-
logger.info("Using precompiled wheel variant: {}", variant)
684+
commit = os.getenv(
685+
"VLLM_PRECOMPILED_WHEEL_COMMIT",
686+
precompiled_wheel_utils.get_base_commit_in_main_branch(),
687+
)
688+
logger.info(
689+
"Using precompiled wheel commit {} with variant {}", commit, variant
690+
)
687691
try_default = False
688692
wheels, repo_url = None, None
689693
try:
690-
wheels, repo_url = _fetch_metadata_for_variant(variant)
694+
wheels, repo_url = _fetch_metadata_for_variant(commit, variant)
691695
except Exception as e:
692696
logger.warning(
693697
"Failed to fetch precompiled wheel metadata for variant {}",
@@ -696,8 +700,8 @@ def _fetch_metadata_for_variant(variant: str | None) -> tuple[list[dict], str]:
696700
)
697701
try_default = True # try outside handler to keep the stacktrace simple
698702
if try_default:
699-
logger.info("Trying the default variant from /nightly/")
700-
wheels, repo_url = _fetch_metadata_for_variant(None)
703+
logger.info("Trying the default variant")
704+
wheels, repo_url = _fetch_metadata_for_variant(commit, None)
701705
# if this also fails, then we have nothing more to try / cache
702706
assert wheels is not None and repo_url is not None, (
703707
"Failed to fetch precompiled wheel metadata"

0 commit comments

Comments
 (0)