Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down Expand Up @@ -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`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# 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")
Expand Down
Loading