Commit 57973bcc authored by zhangzbb's avatar zhangzbb
Browse files

[feature]编译之前不再做强制的的包版本检查,避免后续频繁改动setup中的指定版本号

parent 489b7626
This diff is collapsed.
......@@ -8,7 +8,8 @@
# Pin numpy to 1.26.x: compatible with both custom torch ABI and
# modern PyPI packages (pandas, opencv, etc.)
numpy == 1.26.4
#numpy == 1.26.4
# numpy == 1.26.4 Pinning a specific version of this package will cause dependency conflicts with VLLM, making it impossible to install.
# Replace heavy extras dependency chains with the explicit versions
# already validated in the Hygon Docker image.
......@@ -41,7 +42,8 @@ fastrlock==0.8.3
torch == 2.9.0
triton == 3.3.0
flash_attn == 2.6.1
flash_mla == 1.2.0
#flash_mla == 1.2.0
flash_mla == 1.0.0
lightop == 0.6.0
lmslim == 0.3.1
......@@ -1060,68 +1060,6 @@ def _dedupe_requirements(requirements: list[str]) -> list[str]:
return list(seen.values())
def _validate_hygon_build_env() -> None:
"""Fail fast with actionable errors for the Hygon build env."""
import importlib.metadata
exact_versions = {
"numpy": "1.26.4",
}
das_versions = {
"torch": "2.9.0",
"triton": "3.3.0",
"flash_attn": "2.6.1",
"flash_mla": "1.2.0",
"lightop": "0.6.0",
"lmslim": "0.3.1",
}
errors: list[str] = []
for pkg_name, expected_version in exact_versions.items():
try:
installed_ver = importlib.metadata.version(pkg_name)
except importlib.metadata.PackageNotFoundError:
errors.append(
f"- Missing required package `{pkg_name}`. Expected "
f"`{expected_version}`."
)
continue
if installed_ver != expected_version:
errors.append(
f"- `{pkg_name}` version mismatch: expected "
f"`{expected_version}`, got `{installed_ver}`."
)
for pkg_name, expected_base in das_versions.items():
try:
installed_ver = importlib.metadata.version(pkg_name)
except importlib.metadata.PackageNotFoundError:
errors.append(
f"- Missing required package `{pkg_name}`. Expected a "
f"Hygon build based on `{expected_base}`."
)
continue
if not installed_ver.startswith(expected_base):
errors.append(
f"- `{pkg_name}` version mismatch: expected base "
f"`{expected_base}`, got `{installed_ver}`."
)
if "+das" not in installed_ver:
errors.append(
f"- `{pkg_name}` is not a Hygon custom build: "
f"`{installed_ver}`."
)
if errors:
joined = "\n".join(errors)
raise RuntimeError(
"Hygon build environment validation failed.\n"
"Please fix the following packages before running "
"`VLLM_USE_HYGON=1 python setup.py bdist_wheel`:\n"
f"{joined}"
)
def _rewrite_hygon_requirements(requirements: list[str]) -> list[str]:
"""Replace heavy extras chains with explicit Hygon-validated packages."""
......@@ -1174,7 +1112,6 @@ def get_requirements() -> list[str]:
requirements = modified_requirements
elif _is_hip():
if os.environ.get("VLLM_USE_HYGON", "").strip().lower() in ("1", "true"):
_validate_hygon_build_env()
requirements = _read_requirements("hygon.txt")
requirements = _rewrite_hygon_requirements(requirements)
requirements = _dedupe_requirements(requirements)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment