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) |
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
6 times, most recently
from
November 23, 2026 13:42
aa5956b to
c72f06d
Compare
liuchongming74
force-pushed
the
codex/uv-lock-migration
branch
from
November 23, 2026 14:08
c72f06d to
2911e3f
Compare
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 按锁文件安装依赖。pyproject.toml中声明开发和测试依赖组,便于按用途同步。build组显式声明pybind11>=2.12.0,供 Indexed Dataset C++ 扩展使用。requirements.txt声明运行时依赖。在pyproject.toml中维护 7 个互斥的设备 extra,包括gpu和下列六个 Ascend 组合。修正 editable 安装的元数据目录处理。master。无参数的build.sh编译 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. 同步到系统 Python
以下 Ascend 示例适用于专用 Linux 容器等可写的 Python 安装。
--inexact保留项目未声明的包,但仍可能替换项目依赖的已有版本。操作系统管理的 Python 可能拒绝写入。也可以用 pip 兼容接口按
requirements.txt的版本范围安装运行时依赖。uv 项目环境路径 · uv 系统环境安装
2. 使用 uv 编译和构建 wheel
在 Linux 上,构建含 Indexed Dataset C++ 扩展的 wheel 需要与 Python 版本匹配的开发头文件和 C++17 工具链。
build.sh先编译原生扩展,再让uv build --wheel使用同一个 Python 解释器打包。只需要打包 Python 源码时,可直接指定开发环境的解释器。生成的 wheel 仍带当前解释器的 ABI 和平台标签。
# 只打包 Python 源码,输出到 dist/core-only。 uv build --wheel --python .venv-uv/bin/python --out-dir dist/core-only3. 使用 pip 安装本地 wheel
以下以 CPython 3.12、Linux ARM64 和 PyTorch 2.10 为例。将
HP_WHEEL设为./build.sh输出的实际 wheel 路径。把与目标 Python ABI 和架构匹配的 CPU 版 PyTorch 和 TorchNPU wheel 放到./wheels,需要 HyperMulticore 时也将对应 wheel 放入该目录。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.):
2911e3f8基于f908f4d6。本次变更通过git diff --check和autogit check。build组,确认安装了锁定的pybind11==3.1.0。build.sh生成 CPython 3.12 的 wheel,并成功从 wheel 导入 Indexed Dataset C++ 扩展。Provides-Extra包含 7 个设备选项和 1 个独立的hyper-multicore选项,uv 会拒绝--extra cpu。Docker 构建脚本通过语法和参数传递检查。build.sh生成 CPython 3.12 wheel,并在独立环境用 pip 安装[torch-npu-2-10]和[torch-npu-2-10,hyper-multicore]。两者均安装torch==2.10.0+cpu和torch-npu==2.10.0.post7,只有后者安装hyper-multicore==0.1.0.dev0,且两套环境的pip check均通过。 两套环境均使用 pip 安装的 wheel 在两张 Ascend 910B3 上通过test_llama_rms_module_replacement。2.9.1+cu128。已将 CPython 3.11 的 Linux x86_64 HyperMulticore wheel 用 pip 安装到隔离目录,并校验了已安装的环境脚本。Self-checklist: