Skip to content

add Model accuracy alignment - #1751

Merged
zjjlivein merged 32 commits into
PaddlePaddle:developfrom
zjjlivein:add_alignment_model_accuracy
Aug 19, 2026
Merged

add Model accuracy alignment#1751
zjjlivein merged 32 commits into
PaddlePaddle:developfrom
zjjlivein:add_alignment_model_accuracy

Conversation

@zjjlivein

@zjjlivein zjjlivein commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

PR Category

Execute Infrastructure

PR Types

Improvements

Description

add Model accuracy alignment

是否引起精度变化

@risemeup1111 risemeup1111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

序号 位置 优先级 状态
1 setup_venvs.sh:95 P1
2 setup_venvs.sh:141 P1
3 Test-release.yml:1009 P1
4 Test-release.yml:1004 P1
5 Test-release.yml:1402 P1
6 setup_venvs.sh:38 P2
7 setup_venvs.sh:128 P1
8 setup_venvs.sh:34 P1
9 setup_venvs.sh:186 P1
10 run_paddle_minimax.sh:1 P2
11 run_torch_minimax.sh:48 P1
12 Test-release.yml:1098 P1
13 setup_venvs.sh:29 P1

环境安装、运行脚本路径、coverage 上传、H20 多卡集成、对齐 workflow、模型路径、版权头及默认 wheel 地址问题均已修复,当前未发现阻塞性问题。

Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.

local torch_py="$1"

echo "[setup_venvs] torch python : ${torch_py}"
uv pip install --python "${torch_py}" "torch==${TORCH_VERSION}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

torch==2.12.0+cu130 在这里通过默认 uv/PyPI 源解析,但该源没有这个 CUDA 本地版本;在同样的默认源执行会得到 no version ... and requirements are unsatisfiable。因此 setup_torch_venv 会在对齐测试开始前直接失败。请显式配置提供 cu130 wheel 的索引或固定可下载的 wheel,并在 CI 中验证该版本可解析。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在当前提交将 Torch 安装改为使用 cu130 专用索引,torch==2.12.0+cu130 已可解析,本项已解决。

"pybind11[global]>=2.13,<3" "paddle-nvidia-nvshmem-cu13>=3.3.9,<3.5"

# PaddleFleet
uv pip install --python "${paddle_py}" "${paddle_index[@]}" --no-deps \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

这里创建的是隔离的 uv venv,但 PaddleFleet wheel 又使用了 --no-deps;该 wheel 的运行依赖包含 paddlepaddle-gpu,而本脚本中安装 Paddle 的命令仍被注释掉。系统 Python 里已有的 Paddle 不会自动进入这个 venv,后续 venv/paddle/bin/paddleformers-cli 导入 paddle 会直接失败。请在该 venv 安装与 wheel 匹配的 Paddle,或明确启用并验证 system site packages。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在当前提交移除 PaddleFleet wheel 安装的 --no-deps,并沿 Paddle cu130 源解析其 paddlepaddle-gpu 依赖,本项已解决。

Comment thread .github/workflows/Test-release.yml Outdated
export COVERAGE_FILE=/workspace/PaddleFleet/coveragedata-multi/.coverage
export COVERAGE_RCFILE=/workspace/PaddleFleet/ci/.coveragerc
bash -x PaddleFormers/tests/integration_test/qwen3vl_sft.sh fsdp h20
export PADDLEFLEET_WHEEL_PATH="dist/${{ needs.build_whl.outputs.root_whl_name }}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

这里导出的 wheel 路径是相对路径 dist/...run_alignment_test.sh 会先切换到 scripts/alignment_model_accuracy,随后 setup_venvs.sh 在该目录下原样执行 uv pip install ... dist/...,实际会查找 PaddleFleet/scripts/alignment_model_accuracy/dist,而构建产物在 PaddleFleet/dist。因此 CI 无法找到刚构建的 wheel。请传入绝对路径,或在切换目录前把路径解析为仓库根目录下的绝对路径。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在当前提交将 workflow 传入的两个 wheel 路径改为 /workspace/PaddleFleet/dist/... 绝对路径,与脚本切换目录后的解析位置一致,本项已解决。

# export COVERAGE_RCFILE=/workspace/PaddleFleet/ci/.coveragerc
# bash -x PaddleFormers/tests/integration_test/qwen3vl_sft.sh fsdp h20
# '
- name: alignment_model_accuracy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

这个替换后的 step 不创建 coveragedata-multi,也不会生成 coverage 数据;但下面的 H20 Coverage Upload to BOS 仍是 always(),并先无条件执行 ls /workspace/PaddleFleet/coveragedata-multicoverage combine。因此即使对齐测试成功,job 也会在上传阶段因目录/数据不存在而失败。请保留覆盖率产出,或让上传步骤与实际产出条件一致并处理空目录。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前提交已将 H20 multi-card job 及其 coverage 上传步骤整体注释,并从 coverage_check.needs 中移除该 job;当前 workflow 不再执行无产出目录的上传步骤,本项已解决。

Comment thread .github/workflows/Test-release.yml Outdated
echo -e "\033[32mIntegration test succeeded: GLM4.5.\033[0m"
fi
'
# - name: GLM4.5 pre-train

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

这里开始把 H20 多卡原有的 GLM4.5/Qwen 集成步骤整体改成注释,后面连续覆盖 pre-train、SFT、CP、LoRA、DPO、FP8、EP4 及 Qwen 变体,实际只剩一个 Minimax 对齐用例。这样会移除 release workflow 对既有模型和并行路径的必需覆盖,相关回归可以在合入后才暴露。请保留这些门禁,或提供等价且明确的替代覆盖,不要静默禁用整组测试。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前提交已恢复 H20 multi-card job 及其 GLM/Qwen 覆盖步骤;但 coverage_check.needs.github/workflows/Test-release.yml:1402)仍未包含 integration-test-H20-multi-card。coverage_check 会下载 h20-multi/coverage.xml,缺少该依赖可能导致它在上传完成前并发执行并读取不到当前产物。请将该 job 加回 needs 后再视为解决。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已复查当前 HEAD:coverage_check.needs 已包含 integration-test-H20-multi-card,并会在该 job 完成后再下载 h20-multi/coverage.xml。H20 多卡集成步骤及 coverage 依赖均已恢复,此问题已解决。

Comment thread .github/workflows/Test-release.yml Outdated
export COVERAGE_FILE=/workspace/PaddleFleet/coveragedata-multi/.coverage
export COVERAGE_RCFILE=/workspace/PaddleFleet/ci/.coveragerc
bash -x PaddleFormers/tests/integration_test/qwen3vl_sft.sh fsdp h20
export PADDLEFLEET_WHEEL_PATH="dist/${{ needs.build_whl.outputs.root_whl_name }}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在当前提交将 workflow 传入的两个 wheel 路径改为 /workspace/PaddleFleet/dist/... 绝对路径,与脚本切换目录后的解析位置一致,本项已解决。

Comment on lines +38 to +39
readonly UV_BIN_DIR="root/.local/bin"
readonly UV_CACHE_DIR_PATH="root/.cache/uv"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2

root/.local/bin 和下一行的 root/.cache/uv 都是相对路径;按 README 从 scripts/alignment_model_accuracy 调用时,会解析到源码树下的 scripts/alignment_model_accuracy/root/...。这既无法把通常位于 /root/.local/binuv 加入 PATH,也会把 uv 缓存写进源码目录。请恢复基于 ${HOME} 的路径,或在明确只支持 root 容器时使用带前导 / 的绝对路径。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前提交已为两条路径补上前导 /,分别恢复为 /root/.local/bin/root/.cache/uv,本项已解决。

echo "[setup_venvs] paddle python: ${paddle_py}"
local -a paddle_index=(
--index-url "${PADDLE_INDEX_URL}"
--index-strategy unsafe-best-match

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

删除 --extra-index-url https://pypi.org/simple/ 后,paddle_index 只剩 Paddle stable 源;该源没有 ninja==1.11.1.1,而脚本在这里的首个安装命令就会解析失败,末尾的 tensor-spec-worker 也同样无法从该源找到。请保留 PyPI extra index,或为 Paddle 包和通用依赖拆分索引参数。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前提交已将通用构建依赖改回默认 PyPI 索引,同时保留 Paddle wheel 的 stable 源,ninjatensor-spec-worker 不再被限制在 Paddle 源,本项已解决。

readonly PADDLEFLEET_WHEEL="${PADDLEFLEET_WHEEL_PATH:-${NIGHTLY_WHL_BASE}/paddlefleet/paddlefleet-0.4.0.dev20260807+d01517879a3-py3-none-any.whl}"
readonly PADDLEFLEET_OPS_WHEEL="${PADDLEFLEET_OPS_WHEEL_PATH:-${NIGHTLY_WHL_BASE}/paddlefleet-ops/paddlefleet_ops-0.4.0.dev20260807+d0151787-cp312-cp312-linux_x86_64.whl}"
readonly PADDLEFORMERS_WHEEL="${NIGHTLY_WHL_BASE}/paddleformers/paddleformers-0.0.0.dev-py3-none-any.whl"
readonly MEGATRON_CORE_WHEEL="wget https://paddle-qa.bj.bcebos.com/paddlefleet/whl/megatron_core-0.19.0+f2706b6f3-cp312-cp312-linux_x86_64.whl"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

MEGATRON_CORE_WHEEL 现在包含字面量前缀 wget ,但 setup_torch_venv 会把 "${MEGATRON_CORE_WHEEL}" 直接作为单个参数传给 uv pip install --no-deps。uv 会把它当成带空格的非法 requirement,而不是 wheel URL,Torch venv 会在安装 Megatron Core 前直接失败。请保留纯 URL;若必须先下载,请单独执行 wget 并把生成的文件路径传给 uv。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前提交已移除 wget 前缀,MEGATRON_CORE_WHEEL 恢复为可直接传给 uv 的纯 URL,本项已解决。

ensure_venv "venv/torch"
ensure_venv "venv/paddle"

# setup_torch_venv "${WORKSPACE_DIR}/venv/torch/bin/python"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

这里把 setup_torch_venv 调用注释掉了,但 run_alignment_test.sh 随后会执行 run_torch_minimax.sh,该脚本会 source venv/torch 并运行 Torch/Megatron 训练。当前 ensure_venv 只创建带 seed 的空环境,不会安装 torch、Megatron Core 或相关依赖,因此对齐 job 会在 Torch 用例启动时直接失败。请恢复该调用,并验证 Torch venv 在对齐入口前完成安装。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前提交已恢复 setup_torch_venv 调用,并在 Paddle venv 的构建依赖中补上 tensor-spec-worker;Torch/Megatron 对齐环境会在测试前完成安装,本项已解决。

@@ -0,0 +1,75 @@
#!/usr/bin/env bash

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2

本次重写删除了该脚本及对应 run_torch_minimax.sh 的 Apache 2.0 版权头。仓库的 ci/hooks/copyright.py 明确将 .sh 纳入检查;请保留原版权声明,避免依赖自动 hook 在 CI 中回写生成文件。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前提交已恢复两个运行脚本的 Apache 2.0 版权头,本项已解决。

Comment on lines +48 to +51
--model /home/.cache/PaddleFormers/MiniMax-V2.5-bf16_2EP

### data
--dataset /home/.cache/PaddleFormers/MiniMax-V2.5-bf16_2EP/alignment_torch.jsonl

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

这里只把 Torch 的模型和数据切到 /home/.cache/PaddleFormers,但同一用例的 Paddle YAML 仍在读取 /root/.cache/PaddleFormers。workflow 明确把共享 action cache 挂载到 /home/.cache,且没有在两处之间复制或建立链接;Paddle 侧会找不到资源,或两侧使用不同缓存内容,无法形成有效精度对齐。请让 Paddle YAML 与 Torch 参数统一使用同一个挂载目录,最好由单一环境变量派生。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前提交已将 Paddle YAML 的模型和数据路径统一为 /home/.cache/PaddleFormers/MiniMax-V2.5-bf16_2EP,与 Torch 对齐脚本一致,本项已解决。

echo -e "::error:: \033[31mIntegration test failed: GLM4.5.\033[0m"
export PADDLEFLEET_WHEEL_PATH="/workspace/PaddleFleet/dist/${{ needs.build_whl.outputs.root_whl_name }}"
export PADDLEFLEET_OPS_WHEEL_PATH="/workspace/PaddleFleet/dist/${{ needs.build_whl.outputs.ops_whl_name }}"
model_acc_align_exit_code=$?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

这里已经没有任何命令调用 run_alignment_test.shmodel_acc_align_exit_code=$? 只会取得上一条 export 的状态,通常恒为 0,因此 job 在未运行 Paddle/Torch 对齐的情况下仍报告成功。请恢复对齐脚本调用,并紧接着捕获该命令的退出码。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前提交已恢复 run_alignment_test.sh 调用,并在执行后紧接着捕获 $?;job 不再空跑,本项已解决。

readonly TE_VERSION="2.17.1"
readonly PADDLE_INDEX_URL="https://www.paddlepaddle.org.cn/packages/stable/cu130/"
readonly NIGHTLY_WHL_BASE="https://paddle-whl.bj.bcebos.com/nightly/cu130"
readonly FLEET_WHL_BASE="https://paddle-github-action.bj.bcebos.com/whl/"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1

新的 FLEET_WHL_BASE 下默认 Megatron Core 地址 megatron_core-0.19.0+f2706b6f3-cp312-cp312-linux_x86_64.whl 当前返回 404,workflow 又没有设置 MEGATRON_CORE_WHEEL_PATH 覆盖它;恢复对齐命令后,Torch venv 会在安装该 wheel 时失败。请使用实际存在的对象地址,或将 Megatron Core 与 ms-swift 配置为各自可用的基础路径。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已复查当前代码:FLEET_WHL_BASE 已切换为 Paddle QA 地址,Megatron Core 与 ms-swift 两个默认 wheel 地址均返回 HTTP 200。此前结论基于旧地址,现确认该问题已解决。

@zjjlivein
zjjlivein merged commit 60c8c4a into PaddlePaddle:develop Aug 19, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants