forked from huggingface/optimum-neuron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
99 lines (90 loc) · 3.02 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
import re
from setuptools import find_namespace_packages, setup
# Ensure we match the version set in optimum/neuron/version.py
filepath = "optimum/neuron/version.py"
try:
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)
INSTALL_REQUIRES = [
"transformers >= 4.33.1",
"accelerate == 0.23.0",
"optimum >= 1.13.0",
"huggingface_hub >= 0.14.0",
"numpy>=1.18.5, <=1.21.6",
"protobuf<4",
]
TESTS_REQUIRE = [
"pytest",
"psutil",
"parameterized",
"GitPython",
"sentencepiece",
"datasets",
"sacremoses",
"diffusers >= 0.20.0",
"safetensors",
]
QUALITY_REQUIRES = [
"black",
"ruff",
"isort",
"hf_doc_builder @ git+https://github.com/huggingface/doc-builder.git",
]
EXTRAS_REQUIRE = {
"tests": TESTS_REQUIRE,
"quality": QUALITY_REQUIRES,
"neuron": [
"wheel",
"torch-neuron==1.13.1.*",
"torch==1.13.1.*",
"neuron-cc[tensorflow]==1.18.*",
"protobuf",
"torchvision",
],
"neuronx": [
"wheel",
"neuronx-cc>=2.10",
"torch-neuronx>=1.13.1.1.11.0",
"transformers-neuronx>=0.7.84",
"torch==1.13.1.*",
"torchvision==0.14.*",
"neuronx_distributed>=0.4.0",
],
"diffusers": ["diffusers"],
}
setup(
name="optimum-neuron",
version=__version__,
description=(
"Optimum Neuron is the interface between the Hugging Face Transformers and Diffusers libraries and AWS "
"Tranium and Inferentia accelerators. It provides a set of tools enabling easy model loading, training and "
"inference on single and multiple neuron core settings for different downstream tasks."
),
long_description=open("README.md", "r", encoding="utf-8").read(),
long_description_content_type="text/markdown",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
keywords="transformers, diffusers, mixed-precision training, fine-tuning, inference, tranium, inferentia, aws",
url="https://huggingface.co/hardware/aws",
author="HuggingFace Inc. Special Ops Team",
author_email="[email protected]",
license="Apache",
packages=find_namespace_packages(include=["optimum*"]),
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
dependency_links=["https://pip.repos.neuron.amazonaws.com"],
include_package_data=True,
zip_safe=False,
entry_points={"console_scripts": ["optimum-cli=optimum.commands.optimum_cli:main"]},
)