@@ -346,10 +346,13 @@ def determine_wheel_url() -> tuple[str, str | None]:
346346 The order of preference is:
347347 1. user-specified wheel location (can be either local or remote, via
348348 VLLM_PRECOMPILED_WHEEL_LOCATION)
349- 2. user-specified variant from nightly repo (current main commit via
350- VLLM_PRECOMPILED_WHEEL_VARIANT)
349+ 2. user-specified variant (VLLM_PRECOMPILED_WHEEL_VARIANT) from nightly repo
351350 3. the variant corresponding to VLLM_MAIN_CUDA_VERSION from nightly repo
352- 4. the default variant from nightly repo (current main commit)
351+ 4. the default variant from nightly repo
352+
353+ If downloading from the nightly repo, the commit can be specified via
354+ VLLM_PRECOMPILED_WHEEL_COMMIT; otherwise, the head commit in the main branch
355+ is used.
353356 """
354357 wheel_location = os .getenv ("VLLM_PRECOMPILED_WHEEL_LOCATION" , None )
355358 if wheel_location is not None :
@@ -362,10 +365,13 @@ def determine_wheel_url() -> tuple[str, str | None]:
362365 # try to fetch the wheel metadata from the nightly wheel repo
363366 main_variant = "cu" + envs .VLLM_MAIN_CUDA_VERSION .replace ("." , "" )
364367 variant = os .getenv ("VLLM_PRECOMPILED_WHEEL_VARIANT" , main_variant )
365- commit = os .getenv (
366- "VLLM_PRECOMPILED_WHEEL_COMMIT" ,
367- precompiled_wheel_utils .get_base_commit_in_main_branch (),
368- )
368+ commit = os .getenv ("VLLM_PRECOMPILED_WHEEL_COMMIT" , "" ).lower ()
369+ if not commit or len (commit ) != 40 :
370+ print (
371+ f"VLLM_PRECOMPILED_WHEEL_COMMIT not valid: { commit } "
372+ ", trying to fetch base commit in main branch"
373+ )
374+ commit = precompiled_wheel_utils .get_base_commit_in_main_branch ()
369375 print (f"Using precompiled wheel commit { commit } with variant { variant } " )
370376 try_default = False
371377 wheels , repo_url , download_filename = None , None , None
@@ -502,10 +508,6 @@ def extract_precompiled_and_patch_package(
502508
503509 @staticmethod
504510 def get_base_commit_in_main_branch () -> str :
505- # Force to use the nightly wheel. This is mainly used for CI testing.
506- if envs .VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL :
507- return "nightly"
508-
509511 try :
510512 # Get the latest commit hash of the upstream main branch.
511513 resp_json = subprocess .check_output (
@@ -516,6 +518,7 @@ def get_base_commit_in_main_branch() -> str:
516518 ]
517519 ).decode ("utf-8" )
518520 upstream_main_commit = json .loads (resp_json )["sha" ]
521+ print (f"Upstream main branch latest commit: { upstream_main_commit } " )
519522
520523 # In Docker build context, .git may be immutable or missing.
521524 if envs .VLLM_DOCKER_BUILD_CONTEXT :
0 commit comments