forked from microsoft/Olive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
97 lines (82 loc) · 3.62 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
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
import json
import os
from setuptools import find_packages, setup
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, rel_path)) as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
raise RuntimeError("Unable to find version string.")
def get_extra_deps(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, rel_path)) as fp:
return json.load(fp)
# use techniques described at https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
# Don't use technique 6 since it needs extra dependencies.
VERSION = get_version("olive/__init__.py")
EXTRAS = get_extra_deps("olive/extra_dependencies.json")
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "requirements.txt")) as req_file:
requirements = req_file.read().splitlines()
CLASSIFIERS = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
long_description = (
"Olive is an easy-to-use hardware-aware model optimization tool that composes industry-leading techniques across"
" model compression, optimization, and compilation. Given a model and targeted hardware, Olive composes the best"
" suitable optimization techniques to output the most efficient model(s) for inferencing on cloud or edge, while"
" taking a set of constraints such as accuracy and latency into consideration."
)
description = long_description.split(".", maxsplit=1)[0] + "."
setup(
name="olive-ai",
version=VERSION,
description=description,
long_description=long_description,
author="Microsoft Corporation",
author_email="[email protected]",
license="MIT License",
classifiers=CLASSIFIERS,
url="https://microsoft.github.io/Olive/",
download_url="https://github.com/microsoft/Olive/tags",
packages=find_packages(include=["olive*"]),
python_requires=">=3.8.0",
install_requires=requirements,
extras_require=EXTRAS,
include_package_data=False,
package_data={
"olive": ["extra_dependencies.json"],
"olive.auto_optimizer": ["config_template/*.yaml"],
"olive.engine.packaging": ["sample_code/*/*/*"],
"olive.platform_sdk.qualcomm": ["create_python_env.sh", "create_python_env.ps1", "copy_libcdsprpc.ps1"],
"olive.systems.docker": ["Dockerfile*"],
"olive.systems.python_environment": ["common_requirements.txt"],
},
data_files=[],
entry_points={
"console_scripts": [
"olive.scripts.manage_compute_instance = olive.scripts.manage_compute_instance:main",
],
},
)