Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
AutoAWQ
Commits
1a3acf02
Commit
1a3acf02
authored
Sep 01, 2023
by
Casper
Browse files
Generalize to Linux and Windows
parent
00ec82bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
setup.py
setup.py
+15
-4
No files found.
setup.py
View file @
1a3acf02
...
@@ -3,7 +3,7 @@ import torch
...
@@ -3,7 +3,7 @@ import torch
from
pathlib
import
Path
from
pathlib
import
Path
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
from
distutils.sysconfig
import
get_python_lib
from
distutils.sysconfig
import
get_python_lib
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDA
Extension
,
CUDA_HOME
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDA
_HOME
,
CUDAExtension
os
.
environ
[
"CC"
]
=
"g++"
os
.
environ
[
"CC"
]
=
"g++"
os
.
environ
[
"CXX"
]
=
"g++"
os
.
environ
[
"CXX"
]
=
"g++"
...
@@ -19,7 +19,7 @@ common_setup_kwargs = {
...
@@ -19,7 +19,7 @@ common_setup_kwargs = {
"long_description_content_type"
:
"text/markdown"
,
"long_description_content_type"
:
"text/markdown"
,
"url"
:
"https://github.com/casper-hansen/AutoAWQ"
,
"url"
:
"https://github.com/casper-hansen/AutoAWQ"
,
"keywords"
:
[
"awq"
,
"autoawq"
,
"quantization"
,
"transformers"
],
"keywords"
:
[
"awq"
,
"autoawq"
,
"quantization"
,
"transformers"
],
"platforms"
:
[
"
w
in
dows
"
,
"
l
in
ux
"
],
"platforms"
:
[
"
l
in
ux
"
,
"
w
in
dows
"
],
"classifiers"
:
[
"classifiers"
:
[
"Environment :: GPU :: NVIDIA CUDA :: 11.8"
,
"Environment :: GPU :: NVIDIA CUDA :: 11.8"
,
"Environment :: GPU :: NVIDIA CUDA :: 12"
,
"Environment :: GPU :: NVIDIA CUDA :: 12"
,
...
@@ -79,6 +79,17 @@ def get_compute_capabilities():
...
@@ -79,6 +79,17 @@ def get_compute_capabilities():
check_dependencies
()
check_dependencies
()
arch_flags
=
get_compute_capabilities
()
arch_flags
=
get_compute_capabilities
()
if
os
.
name
==
"nt"
:
# Relaxed args on Windows
extra_compile_args
=
{
"nvcc"
:
arch_flags
}
else
:
extra_compile_args
=
{
"cxx"
:
[
"-g"
,
"-O3"
,
"-fopenmp"
,
"-lgomp"
,
"-std=c++17"
],
"nvcc"
:
[
"-O3"
,
"-std=c++17"
]
+
arch_flags
}
extensions
=
[
extensions
=
[
CUDAExtension
(
CUDAExtension
(
"awq_inference_engine"
,
"awq_inference_engine"
,
...
@@ -87,7 +98,7 @@ extensions = [
...
@@ -87,7 +98,7 @@ extensions = [
"awq_cuda/quantization/gemm_cuda_gen.cu"
,
"awq_cuda/quantization/gemm_cuda_gen.cu"
,
"awq_cuda/layernorm/layernorm.cu"
,
"awq_cuda/layernorm/layernorm.cu"
,
"awq_cuda/position_embedding/pos_encoding_kernels.cu"
"awq_cuda/position_embedding/pos_encoding_kernels.cu"
]
]
,
extra_compile_args
=
extra_compile_args
)
)
]
]
...
@@ -103,4 +114,4 @@ setup(
...
@@ -103,4 +114,4 @@ setup(
install_requires
=
requirements
,
install_requires
=
requirements
,
include_dirs
=
include_dirs
,
include_dirs
=
include_dirs
,
**
common_setup_kwargs
**
common_setup_kwargs
)
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment