forked from huggingface/optimum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
114 lines (104 loc) · 3.68 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import re
from setuptools import find_namespace_packages, setup
# Ensure we match the version set in src/optimum/version.py
try:
filepath = "optimum/version.py"
with open(filepath) as version_file:
(__version__,) = re.findall('__version__ = "(.*)"', version_file.read())
except Exception as error:
assert False, "Error: Could not open '%s' due %s\n" % (filepath, error)
REQUIRED_PKGS = [
"coloredlogs",
"sympy",
"transformers[sentencepiece]>=4.26.0",
"torch>=1.9",
"packaging",
"numpy",
"huggingface_hub>=0.8.0",
"datasets",
]
TESTS_REQUIRE = [
"accelerate",
"pytest",
"requests",
"parameterized",
"pytest-xdist",
"Pillow",
"sacremoses",
"torchvision",
"diffusers>=0.17.0",
"torchaudio",
"einops",
"invisible-watermark",
]
QUALITY_REQUIRE = ["black~=23.1", "ruff>=0.0.241,<=0.0.259"]
BENCHMARK_REQUIRE = ["optuna", "tqdm", "scikit-learn", "seqeval", "torchvision", "evaluate>=0.2.0"]
EXTRAS_REQUIRE = {
"onnxruntime": [
"onnx",
"onnxruntime>=1.11.0",
"datasets>=1.2.1",
"evaluate",
"protobuf>=3.20.1",
],
"onnxruntime-gpu": [
"onnx",
"onnxruntime-gpu>=1.11.0",
"datasets>=1.2.1",
"evaluate",
"protobuf>=3.20.1",
"accelerate", # ORTTrainer requires it.
],
"exporters": ["onnx", "onnxruntime", "timm"],
"exporters-gpu": ["onnx", "onnxruntime-gpu", "timm"],
"exporters-tf": ["tensorflow>=2.4,<=2.12.1", "tf2onnx", "onnx", "onnxruntime", "timm", "h5py", "numpy<1.24.0"],
"diffusers": ["diffusers"],
"intel": "optimum-intel>=1.11.0",
"openvino": "optimum-intel[openvino]>=1.11.0",
"nncf": "optimum-intel[nncf]>=1.11.0",
"neural-compressor": "optimum-intel[neural-compressor]>=1.11.0",
"graphcore": "optimum-graphcore",
"habana": "optimum-habana",
"neuron": "optimum-neuron[neuron]",
"neuronx": "optimum-neuron[neuronx]",
"furiosa": "optimum-furiosa",
"dev": TESTS_REQUIRE + QUALITY_REQUIRE,
"tests": TESTS_REQUIRE,
"quality": QUALITY_REQUIRE,
"benchmark": BENCHMARK_REQUIRE,
"doc-build": ["accelerate"],
}
setup(
name="optimum",
version=__version__,
description="Optimum Library is an extension of the Hugging Face Transformers library, providing a framework to "
"integrate third-party libraries from Hardware Partners and interface with their specific "
"functionality.",
long_description=open("README.md", "r", encoding="utf-8").read(),
long_description_content_type="text/markdown",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
keywords="transformers, quantization, pruning, optimization, training, inference, onnx, onnx runtime, intel, "
"habana, graphcore, neural compressor, ipu, hpu",
url="https://github.com/huggingface/optimum",
author="HuggingFace Inc. Special Ops Team",
author_email="[email protected]",
license="Apache",
packages=find_namespace_packages(include=["optimum*"]),
install_requires=REQUIRED_PKGS,
extras_require=EXTRAS_REQUIRE,
python_requires=">=3.7.0",
include_package_data=True,
zip_safe=False,
entry_points={"console_scripts": ["optimum-cli=optimum.commands.optimum_cli:main"]},
)