-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathpyproject.toml
More file actions
234 lines (211 loc) · 5.9 KB
/
pyproject.toml
File metadata and controls
234 lines (211 loc) · 5.9 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
[tool.ruff]
exclude = ["test_*.py"]
line-length = 121
[tool.ruff.lint]
ignore = ["ANN002", "ANN003", "ANN401", "C901", "D100", "D104", "D401", "D406", "D420", "C408", "PTH123", "N813"]
select = ["A", "C", "CPY", "D", "E", "ERA", "F", "FIX", "I", "N", "SIM", "T20", "W", "FA", "PTH"]
preview = true # enable preview features for copyright checking
[tool.ruff.lint.per-file-ignores]
"*.ipynb" = ["ERA", "CPY", "T"] # commented out code is intended for tutorials
"tests/*" = ["T20", "CPY"] # print statements are intended for tests
"docs/*" = ["CPY"]
"src/pruna/algorithms/base/tags.py" = ["E501"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.flake8-copyright]
author = "- Pruna AI GmbH"
[tool.ty.rules]
# Ignore rules that are stricter than mypy for transition period
unresolved-import = "ignore"
call-non-callable = "ignore" # mypy allows more dynamic method calls
index-out-of-bounds = "ignore" # mypy is more permissive with tuple indexing
unresolved-attribute = "ignore" # mypy is more permissive with module attributes
redundant-cast = "ignore" # mypy doesn't warn about redundant casts
unsupported-operator = "ignore" # mypy supports | syntax with from __future__ import annotations
invalid-return-type = "ignore" # mypy is more permissive with return types
invalid-parameter-default = "ignore" # mypy is more permissive with parameter defaults
no-matching-overload = "ignore" # mypy is more permissive with overloads
unresolved-reference = "ignore" # mypy is more permissive with references
possibly-missing-import = "ignore"
possibly-missing-attribute = "ignore"
missing-argument = "ignore"
unused-type-ignore-comment = "ignore"
[tool.coverage.run]
source = ["src/pruna"]
[tool.coverage.report]
omit = ["src/pruna/tests/*"]
show_missing = true
skip_covered = false
[tool.pytest.ini_options]
log_cli = true
log_cli_level = "INFO"
addopts = [
"--cov=src/pruna",
"--cov-report=term-missing",
"--cov-config=pyproject.toml",
"--durations=0"
]
python_files = "test_*.py"
testpaths = [
"tests/",
]
[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple" # regular PyPI
[[tool.uv.index]]
name = "pruna_internal"
url = "https://prunaai.pythonanywhere.com/simple/" # Pruna Pythonanywhere
default = true # default = True makes this index the lowest prio
[[tool.uv.index]]
name = "intel-pytorch-extension"
url = "https://pytorch-extension.intel.com/release-whl/stable/cpu/cn/"
[tool.uv]
index-strategy = "unsafe-best-match"
conflicts = [
[
{ extra = "awq" },
{ extra = "vbench" },
]
]
[tool.uv.sources]
gptqmodel = [
{ index = "pruna_internal", marker = "sys_platform != 'darwin' or platform_machine != 'arm64'"},
{ index = "pypi", marker = "sys_platform == 'darwin' and platform_machine == 'arm64'"},
]
[project]
name = "pruna"
version = "0.3.1"
description = "Smash your AI models"
authors = [
{name = "Pruna AI", email = "[email protected]"}
]
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.10,<3.13"
keywords = ["AI", "machine learning", "model optimization", "pruning"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"torch>=2.7.0",
"torchvision>=0.22.0",
"torchmetrics[image]",
"requests>=2.31.0",
"transformers<5.0.0",
"pytorch-lightning",
"huggingface-hub[hf-xet]>=0.30.0",
"datasets>=3.0",
"numpy>=1.24.4",
"numpydoc>=1.6.0",
"diffusers>=0.21.4",
"torch_pruning",
"ConfigSpace>=1.2.1",
"sentencepiece",
"librosa",
"openvino",
"soundfile",
"DeepCache",
"colorama",
"opentelemetry-api>=1.30.0",
"opentelemetry-sdk>=1.30.0",
"opentelemetry-exporter-otlp>=1.29.0",
"codecarbon",
"nvidia-ml-py",
"thop",
"timm",
"bitsandbytes; sys_platform != 'darwin' or platform_machine != 'arm64'",
"optimum-quanto>=0.2.5",
"ctranslate2==4.6.0",
"whisper-s2t==1.3.1",
"hqq==0.2.7.post1",
"torchao>=0.12.0,<0.16.0", # 0.16.0 breaks diffusers 0.36.0, torch+torch: https://github.com/pytorch/ao/issues/2919#issue-3375688762
"gliner; python_version >= '3.10'",
"piq",
"opencv-python",
"kernels",
"aenum",
"imageio-ffmpeg",
"jaxtyping",
"peft>=0.18.0",
"trl<=0.21.0",
"termcolor==2.3.0",
]
[project.optional-dependencies]
stable-fast = [
"xformers>=0.0.30",
"stable-fast-pruna==1.0.8",
]
# dependencies are added here because the wheels aren't bundling them
gptq = [
"logbar",
"tokenicer",
"threadpoolctl",
"device-smi",
"random-word",
"gptqmodel==4.0.0.dev0+cu126torch2.7; sys_platform != 'darwin' or platform_machine != 'arm64'",
"gptqmodel; sys_platform == 'darwin' and platform_machine == 'arm64'",
]
awq = [
"compressed-tensors >= 0.13.0",
"llmcompressor>=0.9",
"torch>=2.9.0"
]
full = [
"xformers>=0.0.30",
"stable-fast-pruna==1.0.8",
]
vbench = [
"vbench-pruna; sys_platform != 'darwin'",
]
dev = [
"wget",
"python-dotenv",
"jsonschema",
"jupyterlab",
"ipykernel",
"notebook",
"platformdirs",
"jsonschema",
"blobfile",
"pillow>=9.5.0",
"pre-commit",
"twine",
"pyc-wheel",
"ruff>=0.15.3", # introduction of D420 rule
"numpydoc>=1.9.0",
"numpydoc-validation",
"pytest",
"pytest-cov",
"pytest-rerunfailures",
"coverage",
"docutils",
"ty==0.0.20",
"types-PyYAML",
"logbar",
"pytest-xdist>=3.8.0",
]
cpu = []
intel = [
"intel-extension-for-pytorch>=2.7.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/README.md",
"/LICENSE",
]
[tool.hatch.build.targets.wheel]
packages = ["src/pruna"]
include = ["**/*.so"]
exclude = [
"tests*",
"docs*",
]