pytorch/cmake
maajidkhann 09f7f62cfe Fix atomic operation compatibility for ARMv8-A (Raspberry Pi 4) by adjusting compilation flags (#148070)
**Issue:**
* The ldaddal instruction is an AArch64 atomic operation available from ARMv8.1-A onwards.
* Raspberry Pi 4 (Cortex-A72) is ARMv8-A, which does not support ldaddal, leading to failures when running PyTorch built with march=armv8.2-a+sve
* This led to an issue when running PyTorch on ARMv8-A (Raspberry Pi 4), as unsupported atomic operations were generated.

**Fix:**
* Updated the build flags to explicitly use **-march=armv8-a+sve**, ensuring GCC and clang promotes it correctly and resolves compatibility issues with armv8 and still work correctly for SVE like before.
* This ensures that PyTorch builds correctly for ARMv8-A platforms (e.g., Raspberry Pi 4) while still enabling SVE for supported hardware.

Test plan:
 - Allocate `a1.4xlarge` on AWS
 - Run following script using wheel produced by this PR
 ```python
import torch
def f(x):
    return x.sin() + x.cos()

print(torch.__version__)
f_c = torch.jit.script(f)
```
- Observe no crash
```
$ python3 foo.py
2.7.0.dev20250313+cpu
```
- Observe crash with 2.6.0
```
$ python3 foo.py
2.6.0+cpu
Illegal instruction (core dumped)
```

Fixes #146792

Pull Request resolved: https://github.com/pytorch/pytorch/pull/148070
Approved by: https://github.com/malfet
2025-03-15 00:02:38 +00:00
..
External [ROCm] Bump AOTriton to 0.9.2b (#148433) 2025-03-07 22:10:07 +00:00
Modules [ROCm][Windows] Fix OpenMP Flags for clang-cl (#148097) 2025-03-10 22:47:15 +00:00
Modules_CUDA_fix [NVIDIA] Full Family Blackwell Support codegen (#145436) 2025-01-24 04:36:00 +00:00
public [ROCm][Windows] Enable hipblaslt for Windows (#148563) 2025-03-10 21:07:16 +00:00
Allowlist.cmake
BuildVariables.cmake
Caffe2Config.cmake.in
CheckAbi.cmake
cmake_uninstall.cmake.in
Codegen.cmake Fix atomic operation compatibility for ARMv8-A (Raspberry Pi 4) by adjusting compilation flags (#148070) 2025-03-15 00:02:38 +00:00
DebugHelper.cmake
Dependencies.cmake [ROCm][Windows] Enable hipblaslt for Windows (#148563) 2025-03-10 21:07:16 +00:00
FlatBuffers.cmake
GoogleTestPatch.cmake
IncludeSource.cpp.in
iOS.cmake
Metal.cmake [MPS] Support includes in metal objects (#145087) 2025-01-18 05:35:22 +00:00
MiscCheck.cmake Remove CAFFE2_USE_EXCEPTION_PTR (#147247) 2025-03-06 02:56:23 +00:00
prioritized_text.txt
ProtoBuf.cmake
ProtoBufPatch.cmake
Summary.cmake Revert "Reverting the PR adding Kleidiai-based int4 kernels (#145392)" (#145505) 2025-01-23 18:50:59 +00:00
TorchConfig.cmake.in Revert "Reverting the PR adding Kleidiai-based int4 kernels (#145392)" (#145505) 2025-01-23 18:50:59 +00:00
TorchConfigVersion.cmake.in
VulkanCodegen.cmake
VulkanDependencies.cmake