Skip to content

[CI] Support multi-Python version build (3.10/3.11/3.12)#7230

Open
EmmonsCurse wants to merge 2 commits intoPaddlePaddle:developfrom
EmmonsCurse:add_multi_python
Open

[CI] Support multi-Python version build (3.10/3.11/3.12)#7230
EmmonsCurse wants to merge 2 commits intoPaddlePaddle:developfrom
EmmonsCurse:add_multi_python

Conversation

@EmmonsCurse
Copy link
Copy Markdown
Collaborator

Motivation

Support multi-Python version build (3.10/3.11/3.12)

Modifications

  • Add PYTHON_VERSION input parameter to _build_linux.yml
  • Switch Python env via LD_LIBRARY_PATH/PATH in container
  • Isolate CCache and pip cache by Python version

Usage or Command

N/A

Accuracy Tests

N/A

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Apr 7, 2026

Thanks for your contribution!

@EmmonsCurse
Copy link
Copy Markdown
Collaborator Author

/skip-ci ci_iluvatar
/skip-ci ci_hpu
/skip-ci build_xpu

Copy link
Copy Markdown

@fastdeploy-bot fastdeploy-bot left a comment

Choose a reason for hiding this comment

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

🤖 AI Code Review | 2026-04-08 10:36 CST

📋 Review 摘要

PR 概述:支持多 Python 版本构建(3.10/3.11/3.12),添加 PYTHON_VERSION 参数并实现环境切换和缓存隔离

变更范围.github/workflows/_build_linux.yml.github/workflows/pr_build_and_test.yml

影响面 Tag[CI]

📝 PR 规范检查

✅ 标题格式正确:[CI] Support multi-Python version build (3.10/3.11/3.12)
✅ 描述完整,包含 Motivation 和 Modifications

问题

级别 文件 概述
🔴 Bug pr_build_and_test.yml:71 所有测试任务被注释掉
🔴 Bug pr_build_and_test.yml:19 Python 3.10 构建被移除
🔴 Bug _build_linux.yml:236 arctic_inference 在 3.11/3.12 不可用

总体评价

多 Python 版本支持的实现思路正确(环境切换、缓存隔离),但存在严重的测试缺失问题。建议在解决测试问题后再合并。

MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
# unittest_coverage:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Bug 所有测试任务都被注释掉,合并后 CI 将不再运行任何测试。

  • unittest_coverage
  • four_cards_test
  • logprob_test
  • pre_ce_test
  • base_test
  • stable_test

这个 PR 的目标是「支持多 Python 版本构建」,但没有任何测试来验证构建产物的正确性。

建议:

  1. 至少为某一个 Python 版本(如 3.11)启用测试任务
  2. 在 PR 描述中说明测试计划
  3. 考虑使用矩阵构建来统一管理多版本测试


build:
name: FD-Build-Linux
# build_310:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Bug Python 3.10 构建被注释掉,但没有说明原因。

Python 3.10 是目前最常用的版本之一,移除它的构建可能影响用户使用。

建议:

  1. 如果是临时禁用,请在 PR 描述中说明
  2. 如果计划废弃 3.10,需要提前通知用户
  3. 建议同时启用 build_310、build_311、build_312

python -m pip install wheel
# Install jinja2 for custom ops code generation (required for 3.11/3.12)
python -m pip install jinja2 wheel
# Skip cp310-specific wheels for non-3.10 Python versions
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Bug arctic_inference 只有 cp310-cp310 wheel,在 Python 3.11/3.12 上会跳过安装。

arctic_inference @ https://paddle-qa.bj.bcebos.com/ernie/arctic_inference-0.1.3-cp310-cp310-linux_x86_64.whl

这可能导致:

  1. 某些功能在 3.11/3.12 上不可用
  2. 运行时出现 ImportError

建议:

  1. 确认 arctic_inference 是否是必须依赖
  2. 如果是,需要为 3.11/3.12 提供对应的 wheel
  3. 如果不是必须的,考虑移到 optional dependencies

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.

2 participants