File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -385,19 +385,16 @@ def get_extensions():
385
385
extra_compile_args ["cxx" ].extend (
386
386
["-O3" if not debug_mode else "-O0" , "-fdiagnostics-color=always" ]
387
387
)
388
-
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
- # )
388
+ if use_cpu_kernels and is_linux and hasattr (torch ._C ._cpu , "_is_avx512_supported" ):
389
+ if torch ._C ._cpu ._is_avx512_supported ():
390
+ extra_compile_args ["cxx" ].extend (
391
+ [
392
+ "-DCPU_CAPABILITY_AVX512" ,
393
+ "-march=native" ,
394
+ "-mfma" ,
395
+ "-fopenmp" ,
396
+ ]
397
+ )
401
398
402
399
if debug_mode :
403
400
extra_compile_args ["cxx" ].append ("-g" )
You can’t perform that action at this time.
0 commit comments