Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
f35f8e22
Unverified
Commit
f35f8e22
authored
Mar 03, 2025
by
Cody Yu
Committed by
GitHub
Mar 03, 2025
Browse files
[Build] Make sure local main branch is synced when VLLM_USE_PRECOMPILED=1 (#13921)
Signed-off-by:
Cody Yu
<
hao.yu.cody@gmail.com
>
parent
b87c21fc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
3 deletions
+35
-3
setup.py
setup.py
+27
-1
tests/standalone_tests/python_only_compile.sh
tests/standalone_tests/python_only_compile.sh
+1
-1
vllm/envs.py
vllm/envs.py
+7
-1
No files found.
setup.py
View file @
f35f8e22
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
ctypes
import
ctypes
import
importlib.util
import
importlib.util
import
json
import
logging
import
logging
import
os
import
os
import
re
import
re
...
@@ -269,9 +270,32 @@ class repackage_wheel(build_ext):
...
@@ -269,9 +270,32 @@ class repackage_wheel(build_ext):
"""Extracts libraries and other files from an existing wheel."""
"""Extracts libraries and other files from an existing wheel."""
def
get_base_commit_in_main_branch
(
self
)
->
str
:
def
get_base_commit_in_main_branch
(
self
)
->
str
:
import
subprocess
# Force to use the nightly wheel. This is mainly used for CI testing.
if
envs
.
VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL
:
return
"nightly"
try
:
try
:
# Get the latest commit hash of the upstream main branch.
resp_json
=
subprocess
.
check_output
([
"curl"
,
"-s"
,
"https://api.github.com/repos/vllm-project/vllm/commits/main"
]).
decode
(
"utf-8"
)
upstream_main_commit
=
json
.
loads
(
resp_json
)[
"sha"
]
# Check if the local main branch is up-to-date. This is to ensure
# the base commit we found is the most recent commit on the main
# branch.
local_main_commit
=
subprocess
.
check_output
(
[
"git"
,
"rev-parse"
,
"main"
]).
decode
(
"utf-8"
).
strip
()
if
local_main_commit
!=
upstream_main_commit
:
raise
ValueError
(
f
"Local main branch (
{
local_main_commit
}
) is not "
"up-to-date with upstream main branch "
f
"(
{
upstream_main_commit
}
). Please pull the latest "
"changes from upstream main branch first."
)
# Then get the commit hash of the current branch that is the same as
# the upstream main commit.
current_branch
=
subprocess
.
check_output
(
current_branch
=
subprocess
.
check_output
(
[
"git"
,
"branch"
,
"--show-current"
]).
decode
(
"utf-8"
).
strip
()
[
"git"
,
"branch"
,
"--show-current"
]).
decode
(
"utf-8"
).
strip
()
...
@@ -279,6 +303,8 @@ class repackage_wheel(build_ext):
...
@@ -279,6 +303,8 @@ class repackage_wheel(build_ext):
[
"git"
,
"merge-base"
,
"main"
,
[
"git"
,
"merge-base"
,
"main"
,
current_branch
]).
decode
(
"utf-8"
).
strip
()
current_branch
]).
decode
(
"utf-8"
).
strip
()
return
base_commit
return
base_commit
except
ValueError
as
err
:
raise
ValueError
(
err
)
from
None
except
Exception
as
err
:
except
Exception
as
err
:
logger
.
warning
(
logger
.
warning
(
"Failed to get the base commit in the main branch. "
"Failed to get the base commit in the main branch. "
...
...
tests/standalone_tests/python_only_compile.sh
View file @
f35f8e22
...
@@ -18,7 +18,7 @@ apt autoremove -y
...
@@ -18,7 +18,7 @@ apt autoremove -y
echo
'import os; os.system("touch /tmp/changed.file")'
>>
vllm/__init__.py
echo
'import os; os.system("touch /tmp/changed.file")'
>>
vllm/__init__.py
VLLM_USE_PRECOMPILED
=
1 pip3
install
-vvv
-e
.
VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL
=
1
VLLM_USE_PRECOMPILED
=
1 pip3
install
-vvv
-e
.
# Run the script
# Run the script
python3
-c
'import vllm'
python3
-c
'import vllm'
...
...
vllm/envs.py
View file @
f35f8e22
...
@@ -60,12 +60,12 @@ if TYPE_CHECKING:
...
@@ -60,12 +60,12 @@ if TYPE_CHECKING:
MAX_JOBS
:
Optional
[
str
]
=
None
MAX_JOBS
:
Optional
[
str
]
=
None
NVCC_THREADS
:
Optional
[
str
]
=
None
NVCC_THREADS
:
Optional
[
str
]
=
None
VLLM_USE_PRECOMPILED
:
bool
=
False
VLLM_USE_PRECOMPILED
:
bool
=
False
VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL
:
bool
=
False
VLLM_NO_DEPRECATION_WARNING
:
bool
=
False
VLLM_NO_DEPRECATION_WARNING
:
bool
=
False
VLLM_KEEP_ALIVE_ON_ENGINE_DEATH
:
bool
=
False
VLLM_KEEP_ALIVE_ON_ENGINE_DEATH
:
bool
=
False
CMAKE_BUILD_TYPE
:
Optional
[
str
]
=
None
CMAKE_BUILD_TYPE
:
Optional
[
str
]
=
None
VERBOSE
:
bool
=
False
VERBOSE
:
bool
=
False
VLLM_ALLOW_LONG_MAX_MODEL_LEN
:
bool
=
False
VLLM_ALLOW_LONG_MAX_MODEL_LEN
:
bool
=
False
VLLM_TEST_FORCE_FP8_MARLIN
:
bool
=
False
VLLM_RPC_TIMEOUT
:
int
=
10000
# ms
VLLM_RPC_TIMEOUT
:
int
=
10000
# ms
VLLM_PLUGINS
:
Optional
[
list
[
str
]]
=
None
VLLM_PLUGINS
:
Optional
[
list
[
str
]]
=
None
VLLM_TORCH_PROFILER_DIR
:
Optional
[
str
]
=
None
VLLM_TORCH_PROFILER_DIR
:
Optional
[
str
]
=
None
...
@@ -148,6 +148,12 @@ environment_variables: dict[str, Callable[[], Any]] = {
...
@@ -148,6 +148,12 @@ environment_variables: dict[str, Callable[[], Any]] = {
lambda
:
bool
(
os
.
environ
.
get
(
"VLLM_USE_PRECOMPILED"
))
or
bool
(
lambda
:
bool
(
os
.
environ
.
get
(
"VLLM_USE_PRECOMPILED"
))
or
bool
(
os
.
environ
.
get
(
"VLLM_PRECOMPILED_WHEEL_LOCATION"
)),
os
.
environ
.
get
(
"VLLM_PRECOMPILED_WHEEL_LOCATION"
)),
# Whether to force using nightly wheel in python build.
# This is used for testing the nightly wheel in python build.
"VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL"
:
lambda
:
bool
(
int
(
os
.
getenv
(
"VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL"
,
"0"
))
),
# CMake build type
# CMake build type
# If not set, defaults to "Debug" or "RelWithDebInfo"
# If not set, defaults to "Debug" or "RelWithDebInfo"
# Available options: "Debug", "Release", "RelWithDebInfo"
# Available options: "Debug", "Release", "RelWithDebInfo"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment