forked from zipnn/zipnn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
57 lines (51 loc) · 1.84 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from setuptools import setup, find_packages, Extension
import subprocess
import os
def update_submodules():
if os.path.exists(".git"):
try:
subprocess.check_call(["git", "submodule", "update", "--init", "--recursive"])
except subprocess.CalledProcessError as e:
print(f"Failed to update submodules: {e}")
raise
update_submodules()
split_dtype_extension = Extension(
"split_dtype",
sources=[
"csrc/split_dtype_module.c",
"csrc/split_dtype32.c",
"csrc/split_dtype16.c",
"include/FiniteStateEntropy/lib/fse_compress.c",
"include/FiniteStateEntropy/lib/fse_decompress.c",
"include/FiniteStateEntropy/lib/huf_compress.c",
"include/FiniteStateEntropy/lib/huf_decompress.c",
"include/FiniteStateEntropy/lib/entropy_common.c",
"include/FiniteStateEntropy/lib/hist.c",
],
include_dirs=["include/FiniteStateEntropy/lib/", "csrc/"],
extra_compile_args=["-O3", "-Wall", "-Wextra"],
extra_link_args=["-O3", "-Wall", "-Wextra"],
)
setup(
name="zipnn",
version="0.3.2",
author="Moshik Hershcovitch",
author_email="[email protected]",
description="A lossless and near-lossless compression method optimized for numbers/tensors in the Foundation Models environment",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
url="https://github.com/zipnn/zipnn",
packages=find_packages(include=["zipnn", "zipnn.*"]),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
install_requires=[
"numpy",
"zstandard",
"torch",
],
ext_modules=[split_dtype_extension], # Add the C extension module here
)