@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 63137cd922
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 19:45 UTC

[Build] Add nightly wheel fallback when latest commit wheel unavailable (#14358)

Signed-off-by: Isotr0py <2037008807@qq.com>

Isotr0py committed Mar 7, 2025 at 14:10 UTC 63137cd9226c8ee335b8c0dfbb002671d6a917e1
1 file changed +16
setup.py
+16
@@ -69,6 +69,18 @@ def is_ninja_available() -> bool:
69 return which("ninja") is not None
70
71
72 +def is_url_available(url: str) -> bool:
73 + from urllib.request import urlopen
74 +
75 + status = None
76 + try:
77 + with urlopen(url) as f:
78 + status = f.status
79 + except Exception:
80 + return False
81 + return status == 200
82 +
83 +
84 class CMakeExtension(Extension):
85
86 def __init__(self, name: str, cmake_lists_dir: str = '.', **kwa) -> None:
@@ -320,6 +332,10 @@ class repackage_wheel(build_ext):
332 if wheel_location is None:
333 base_commit = self.get_base_commit_in_main_branch()
334 wheel_location = f"https://wheels.vllm.ai/{base_commit}/vllm-1.0.0.dev-cp38-abi3-manylinux1_x86_64.whl"
335 + # Fallback to nightly wheel if latest commit wheel is unavailable,
336 + # in this rare case, the nightly release CI hasn't finished on main.
337 + if not is_url_available(wheel_location):
338 + wheel_location = "https://wheels.vllm.ai/nightly/vllm-1.0.0.dev-cp38-abi3-manylinux1_x86_64.whl"
339
340 import zipfile
341