[CINN] Make CINN compilable with arm CPU and add missing nvidia-* dependencies for arm wheel#78712
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Pull request overview
This PR updates Paddle/CINN build configuration to compile under WITH_CINN on ARM CPUs by removing x86-only assumptions and introducing reusable CMake helpers for architecture-aware paths.
Changes:
- Add
cmake/architecture.cmakewith helpers to normalize architecture, detect CUDA target directories, and map LLVM native targets. - Update multiple CUDA/CINN-related CMake scripts to use detected target directories (CUDA
targets/<arch>layout) and avoid x86-only flags on non-x86 platforms. - Tighten x86 feature detection in
pirspin lock and adjust CINN LLVM runtime IR generation flags to be conditional on x86_64.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| paddle/pir/include/core/spin_lock.h | Avoid defining x86-only relax primitive when building for ARM64. |
| paddle/phi/CMakeLists.txt | Make NVTX3 include path depend on detected CUDA target dir. |
| paddle/cinn/backends/llvm/CMakeLists.txt | Make LLVM IR generation flags conditional on x86_64; use configurable LLVM tool paths. |
| paddle/cinn/backends/CMakeLists.txt | Gate x86-only fake lib build behind x86_64 check. |
| cmake/cupti.cmake | Use normalized arch and detected CUDA target dir for include/lib lookup. |
| cmake/cudnn.cmake | Add detected CUDA target include/lib directories to cuDNN lookup. |
| cmake/cinn/nvtx.cmake | Add detected CUDA target lib directories to NVTX lookup. |
| cmake/cinn/llvm.cmake | Link LLVM target component based on native architecture instead of hardcoded X86. |
| cmake/cinn/external/llvm.cmake | Select ARM-specific LLVM prebuilt and use native target component; expose LLVM tool executables. |
| cmake/cinn/external/isl.cmake | Add ARM-specific ISL prebuilt selection and ensure download directory exists. |
| cmake/cinn/external/ginac.cmake | Add ARM-specific GiNaC prebuilt selection and ensure download directory exists. |
| cmake/cinn/core.cmake | Apply AVX/FMA flags only on x86_64 to allow ARM builds. |
| cmake/cinn.cmake | Remove hardcoded system lib include dir; search CUDA libraries in detected target dirs; prefer LLVM include dirs when available. |
| cmake/architecture.cmake | New shared CMake module for arch normalization and CUDA/LLVM target detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
nvidia-* dependencies for arm wheel
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (75.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #78712 +/- ##
==========================================
Coverage ? 75.00%
==========================================
Files ? 1
Lines ? 8
Branches ? 0
==========================================
Hits ? 6
Misses ? 2
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ependencies for arm wheel (PaddlePaddle#78712) --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
✅ Cherry-pick successful! Created PR: #78730 |
… `nvidia-*` dependencies for arm wheel (#78730) * [CINN] Make CINN compilable with arm CPU and add missing `nvidia-*` dependencies for arm wheel (#78712) --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [CI] Update precision check to `yuanlehome` (#78729) --------- Co-authored-by: Nyakku Shigure <sigure.qaq@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
PR Category
Environment Adaptation
PR Types
Devs
Description
使 Paddle 能够在
WITH_CINN下编译、运行,这包含如下几部分ginac、isl、llvmarm64 预编译包版本,并上传 bos,其中 llvm 使用低版本 gcc8 进行编译,确保只包含 glibc2.17 以保证最好的兼容性nvidia-*wheel 包依赖:nvidia-cudnn-cu13到9.15.1.9、nvidia-cublas到13.1.0.3This PR is co-authored with @copilot (gpt-5.4)
Remaining issues
正是因为之前极度依赖于开发镜像里装了 nvidia 相关依赖,所以 wheel 包缺失 nvidia 依赖才没被发现,但是在没有 wheel 包依赖的情况下,CINN 单测会暴露出默认 nvrtc 编译时找不到系统里 nv 相关头文件的问题,这个问题依然存在,但是对于用户而言,通过装 wheel 包的方式装 nv 相关依赖,该问题就不存在了
后续如果要在 ARM CPU上(也可能是 cu13 的问题,不是 ARM 的问题)跑单测或者开发可以注意下这一点,单独适配下,这个就暂时低优了
是否引起精度变化
是