skip install qigen(windows)
This commit is contained in:
parent
604c96144f
commit
71d56c76d0
1 changed files with 18 additions and 12 deletions
12
setup.py
12
setup.py
|
@ -4,6 +4,7 @@ from pathlib import Path
|
|||
from setuptools import setup, Extension, find_packages
|
||||
import subprocess
|
||||
import math
|
||||
import platform
|
||||
|
||||
os.environ["CC"] = "g++"
|
||||
os.environ["CXX"] = "g++"
|
||||
|
@ -95,9 +96,10 @@ additional_setup_kwargs = dict()
|
|||
if BUILD_CUDA_EXT:
|
||||
from torch.utils import cpp_extension
|
||||
|
||||
if platform != 'Windows':
|
||||
p = int(subprocess.run("cat /proc/cpuinfo | grep cores | head -1", shell=True, check=True, text=True, stdout=subprocess.PIPE).stdout.split(" ")[2])
|
||||
|
||||
subprocess.call(["python", "./autogptq_extension/qigen/generate.py", "--module", "--search", "--p", str(p)])
|
||||
|
||||
if not ROCM_VERSION:
|
||||
from distutils.sysconfig import get_python_lib
|
||||
conda_cuda_include_dir = os.path.join(get_python_lib(), "nvidia/cuda_runtime/include")
|
||||
|
@ -120,7 +122,11 @@ if BUILD_CUDA_EXT:
|
|||
"autogptq_extension/cuda_256/autogptq_cuda_256.cpp",
|
||||
"autogptq_extension/cuda_256/autogptq_cuda_kernel_256.cu"
|
||||
]
|
||||
),
|
||||
)
|
||||
]
|
||||
|
||||
if platform != 'Windows':
|
||||
extensions.append(
|
||||
cpp_extension.CppExtension(
|
||||
"cQIGen",
|
||||
[
|
||||
|
@ -128,7 +134,7 @@ if BUILD_CUDA_EXT:
|
|||
],
|
||||
extra_compile_args = ["-O3", "-mavx", "-mavx2", "-mfma", "-march=native", "-ffast-math", "-ftree-vectorize", "-faligned-new", "-std=c++17", "-fopenmp", "-fno-signaling-nans", "-fno-trapping-math"]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
if os.name == "nt":
|
||||
# On Windows, fix an error LNK2001: unresolved external symbol cublasHgemm bug in the compilation
|
||||
|
|
Loading…
Add table
Reference in a new issue