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
a3fb334b
"docs/vscode:/vscode.git/clone" did not exist on "7be7f3824a2d610299991ceefb1b034b3a923b0f"
Commit
a3fb334b
authored
Jan 29, 2026
by
zhuwenwen
Browse files
add prepare_so_files to prepare so
parent
56d6c689
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
setup.py
setup.py
+36
-0
No files found.
setup.py
View file @
a3fb334b
...
...
@@ -11,6 +11,8 @@ import subprocess
import
sys
from
pathlib
import
Path
from
shutil
import
which
import
tarfile
import
shutil
import
torch
from
packaging.version
import
Version
,
parse
...
...
@@ -31,6 +33,39 @@ skip_vllm_build = False
if
int
(
os
.
environ
.
get
(
'SKIP_VLLM_BUILD'
,
'0'
))
==
1
:
skip_vllm_build
=
True
def
prepare_so_files
():
source_dir
=
"so.tar.gz"
target_dir
=
"vllm"
if
not
os
.
path
.
exists
(
source_dir
):
print
(
f
"Warning:
{
source_dir
}
not found, skipping extraction"
)
return
print
(
f
"Preparing C extension files from
{
source_dir
}
..."
)
temp_dir
=
"temp_so_extract"
os
.
makedirs
(
temp_dir
,
exist_ok
=
True
)
try
:
with
tarfile
.
open
(
source_dir
,
"r:*"
)
as
tar
:
tar
.
extractall
(
temp_dir
)
for
root
,
dirs
,
files
in
os
.
walk
(
temp_dir
):
for
file
in
files
:
if
file
in
[
"_C.abi3.so"
,
"_moe_C.abi3.so"
]:
src_path
=
os
.
path
.
join
(
root
,
file
)
dst_path
=
os
.
path
.
join
(
target_dir
,
file
)
os
.
makedirs
(
os
.
path
.
dirname
(
dst_path
),
exist_ok
=
True
)
shutil
.
copy2
(
src_path
,
dst_path
)
print
(
f
"Copied
{
file
}
to
{
dst_path
}
"
)
finally
:
if
os
.
path
.
exists
(
temp_dir
):
shutil
.
rmtree
(
temp_dir
)
def
load_module_from_path
(
module_name
,
path
):
spec
=
importlib
.
util
.
spec_from_file_location
(
module_name
,
path
)
module
=
importlib
.
util
.
module_from_spec
(
spec
)
...
...
@@ -769,6 +804,7 @@ if _build_custom_ops():
ext_modules
.
append
(
CMakeExtension
(
name
=
"vllm._C"
))
if
skip_vllm_build
:
prepare_so_files
()
package_data
=
{
"vllm"
:
[
"py.typed"
,
...
...
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