Standardize Python packaging and isolate bundled MLIR - #561
Draft
mouliangyu wants to merge 19 commits into
Draft
Conversation
mouliangyu
force-pushed
the
codex/standardize-python-packaging
branch
from
July 23, 2026 06:36
85332a3 to
1373186
Compare
mouliangyu
force-pushed
the
feature-vmi
branch
2 times, most recently
from
July 23, 2026 09:32
84a34b5 to
04d95b2
Compare
mouliangyu
force-pushed
the
codex/standardize-python-packaging
branch
from
July 23, 2026 10:44
1373186 to
e4f3672
Compare
mouliangyu
force-pushed
the
codex/standardize-python-packaging
branch
from
July 27, 2026 14:17
f8c139c to
4b86886
Compare
mouliangyu
force-pushed
the
codex/standardize-python-packaging
branch
from
July 28, 2026 04:54
376ff6e to
fa9b629
Compare
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.
背景
PTOAS 原先通过自定义 PEP 517 backend、
setup.py、wheel bootstrap、运行时路径扫描和多套发布脚本维护 Python 包。这些代码重复承担了标准打包工具已有的 metadata、editable install、console script、wheel 组装和 native dependency repair,也使 CLI、PTODSL、CI、wheel 和 standalone archive 显式依赖源码树、LLVM build tree 或旧 install tree 的内部布局。同时,直接发布顶层
mlir包会与进程中其他 MLIR Python distribution 冲突。PTOAS 需要拥有一套自洽的 MLIR Python runtime,并与自己的 compiler native module 共享同一个 MLIR CAPI。本 PR 将 Python 构建与发布链路收敛到 scikit-build-core、AddMLIRPython 和标准平台 repair 工具,并把 PTOAS 自带的 MLIR runtime 隔离到
ptoas.mlir。修改内容
scikit-build-core作为标准 PEP 517/660 backend:ptoas;packaging/ptoas-vmi发布ptoas-vmi;setup.py或 wheel bootstrap。ptoas.mlir和ptoas.mlir.dialects.pto;MLIR_PYTHON_PACKAGE_PREFIX=ptoas.mlir.;ptoas_mlir;mlir。PTOASPythonCAPI;-Werror,PTOAS 自有 binding 和 compiler 代码继续保持-Werror。ptoas._core:_core,不再扫描 native library 路径。ptoas._cli:main;PTOAS_BIN,否则使用标准PATH;_bootstrap.py、_launcher、_runtime_entry和跨仓库/build/install tree 的路径猜测。quick_install.sh使用标准 editable install;auditwheel repair,macOS wheel 使用delocate-wheel;PTOAS_Python和PTOAS_CompilerArchive两个 CMake component 组装受控 install tree;_core和PTOASPythonCAPI,仅在 AddMLIRPython 的_mlir_libs边界扫描自动生成 modules;file(GET_RUNTIME_DEPENDENCIES)收集外部依赖,检测 unresolved 和同名 ABI 冲突;$ORIGINRPATH,macOS 使用delocate-path;验证
from ptoas.mlir import ir通过;from ptoas.mlir.dialects import pto通过;import ptodsl通过;import mlir不再由 PTOAS 提供。check-pto:1384/1388 通过;剩余 4 个 A3 tadd FileCheck failure 为本分支已有问题,与 Python packaging 无关。ptobc_stage9_e2e外通过。PYTHONPATH、LD_LIBRARY_PATH、DYLD_LIBRARY_PATH后,ptoas --version和代表性.pto编译通过。git diff --check通过。验证范围说明
auditwheel repair --plat manylinux_2_34受本机编译器生成的新版本 glibc/libstdc++ symbols 限制;manylinux runner 上的实际 repair、wheel install 和 smoke test由build_wheel.yml覆盖。build_wheel_mac.yml覆盖,本地 Linux 环境未执行 macOS runtime 验证。ptobc_stage9_e2e和上述 4 个 A3 tadd failure 未在本 PR 中扩展范围处理。