Skip to content

Commit d1c8118

Browse files
authored
remove torchao dependency from torchao build script (#2383)
Summary: We should not use torchao to build torchao. Before this PR, I got stuck in a loop where I had a broken install (for some other reason) and could not uninstall torchao with this setup script, because the script required a working torchao to run. Commenting out the offending code in this PR, leaving for a future person to actually fix it. Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent 21a2d29 commit d1c8118

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

setup.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ def read_version(file_path="version.txt"):
8585
# └── TORCHAO_PARALLEL_BACKEND → Backend selection (aten_openmp, executorch, etc.)
8686

8787

88-
from torchao.utils import TORCH_VERSION_AT_LEAST_2_7
89-
9088
version_prefix = read_version()
9189
# Version is version.dev year month date if using nightlies and version if not
9290
version = (
@@ -388,16 +386,18 @@ def get_extensions():
388386
["-O3" if not debug_mode else "-O0", "-fdiagnostics-color=always"]
389387
)
390388

391-
if use_cpu_kernels and is_linux and TORCH_VERSION_AT_LEAST_2_7:
392-
if torch._C._cpu._is_avx512_supported():
393-
extra_compile_args["cxx"].extend(
394-
[
395-
"-DCPU_CAPABILITY_AVX512",
396-
"-march=native",
397-
"-mfma",
398-
"-fopenmp",
399-
]
400-
)
389+
# TODO(future PR): make this work without using `TORCH_VERSION_AT_LEAST_2_7`,
390+
# because we should not be using anything from `torchao` to build `torchao`.
391+
# if use_cpu_kernels and is_linux and TORCH_VERSION_AT_LEAST_2_7:
392+
# if torch._C._cpu._is_avx512_supported():
393+
# extra_compile_args["cxx"].extend(
394+
# [
395+
# "-DCPU_CAPABILITY_AVX512",
396+
# "-march=native",
397+
# "-mfma",
398+
# "-fopenmp",
399+
# ]
400+
# )
401401

402402
if debug_mode:
403403
extra_compile_args["cxx"].append("-g")

0 commit comments

Comments
 (0)