-
Notifications
You must be signed in to change notification settings - Fork 355
/
pyproject.toml
377 lines (344 loc) · 7.89 KB
/
pyproject.toml
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
[build-system]
requires = [
"setuptools>=68.0.0",
"packaging>=23.1",
"wheel>=0.40.0",
"ninja>=1.11.0",
"pyyaml>=6.0",
"cffi>=1.15.1",
"typing-extensions>=4.7.0",
"future>=0.18.3",
"tensorrt-cu12>=10.6.0,<10.8.0",
"torch>=2.6.0.dev,<2.7.0",
"pybind11==2.6.2",
"numpy",
]
build-backend = "setuptools.build_meta"
[project]
name = "torch_tensorrt"
authors = [{ name = "NVIDIA Corporation", email = "[email protected]" }]
description = "Torch-TensorRT is a package which allows users to automatically compile PyTorch and TorchScript modules to TensorRT while remaining in PyTorch"
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: GPU :: NVIDIA CUDA",
"License :: OSI Approved :: BSD License",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: POSIX :: Linux",
"Programming Language :: C++",
"Programming Language :: Python",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
]
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.9"
keywords = [
"pytorch",
"torch",
"tensorrt",
"trt",
"ai",
"artificial intelligence",
"ml",
"machine learning",
"dl",
"deep learning",
"compiler",
"dynamo",
"torchscript",
"inference",
]
dependencies = [
"torch>=2.6.0.dev,<2.7.0",
"tensorrt-cu12>=10.6.0,<10.8.0",
"tensorrt-cu12-bindings>=10.6.0,<10.8.0",
"tensorrt-cu12-libs>=10.6.0,<10.8.0",
"packaging>=23",
"numpy",
"typing-extensions>=4.7.0",
]
dynamic = ["version"]
[dependency-groups]
dev = [
"pre-commit>=2.20.0",
"black>=22.6.0",
"clang-format==14.0.6",
"typos",
"mypy",
"isort",
"ruff",
"pytest",
"pytest-xdist",
"parameterized>=0.2.0",
"expecttest==0.1.6",
"pyyaml",
]
[project.optional-dependencies]
torchvision = [
"torchvision",
] #Leaving torchvisions dependency unconstrained so uv can just install something that should work for the torch we have. TV's on PyT makes it hard to put version constrains in
quantization = ["nvidia-modelopt[deploy,hf,torch]~=0.17.0"]
monitoring-tools = ["rich>=13.7.1"]
jupyter = ["rich[jupyter]>=13.7.1"]
[project.urls]
Homepage = "https://pytorch.org/tensorrt"
Documentation = "https://pytorch.org/tensorrt"
Repository = "https://github.com/pytorch/tensorrt.git"
Changelog = "https://github.com/pytorch/tensorrt/releases"
[tool.setuptools]
package-dir = { "" = "py" }
include-package-data = false
[tool.uv]
environments = ["sys_platform == 'linux'", "sys_platform == 'windows'"]
prerelease = "if-necessary-or-explicit"
[tool.uv.sources]
torch = [
{ index = "pytorch-nightly-cu126"},
]
torchvision = [
{ index = "pytorch-nightly-cu126"},
]
[[tool.uv.index]]
name = "pytorch-nightly-cu126"
url = "https://download.pytorch.org/whl/nightly/cu126"
explicit = false
# [[tool.uv.index]]
# name = "pytorch-nightly-cu124"
# url = "https://download.pytorch.org/whl/nightly/cu124"
# explicit = true
# [[tool.uv.index]]
# name = "pytorch-nightly-cu118"
# url = "https://download.pytorch.org/whl/nightly/cu118"
# explicit = true
# [[tool.uv.index]]
# name = "pytorch-test-cu124"
# url = "https://download.pytorch.org/whl/test/cu124"
# explicit = false
# [[tool.uv.index]]
# name = "pytorch-test-cu118"
# url = "https://download.pytorch.org/whl/test/cu118"
# explicit = false
# [[tool.uv.index]]
# name = "pytorch-release-cu124"
# url = "https://download.pytorch.org/whl/cu124"
# explicit = false
# [[tool.uv.index]]
# name = "pytorch-release-cu118"
# url = "https://download.pytorch.org/whl/cu118"
# explicit = false
[tool.ruff]
# NOTE: Synchoronize the ignores with .flake8
lint.ignore = [
# these ignores are from flake8-bugbear; please fix!
"B007",
"B008",
"B017",
"B018", # Useless expression
"B019",
"B020",
"B023",
"B024",
"B026",
"B028", # No explicit `stacklevel` keyword argument found
"B904",
"B905",
"E402",
"C408", # C408 ignored because we like the dict keyword argument syntax
"E501", # E501 is not flexible enough, we're using B950 instead
"E721",
"E731", # Assign lambda expression
"E741",
"EXE001",
"F405",
"F821",
"F841",
# these ignores are from flake8-logging-format; please fix!
"G101",
"G201",
"G202",
"G003",
"G004",
# these ignores are from RUFF perf; please fix!
"PERF203",
"PERF4",
"SIM102",
"SIM103",
"SIM112", # flake8-simplify code styles
"SIM105", # these ignores are from flake8-simplify. please fix or ignore with commented reason
"SIM108",
"SIM110",
"SIM114", # Combine `if` branches using logical `or` operator
"SIM115",
"SIM116", # Disable Use a dictionary instead of consecutive `if` statements
"SIM117",
"SIM118",
]
#line-length = 120
lint.select = [
"B",
"C4",
"G",
"E",
"F",
"SIM1",
"W",
# Not included in flake8
"PERF",
"PLE",
"TRY302",
]
# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Allow autofix for all enabled rules (when `--fix`) is provided.
lint.fixable = [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"I",
"N",
"Q",
"S",
"T",
"W",
"ANN",
"ARG",
"BLE",
"COM",
"DJ",
"DTZ",
"EM",
"ERA",
"EXE",
"FBT",
"ICN",
"INP",
"ISC",
"NPY",
"PD",
"PGH",
"PIE",
"PL",
"PT",
"PTH",
"PYI",
"RET",
"RSE",
"RUF",
"SIM",
"SLF",
"TCH",
"TID",
"TRY",
"UP",
"YTT",
]
lint.unfixable = []
target-version = "py311"
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"env",
"py/torch_tensorrt/fx",
".github",
"examples",
"tests",
"tools",
"docs",
"docsrc",
"tests",
"setup.py",
"noxfile.py",
"__init__.py",
]
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.isort]
profile = "black"
py_version = 311
skip = ["py/torch_tensorrt/fx"]
[tool.black]
#line-length = 120
target-version = ["py38", "py39", "py310", "py311", "py312"]
force-exclude = """
elu_converter/setup.py
"""
[tool.mypy]
strict = true
ignore_missing_imports = true
show_error_codes = true
disable_error_code = "attr-defined"
no_implicit_optional = true
exclude = [
"^py/torch_tensorrt/fx",
"py/torch_tensorrt/fx",
"torch_tensorrt/fx",
"py/torch_tensorrt/_C.so",
"examples",
"docs",
"docsrc",
"tests",
"setup.py",
"noxfile.py",
]
python_version = "3.11"
follow_imports = "skip"
[[tool.mypy.overrides]]
module = "torch_tensorrt.dynamo.conversion.aten_converters"
disable_error_code = "arg-type"
[[tool.mypy.overrides]]
module = "torch_tensorrt.dynamo.lowering._decompositions"
disallow_untyped_calls = false
[[tool.mypy.overrides]]
module = "torch_tensorrt.fx.*"
ignore_errors = true
follow_imports = "skip"
[tool.typos]
files.extend-exclude = [
"docs/**/*",
"*/fx/*",
"docsrc/_rendered_examples/",
"core/*",
"!core/runtime/",
"third_party/",
"CHANGELOG.md",
"*.ipynb",
"cpp/",
"py/torch_tensorrt/fx/",
]
[tool.typos.default]
extend-ignore-identifiers-re = [
"^([A-z]|[a-z])*Nd*",
"^([A-z]|[a-z])*nd*",
"activ*([A-z]|[a-z]|[0-9])*,",
]
[tool.typos.default.extend-words]
arange = "arange"