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
489b7626
Commit
489b7626
authored
Apr 09, 2026
by
zhangzbb
Browse files
[Tencent FIX BUILD FLOW] stabilize Hygon DCU wheel build and install flow
parent
60c98e29
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
25 deletions
+6
-25
README.md
README.md
+1
-1
requirements/hygon.text
requirements/hygon.text
+1
-2
setup.py
setup.py
+4
-22
No files found.
README.md
View file @
489b7626
...
@@ -83,7 +83,7 @@ VLLM_USE_HYGON=1 python3 setup.py install (若调试,可使用 VLLM_USE_HYGO
...
@@ -83,7 +83,7 @@ VLLM_USE_HYGON=1 python3 setup.py install (若调试,可使用 VLLM_USE_HYGO
> 注意:
> 注意:
> - 海光 DCU 环境必须设置 `VLLM_USE_HYGON=1`。
> - 海光 DCU 环境必须设置 `VLLM_USE_HYGON=1`。
> - 构建时会自动将海光定制包(如 `torch`、`triton`、`flash_attn`)改写为当前环境中的精确 `+das.*` 版本,避免 pip 在安装时替换为不兼容的 PyPI 版本。
> - 构建时会自动将海光定制包(如 `torch`、`triton`、`flash_attn`)改写为当前环境中的精确 `+das.*` 版本,避免 pip 在安装时替换为不兼容的 PyPI 版本。
> - `hygon.txt` 只对高风险包做最小锁定:`numpy==1.26.4` 以及海光定制包,其余 Python 依赖保持正常
解析。
> - `hygon.txt` 只对高风险包做最小锁定:`numpy==1.26.4` 以及海光定制包
的基础版本
,其余 Python 依赖保持正常
> - 海光路径会将 `fastapi[standard]`、`mistral_common[image]` 这类容易触发深度回溯的 extras 依赖替换为镜像中已验证的显式依赖版本。
> - 海光路径会将 `fastapi[standard]`、`mistral_common[image]` 这类容易触发深度回溯的 extras 依赖替换为镜像中已验证的显式依赖版本。
> - 可使用 `python tools/check_hygon_env.py` 在构建前和安装后校验关键包版本
> - 可使用 `python tools/check_hygon_env.py` 在构建前和安装后校验关键包版本
...
...
requirements/hygon.text
View file @
489b7626
...
@@ -3,8 +3,7 @@
...
@@ -3,8 +3,7 @@
#
#
# Keep the lock set minimal:
# Keep the lock set minimal:
# - pin numpy explicitly to avoid ABI-breaking upgrades
# - pin numpy explicitly to avoid ABI-breaking upgrades
# - keep Hygon custom packages on base versions here, then rewrite them
# - keep Hygon custom packages on base versions here
# to exact +das.* installed versions during bdist_wheel
-r common.txt
-r common.txt
# Pin numpy to 1.26.x: compatible with both custom torch ABI and
# Pin numpy to 1.26.x: compatible with both custom torch ABI and
...
...
setup.py
View file @
489b7626
...
@@ -1046,29 +1046,11 @@ def get_vllm_version() -> str:
...
@@ -1046,29 +1046,11 @@ def get_vllm_version() -> str:
return
version
return
version
def
_pin_hygon_local_versions
(
requirements
:
list
[
str
])
->
list
[
str
]:
def
_dedupe_requirements
(
requirements
:
list
[
str
])
->
list
[
str
]:
"""Pin packages with +das.* local versions to their exact installed
"""Deduplicate requirements by package name, keeping later entries."""
versions, and deduplicate requirements (later entries win)."""
import
importlib.metadata
# First pass: pin +das versions
pinned
=
[]
for
req
in
requirements
:
match
=
re
.
match
(
r
'^([a-zA-Z0-9_-]+)\s*=='
,
req
)
if
match
:
pkg_name
=
match
.
group
(
1
)
try
:
installed_ver
=
importlib
.
metadata
.
version
(
pkg_name
)
if
"+das"
in
installed_ver
:
pinned
.
append
(
f
"
{
pkg_name
}
==
{
installed_ver
}
"
)
continue
except
importlib
.
metadata
.
PackageNotFoundError
:
pass
pinned
.
append
(
req
)
# Second pass: deduplicate by package name (later entries win)
# Second pass: deduplicate by package name (later entries win)
seen
=
{}
seen
=
{}
for
req
in
pinned
:
for
req
in
requirements
:
match
=
re
.
match
(
r
'^([a-zA-Z0-9_-]+)'
,
req
)
match
=
re
.
match
(
r
'^([a-zA-Z0-9_-]+)'
,
req
)
if
match
:
if
match
:
pkg_name
=
match
.
group
(
1
).
lower
().
replace
(
"-"
,
"_"
)
pkg_name
=
match
.
group
(
1
).
lower
().
replace
(
"-"
,
"_"
)
...
@@ -1195,7 +1177,7 @@ def get_requirements() -> list[str]:
...
@@ -1195,7 +1177,7 @@ def get_requirements() -> list[str]:
_validate_hygon_build_env
()
_validate_hygon_build_env
()
requirements
=
_read_requirements
(
"hygon.txt"
)
requirements
=
_read_requirements
(
"hygon.txt"
)
requirements
=
_rewrite_hygon_requirements
(
requirements
)
requirements
=
_rewrite_hygon_requirements
(
requirements
)
requirements
=
_
pin_hygon_local_version
s
(
requirements
)
requirements
=
_
dedupe_requirement
s
(
requirements
)
else
:
else
:
requirements
=
_read_requirements
(
"rocm.txt"
)
requirements
=
_read_requirements
(
"rocm.txt"
)
elif
_is_tpu
():
elif
_is_tpu
():
...
...
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