diff --git a/setup.py b/setup.py index 22b001b424..d9fc5a2f0d 100644 --- a/setup.py +++ b/setup.py @@ -85,8 +85,6 @@ def read_version(file_path="version.txt"): # └── TORCHAO_PARALLEL_BACKEND → Backend selection (aten_openmp, executorch, etc.) -from torchao.utils import TORCH_VERSION_AT_LEAST_2_7 - version_prefix = read_version() # Version is version.dev year month date if using nightlies and version if not version = ( @@ -388,16 +386,18 @@ def get_extensions(): ["-O3" if not debug_mode else "-O0", "-fdiagnostics-color=always"] ) - if use_cpu_kernels and is_linux and TORCH_VERSION_AT_LEAST_2_7: - if torch._C._cpu._is_avx512_supported(): - extra_compile_args["cxx"].extend( - [ - "-DCPU_CAPABILITY_AVX512", - "-march=native", - "-mfma", - "-fopenmp", - ] - ) + # TODO(future PR): make this work without using `TORCH_VERSION_AT_LEAST_2_7`, + # because we should not be using anything from `torchao` to build `torchao`. + # if use_cpu_kernels and is_linux and TORCH_VERSION_AT_LEAST_2_7: + # if torch._C._cpu._is_avx512_supported(): + # extra_compile_args["cxx"].extend( + # [ + # "-DCPU_CAPABILITY_AVX512", + # "-march=native", + # "-mfma", + # "-fopenmp", + # ] + # ) if debug_mode: extra_compile_args["cxx"].append("-g")