Repository navigation
chore: lock development dependencies with uv - #1576
Open
liuchongming74 wants to merge 1 commit into
Open
liuchongming74 wants to merge 1 commit into
liuchongming74 wants to merge 1 commit into
Conversation
liuchongming74
marked this pull request as ready for review
November 14, 2026 18:48
liuchongming74
requested review from
Probiotics5333,
davidhe91,
kisnwangg,
suteng,
yangzhenzhang02 and
yaoyifanx
as code owners
November 14, 2026 18:48
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
3 times, most recently
from
November 15, 2026 06:35
4094760 to
5b84fae
Compare
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
from
November 15, 2026 06:47
5b84fae to
f01f668
Compare
3 of 5 tasks
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
4 times, most recently
from
November 15, 2026 12:50
5ddd94d to
6e5d40f
Compare
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
🔵 The pipeline #1702 is running. Please wait a moment... (Link) |
|
|
@liuchongming74, your gate pipeline failed at the code check stage. You can configure some code check tools locally following the (pre-push quick guide), to enable automatic checking when you push your code every time. Tools included are: Check_CMakelint, Check_Codespell, Check_Cpplint, Check_Lizard, Check_Pylint, Check_ClangFormat, Check_ShellCheck. |
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
from
November 15, 2026 14:40
6e5d40f to
c53765b
Compare
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
🔵 The pipeline #1703 is running. Please wait a moment... (Link) |
|
|
|
|
|
|
|
|
|
Contributor
Author
|
add smoke-test |
Contributor
|
/retest_hyper |
|
|
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paired: GitHub #1576 ↔ GitCode !1953
What type of PR is this?
/kind task
What does this PR do / why do we need it:
独立的
hyper-multicoreextra 已锁定到 MindSpore nightly 的0.1.0.dev0。锁文件记录了 CPython 3.10–3.12 在 Linux ARM64 和 x86_64 上六个 wheel 的具体下载地址和 SHA-256。HyperMulticore 归档让 HyperParallel 的多设备 Python 依赖可复现、可审查。 项目维护 NVIDIA GPU 和 Ascend NPU 的 PyTorch 版本组合及 wheel 来源。uv 将这些规则集中到
pyproject.toml,并把解析出的版本和来源记录在uv.lock。开发者检出同一提交后,可用uv sync --locked在相同平台和设备组合下复现依赖。锁文件过期时,同步会报错,依赖升级也能作为 PR 差异审查。Conda 环境仍可通过
--python提供基础解释器,项目依赖同步到独立的 uv 虚拟环境。已有训练环境可以用 pip 安装基础包。两个 NPU Dockerfile 默认选择torch-npu-2-9和hyper-multicore,通过 uv 按锁文件安装依赖。test包含coverage==7.13.1和diff-cover。smoke-test汇总test、lint、build和八个门禁专用依赖。build声明pybind11>=2.12.0,供 Indexed Dataset C++ 扩展使用。requirements.txt声明运行时依赖。在pyproject.toml中维护 7 个互斥的设备 extra,包括gpu和下列六个 Ascend 组合。修正 editable 安装的元数据目录处理。./build.sh使用当前 Python 解释器编译 Indexed Dataset C++ 扩展,再用同一解释器调用uv build --wheel打包。torch-npu-2-9、torch-npu-2-10、torch-npu-2-11、torch-npu-2-12、torch-npu-2-13、torch-npu-2-14用于选择 Torch 和 TorchNPU 版本。六个选项依次匹配 torch-npu2.9.0.post9、2.10.0.post7、2.11.0.post3、2.12.0.post3、2.13.0、2.14.0,按 CPython 3.10–3.12 的 ABI 和架构选择具体 wheel。Ascend 归档pyproject.toml、uv.lock和setup.py指定唯一代码所有者@liuchongming74。强制要求代码所有者审批需在master规则集中启用对应选项。安装和构建示例
以下命令从仓库根目录执行。
1. 使用
uv sync初始化开发环境# 若尚未安装 uv,在已激活的 Conda 环境或其他工具环境中安装项目所用版本。 python -m pip install uv==0.11.16A. 同步到独立的 uv 虚拟环境
以下示例使用 Linux Ascend 和 PyTorch 2.10,在仓库内的
.venv-uv中安装项目和依赖。Conda 可提供基础解释器,将--python 3.12改为--python "$CONDA_PREFIX/bin/python"即可。需要 HyperMulticore 时,在同步命令中另加
--extra hyper-multicore。B. 同步 SmokeTest 环境
UV_PROJECT_ENVIRONMENT=.venv-smoke \ uv sync --locked --python 3.12 --group smoke-test --extra torch-npu-2-10C. 同步到系统 Python
以下 Ascend 示例适用于专用 Linux 容器等可写的 Python 安装。
--inexact保留项目未声明的包,但仍可能替换项目依赖的已有版本。操作系统管理的 Python 可能拒绝写入。也可以用 pip 兼容接口按
requirements.txt的版本范围安装运行时依赖。uv 项目环境路径 · uv 系统环境安装
2. 使用 uv 编译和构建 wheel
在 Linux 上,构建需要当前解释器的开发头文件、C++17 工具链,以及当前环境中的 uv 和 pybind11。每个构建产物对应当前解释器的 Python ABI 和构建主机的架构。
只需要打包 Python 源码时,可直接指定开发环境的解释器。生成的 wheel 仍带当前解释器的 ABI 和平台标签。
# 只打包 Python 源码,输出到 dist/core-only。 uv build --wheel --python .venv-uv/bin/python --out-dir dist/core-only3. 使用 pip 安装本地 wheel
以下示例使用 Linux ARM64、CPython 3.12 和 PyTorch 2.10。将
HP_WHEEL设为./build.sh输出的实际路径。HyperParallel 及./wheels中的 PyTorch CPU、TorchNPU 和按需使用的 HyperMulticore wheel 均需匹配安装时使用的 Python ABI 和架构。PyTorch CPU 索引 · TorchNPU 2.10.0.post7 归档 · HyperMulticore nightly 归档根据需要执行下面两条安装命令中的一条。要换 TorchNPU 系列,按安装指南的版本表一起调整 extra 和 CPU 版 PyTorch,并准备相应归档 wheel。Ascend 版本对照表
pip 根据 wheel 元数据和所给的包来源解析依赖。这里的
--find-links ./wheels将本地归档 wheel 提供给 pip,uv.lock和tool.uv.sources由 uv 使用。Which issue(s) this PR fixes:
无关联 Issue。
Test Plan and Test result:What scenarios were tested, and what were the verification results(Function, performance, reliability, etc.):
git diff --check和autogit check通过。uv pip check通过。昇腾上验证了smoke-test和torch-npu-2-10的组合安装计划。cp312-cp312-linux_aarch64wheel,确认其中包含对应的 Indexed Dataset 扩展。此前也在该平台验证了 CPython 3.12 的 wheel 安装。torch-npu-2-10和hyper-multicore可分别选择,两种安装组合均通过pip check。uv pip sync安装,在线uv sync --locked在校验其他 TorchNPU 归档时超时。full和regional两个 FP32 精确相等断言仍失败,loss 绝对差为5.96e-8。Self-checklist: