Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
215 lines (196 loc) · 5.42 KB
/
Copy pathpyproject.toml
File metadata and controls
215 lines (196 loc) · 5.42 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
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# NOTE: This file has been modified by Intel Corporation.
[project]
name = "torch-tweak"
readme = "README.md"
description = "Torch Tweak is an inference toolkit designed for tuning and deploying Deep Learning models with a focus on Intel XPU (GPU) accelerators."
dynamic = ["version"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: POSIX :: Linux",
]
license = "Apache-2.0"
license-files = ["LICENSE", "third-party-programs.txt"]
authors = [{ name = "Intel Corporation" }]
maintainers = [{ name = "Intel Corporation" }]
keywords = [
"inference",
"tune",
"intel",
"openvino",
"pytorch",
"torch",
]
requires-python = ">=3.11"
dependencies = [
"numpy>=2",
"openvino>=2026.2.1",
"psutil",
"tabulate>=0.10.0",
"torchao>=0.17.0",
"wrapt~=2.2"
]
[project.urls]
"Documentation" = "https://github.com/intel/torch-tweak"
"Repository" = "https://github.com/intel/torch-tweak.git"
"Tracker" = "https://github.com/intel/torch-tweak/issues"
[project.optional-dependencies]
xpu = [
"torch>=2.13.0",
"fsspec>=2026.6.0", # sec
]
test = [
"datasets>=4.8.5,<6.0.0",
"diffusers>=0.40.0,<1.0",
"fsspec>=2026.6.0", # sec
"multidict>=6.9.1", # sec
"pytest>=9.1.1",
"pytest-mock",
"pillow>=13.0.0",
"pyarrow>=24.0.0", # sec
"sentencepiece>=0.2.1",
"timm",
"transformers>=5.13.0,<6",
"urllib3>=2.7.0", # sec
]
doc = [
"mike >= 2.2.0",
"mkdocs-htmlproofer-plugin >= 1.5.0",
"mkdocs-material >= 9.7.6",
"mkdocs-redirects >= 1.2.3",
"mkdocstrings[python] >= 1.0.4",
"mkdocstrings-python >= 2.0.5",
"properdocs >= 1.6.7",
# Keep this pin equal to the ruff-pre-commit rev. Lint fails when they differ.
"ruff==0.17.1",
]
dev = [
"torch-tweak[test]",
"torch-tweak[doc]",
"pre-commit",
"pre-commit-uv",
"uv>=0.13.5",
"virtualenv>=21.7.13", # sec
]
[build-system]
requires = [
"hatchling>=1.27.0",
"hatch-vcs>=0.4.0",
"setuptools>=83.0.0"
]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["torch_tweak"]
# hatch-vcs wraps setuptools_scm, so raw-options are passed through to it verbatim.
#
# We're dropping here a specific git version, when building. Now, instead of a version like
# "torch_tweak==0.1.dev1+g7c6ac7b94", we're getting "torch_tweak==0.1.dev1".
# This is mostly to solve the CI issue, when there's unexpected git dirty state.
#
# We could bring more accurate version, using local, private scheme, but this can fail in some scenarios...?
# Ref. https://github.com/pypa/setuptools-scm/issues/1084
[tool.hatch.version]
source = "vcs"
raw-options = { local_scheme = "no-local-version", fallback_version = "0.4.0" }
[dependency-groups]
xpu-nightly = ["torch>=2.13.0", "triton-xpu"]
xpu-stable = ["torch>=2.13.0"]
[tool.uv]
managed = true
index-strategy = "unsafe-best-match"
default-groups = ["xpu-stable"]
environments = [
"sys_platform == 'linux' and platform_machine == 'x86_64'",
]
required-environments = [
"sys_platform == 'linux' and platform_machine == 'x86_64'",
]
conflicts = [
[{ group = "xpu-nightly" }, { group = "xpu-stable" }],
[{ group = "xpu-nightly" }, { extra = "xpu" }],
]
[[tool.uv.index]]
name = "pytorch-xpu-nightly"
url = "https://download.pytorch.org/whl/nightly/xpu"
explicit = true
[[tool.uv.index]]
name = "pytorch-xpu"
url = "https://download.pytorch.org/whl/xpu"
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = [
{ index = "pytorch-xpu-nightly", group = "xpu-nightly" },
{ index = "pytorch-xpu", group = "xpu-stable" },
{ index = "pytorch-xpu", extra = "xpu" },
]
torchao = { index = "pytorch-cpu" }
triton-xpu = [
{ index = "pytorch-xpu-nightly", group = "xpu-nightly" },
]
# Pytest's live log level can be overriden with --log-cli-level=DEBUG
[tool.pytest.ini_options]
log_cli = true
log_cli_level = "WARNING"
addopts = ["--import-mode=importlib", "--doctest-modules"]
pythonpath = ["."]
testpaths = ["torch_tweak", "tests/unit", "tests/functional"]
markers = [
"functional: mark test as a functional test",
"nightly: mark test to be run in nightly workflow",
]
[tool.ruff]
preview = true
line-length = 120
indent-width = 4
target-version = "py310"
[tool.ruff.lint]
select = [
"A",
"B",
"C",
"C4",
"C90",
"D",
"E",
"F",
"I",
"N",
"W",
"T",
"T10",
"T20",
"UP",
"CPY",
"G004"
]
ignore = ["E266", "E501", "N818"]
exclude = ["**/*.ipynb"]
[tool.ruff.lint.per-file-ignores]
"**/__init__.py" = ["D104"]
"**/__version__.py" = ["D100"]
"**/{tests,docs,tools,examples}/*" = ["C416", "D", "T201"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "lf"