-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathpytorch-v2.5.0-no-macos-arm64-sleef.patch
30 lines (27 loc) · 1.51 KB
/
pytorch-v2.5.0-no-macos-arm64-sleef.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
diff -Nuarp pytorch-v2.5.0.orig/CMakeLists.txt pytorch-v2.5.0/CMakeLists.txt
--- pytorch-v2.5.0.orig/CMakeLists.txt 2024-10-18 00:29:44.000000000 +0800
+++ pytorch-v2.5.0/CMakeLists.txt 2024-10-18 15:38:25.827246871 +0800
@@ -914,14 +914,6 @@ endif()
if(USE_SLEEF_FOR_ARM_VEC256)
string(APPEND CMAKE_CXX_FLAGS " -DAT_BUILD_ARM_VEC256_WITH_SLEEF")
- add_definitions(-DAT_BUILD_ARM_VEC256_WITH_SLEEF)
-endif()
-
-# Enable sleef on macOS with Apple silicon by default
-if((${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") AND ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64"))
- message(STATUS "Running on macOS with Apple silicon")
- string(APPEND CMAKE_CXX_FLAGS " -DAT_BUILD_ARM_VEC256_WITH_SLEEF")
- add_definitions(-DAT_BUILD_ARM_VEC256_WITH_SLEEF)
endif()
if(USE_XNNPACK)
diff -Nuarp pytorch-v2.5.0.orig/torch/_inductor/cpu_vec_isa.py pytorch-v2.5.0/torch/_inductor/cpu_vec_isa.py
--- pytorch-v2.5.0.orig/torch/_inductor/cpu_vec_isa.py 2024-10-18 00:29:49.000000000 +0800
+++ pytorch-v2.5.0/torch/_inductor/cpu_vec_isa.py 2024-10-18 15:39:26.949249786 +0800
@@ -152,8 +152,6 @@ cdll.LoadLibrary("__lib_path__")
class VecNEON(VecISA):
_bit_width = 256 # This is required to leverage the compute implemented in aten/src/ATen/cpu/vec/vec256/vec256_float_neon.h
_macro = ["CPU_CAPABILITY_NEON"]
- if sys.platform == "darwin" and platform.processor() == "arm":
- _macro.append("AT_BUILD_ARM_VEC256_WITH_SLEEF")
_arch_flags = "" # Unused
_dtype_nelements = {torch.float: 8, torch.bfloat16: 16, torch.float16: 16}