[Build] Packaging vendored liblapack dylib on ARM64 platform#79516
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Pull request overview
This PR updates Paddle’s build/packaging logic so that on Linux ARM64 builds it uses an ARM64-specific prebuilt LAPACK bundle, and avoids unconditionally packaging GNU_RT_LIB_1 (e.g., libquadmath) when it is not provided.
Changes:
- Add a Linux ARM (
WITH_ARM) branch incmake/external/lapack.cmaketo download an ARM64-specific LAPACK archive. - Make packaging/copying of
GNU_RT_LIB_1conditional in both the generated and templatesetup.pylogic to support platforms/configs where it is absent.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| setup.py | Only package/copy GNU_RT_LIB_1 when present in env_dict (supports ARM64 where it may be empty). |
| python/setup.py.in | Mirror the conditional packaging/copy logic for GNU_RT_LIB_1 in the CMake-generated setup script. |
| cmake/external/lapack.cmake | Add ARM64-specific LAPACK prebuilt download settings under LINUX + WITH_ARM. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
risemeup1111
left a comment
There was a problem hiding this comment.
发现一个会影响 ARM/Jetson 构建路径的问题,具体建议已放在行内评论中,建议修复后再继续合入。CI 目前还有检查在运行,后续仍需结合最新 CI 结果确认。
| CACHE STRING "" FORCE) | ||
| set(LAPACK_URL_MD5 71f8cc8237a8571692f3e07f9a4f25f6) | ||
| set(GNU_RT_LIB_1 "${LAPACK_LIB_DIR}/libquadmath.so.0") | ||
| if(WITH_ARM) |
There was a problem hiding this comment.
问题: 这里仅判断 WITH_ARM 会漏掉 WITH_NV_JETSON=ON 的配置路径。CMakeLists.txt 在 include(third_party) 之后才把 WITH_NV_JETSON 强制转换成 WITH_ARM=ON,所以用户只传 -DWITH_NV_JETSON=ON 时,lapack.cmake 已经进入 else() 并下载 x86 的 lapack_lnx_v3.10.0.20210628.tar.gz。这会让 Jetson/ARM wheel 继续打包错误架构的 LAPACK,和本 PR 的修复目标相反。
处理要求:请针对该评论修复并提交新的 commit。
| if(WITH_ARM) | |
| if(WITH_ARM OR WITH_NV_JETSON) |
There was a problem hiding this comment.
@risemeup1111 你说的,在「include(third_party) 之后才把 WITH_NV_JETSON 强制转换成 WITH_ARM=ON」,这个逻辑在哪啊?
There was a problem hiding this comment.
有,依据在这几处:
CMakeLists.txt:613-614先执行include(third_party)cmake/third_party.cmake:400在这个阶段就会include(external/lapack)CMakeLists.txt:662-665才把WITH_NV_JETSON写回成WITH_ARM=ON
所以 lapack.cmake 读取到的是当时的 WITH_ARM,而不是后面才转换出来的值。也就是说,-DWITH_NV_JETSON=ON 但没有显式带 -DWITH_ARM=ON 时,仍然会走到当前的 else() 分支。
There was a problem hiding this comment.
@risemeup1111 已确定 NV JETSON 不再支持,这个很早就编译不出来了,已经确定 NV JETSON 支持后续可以移除
There was a problem hiding this comment.
确实,确定 NV JETSON 不再支持,属于废弃代码
There was a problem hiding this comment.
收到。如果 NV JETSON 已明确不在当前支持范围内,那这条不应作为本 PR 的阻塞项;我撤回前面这条建议,并关闭该线程。
risemeup1111
left a comment
There was a problem hiding this comment.
已复查,原先关于 NV JETSON 的阻塞意见已按当前支持范围撤回,细节已在原线程说明。当前改动未发现需要阻塞合入的问题;Coverage test 的失败看起来是 runner 的 Docker 权限问题,后续再按 CI 流程确认即可。
@ShigureNyako 喵子,Model-Benchmark 流水线里发现 PaddleTest 里用的 typo API def method_put_super_object_from_file(bos_client: BosClient):
# Compatibility layer for BosClient.put_super_object_from_file before bce-python-sdk==0.9.72
if hasattr(bos_client, "put_super_obejct_from_file"):
return bos_client.put_super_obejct_from_file
return bos_client.put_super_object_from_file
method_put_super_object_from_file(bos_client)(...)
|
|
✅ Cherry-pick successful! Created PR: #79518 |
PR Category
Environment Adaptation
PR Types
Bug fixes
Description
ARM64 上编译单独编译 liblapack 动态库,避免 paddle arm64 wheel 包里 liblapack 及其依赖项均为 x86 的
paddle/libslibblas.so.3libgfortran.so.3libphi_core.solibphi.solibwarpctc.solibcommon.soliblapack.so.3libphi_gpu.solibquadmath.so.0libwarprnnt.so该问题如下代码即可复现:
是否引起精度变化
否