This commit is contained in:
2026-06-18 10:31:22 +08:00
parent 979a5a41d0
commit af483b663e
2 changed files with 18 additions and 1 deletions
+4 -1
View File
@@ -299,11 +299,14 @@ RUN set -ex && \
# 2) 手动注册 vllm 为 editable package(阶段 8a 已编译 C++ 扩展,此处不触发 cmake)
cd /opt/vllm && \
mkdir -p vllm.egg-info && \
printf 'Metadata-Version: 2.1\nName: vllm\nVersion: 0.0.0\nSummary: A high-throughput and memory-efficient inference and serving engine for LLMs\n' > vllm.egg-info/PKG-INFO && \
printf 'Metadata-Version: 2.1\nName: vllm\nVersion: 0.11.0\nSummary: A high-throughput and memory-efficient inference and serving engine for LLMs\n' > vllm.egg-info/PKG-INFO && \
echo "vllm" > vllm.egg-info/top_level.txt && \
touch vllm.egg-info/dependency_links.txt && \
touch vllm.egg-info/requires.txt && \
find vllm -name "*.py" -type f 2>/dev/null | sort > vllm.egg-info/SOURCES.txt && \
# 2b) 写 vllm/_version.py(替代 setuptools_scm 生成),避免 vllm.__version__='dev' 触发
# mineru.backend.vlm.utils:88 中 packaging.version.parse 抛 InvalidVersion
printf '__version__ = "0.11.0"\n__version_tuple__ = (0, 11, 0)\n' > /opt/vllm/vllm/_version.py && \
echo "vllm egg-info created (cmake build skipped, C++ extensions from stage 8a)" && \
# 3) 安装 ROCm PyTorch(后续依赖解析用 ROCm 源补齐 triton-rocm)
(${VENV}/bin/pip uninstall -y triton triton-rocm 2>/dev/null || true) && \
+14
View File
@@ -95,6 +95,20 @@ def ensure_vllm_dist_info():
return
version = getattr(vllm, '__version__', '0.1.dev1') or '0.1.dev1'
# PEP440 合法性校验:vllm 在 _version.py 缺失时会回退到 'dev',
# 这不是合法 PEP440,会触发下游 packaging.version.parse 抛 InvalidVersion
# (例如 mineru.backend.vlm.utils:set_default_gpu_memory_utilization)。
try:
from packaging.version import Version as _PEP440Version
_PEP440Version(version)
except Exception:
print(f'WARNING: vllm.__version__={version!r} is not PEP440-compliant; '
f'falling back to "0.11.0" for dist-info.')
version = '0.11.0'
try:
vllm.__version__ = version
except Exception:
pass
site_packages = sysconfig.get_paths().get('purelib')
if not site_packages:
return