forked from NVIDIA/TensorRT-LLM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
240 lines (215 loc) · 8.12 KB
/
pyproject.toml
File metadata and controls
240 lines (215 loc) · 8.12 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
235
236
237
238
239
240
####################################################################################################
############################### BUILD CONFIGURATION ##############################################
####################################################################################################
[build-system]
requires = ["setuptools >= 64", "pip >= 24"]
build-backend = "setuptools.build_meta"
####################################################################################################
############################### LINTING, FORMATTING AND TESTING CONFIGURATION ####################
####################################################################################################
[tool.isort]
line_length = 80
# This should match the `include` in `[tool.ruff]`. See the comments in that section for why this
# is necessary.
extend_skip_glob = [
"**/auto_deploy/**",
"tensorrt_llm/_common.py",
"tensorrt_llm/_dlpack_utils.py",
"tensorrt_llm/_ipc_utils.py",
"tensorrt_llm/_mnnvl_utils.py",
"tensorrt_llm/_torch/models/modeling_pixtral.py",
"tensorrt_llm/disaggregated_params.py",
"tensorrt_llm/engine.py",
"tensorrt_llm/graph_rewriting.py",
"tensorrt_llm/logger.py",
"tensorrt_llm/lora_manager.py",
"tensorrt_llm/module.py",
"tensorrt_llm/moe_config.py",
"tensorrt_llm/profiler.py",
"tensorrt_llm/prompt_adapter_manager.py",
"tensorrt_llm/python_plugin.py",
"tensorrt_llm/sampling_params.py",
"tensorrt_llm/top_model_mixin.py",
"tests/unittest/_torch/modeling/test_modeling_mistral.py",
"tests/unittest/_torch/modeling/test_modeling_pixtral.py",
"tests/unittest/_torch/models/checkpoints/hf/test_weight_loader.py",
]
[tool.yapf]
based_on_style = "pep8"
column_limit = 80
[tool.yapfignore]
# This should match the `include` in `[tool.ruff]`. See the comments in that section for why this
# is necessary.
ignore_patterns = [
"**/auto_deploy/**",
"tensorrt_llm/_common.py",
"tensorrt_llm/_dlpack_utils.py",
"tensorrt_llm/_ipc_utils.py",
"tensorrt_llm/_mnnvl_utils.py",
"tensorrt_llm/_torch/models/modeling_pixtral.py",
"tensorrt_llm/disaggregated_params.py",
"tensorrt_llm/engine.py",
"tensorrt_llm/graph_rewriting.py",
"tensorrt_llm/logger.py",
"tensorrt_llm/lora_manager.py",
"tensorrt_llm/module.py",
"tensorrt_llm/moe_config.py",
"tensorrt_llm/profiler.py",
"tensorrt_llm/prompt_adapter_manager.py",
"tensorrt_llm/python_plugin.py",
"tensorrt_llm/sampling_params.py",
"tensorrt_llm/top_model_mixin.py",
"tests/unittest/_torch/modeling/test_modeling_mistral.py",
"tests/unittest/_torch/modeling/test_modeling_pixtral.py",
"tests/unittest/_torch/models/checkpoints/hf/test_weight_loader.py",
]
[tool.codespell]
skip = ".git,3rdparty,tests/integration/test_input_files**,**.jsonl,**.json"
exclude-file = "examples/models/core/whisper/tokenizer.py"
ignore-words-list = "rouge,inout,atleast,strat,nd,subtile,thrid,improbe,NotIn,te,iteract,anythin,tru,Tracin,vEw,dOut"
[tool.autoflake]
in-place = true
remove_all_unused_imports = true
remove_unused_variables = true
# This should match the `include` in `[tool.ruff]`. See the comments in that section for why this
# is necessary.
exclude = [
"**/auto_deploy/**",
"tensorrt_llm/_common.py",
"tensorrt_llm/_dlpack_utils.py",
"tensorrt_llm/_ipc_utils.py",
"tensorrt_llm/_mnnvl_utils.py",
"tensorrt_llm/_torch/models/modeling_pixtral.py",
"tensorrt_llm/disaggregated_params.py",
"tensorrt_llm/engine.py",
"tensorrt_llm/graph_rewriting.py",
"tensorrt_llm/logger.py",
"tensorrt_llm/lora_manager.py",
"tensorrt_llm/module.py",
"tensorrt_llm/moe_config.py",
"tensorrt_llm/profiler.py",
"tensorrt_llm/prompt_adapter_manager.py",
"tensorrt_llm/python_plugin.py",
"tensorrt_llm/sampling_params.py",
"tensorrt_llm/top_model_mixin.py",
"tests/unittest/_torch/modeling/test_modeling_mistral.py",
"tests/unittest/_torch/modeling/test_modeling_pixtral.py",
"tests/unittest/_torch/models/checkpoints/hf/test_weight_loader.py",
]
####################################################################################################
######################### AUTO DEPLOY LINTING AND TESTING CONFIGURATION ##########################
####################################################################################################
[tool.ruff]
line-length = 100 # Line length limit for code
fix = true
include = [
# all pyproject.toml files
"**/pyproject.toml",
# standard include of ruff restricted to auto_deploy folders
"**/auto_deploy/**/*.py",
"**/auto_deploy/**/*.pyi",
"**/auto_deploy/**/*.ipynb",
# Progressively enable ruff on all the repo to keep individual changes reasonably-sized, and
# keep merge conflicts manageable.
# Since keeping both `yapf` and `ruff` makes no sense (given that their formatting philosophies
# are quite different), we should move towards removing one in favor of the other. ruff's
# formatting mirrors black's, and both are much more widely adopted than yapf. ruff is also
# orders of magnitude faster, so we should move to deprecate `yapf`.
# In the transition period, we should keep the `ignore_patterns` in `[tool.yapfignore]` in sync
# with the below, so that both pre-commit hooks can complete successfully.
"tensorrt_llm/_common.py",
"tensorrt_llm/_dlpack_utils.py",
"tensorrt_llm/_ipc_utils.py",
"tensorrt_llm/_mnnvl_utils.py",
"tensorrt_llm/_torch/models/modeling_pixtral.py",
"tensorrt_llm/disaggregated_params.py",
"tensorrt_llm/engine.py",
"tensorrt_llm/graph_rewriting.py",
"tensorrt_llm/logger.py",
"tensorrt_llm/lora_manager.py",
"tensorrt_llm/module.py",
"tensorrt_llm/moe_config.py",
"tensorrt_llm/profiler.py",
"tensorrt_llm/prompt_adapter_manager.py",
"tensorrt_llm/python_plugin.py",
"tensorrt_llm/sampling_params.py",
"tensorrt_llm/top_model_mixin.py",
"tests/unittest/_torch/modeling/test_modeling_mistral.py",
"tests/unittest/_torch/modeling/test_modeling_pixtral.py",
"tests/unittest/_torch/models/checkpoints/hf/test_weight_loader.py",
]
exclude = [
"**3rdparty/**",
]
[tool.ruff.format]
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
docstring-code-format = true
# Set the line length limit used when formatting code snippets in docstrings.
docstring-code-line-length = "dynamic"
[tool.ruff.lint]
# See available rules at https://docs.astral.sh/ruff/rules/
# Flake8 is equivalent to pycodestyle + pyflakes + mccabe.
select = [
"D", # pydocstyle --> enforcing correct docstrings for existing docstrings
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
# "N", # pep8 naming # no naming convention enforced for now the reduce the burden
"PLE", # pylint errors
"W", # pycodestyle warnings
]
extend-ignore = [
# we don't enforce writing docstrings for public code to reduce the burden
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D417",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
"tests/_torch/auto_deploy/*" = ["D", "E402"]
"*/_[a-zA-Z]*" = ["D"] # Private packages (_abc/*.py) or modules (_xyz.py)
[tool.ruff.lint.pycodestyle]
max-line-length = 120 # Line length limit for comments and docstrings
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
known-first-party = ["tensorrt_llm"]
split-on-trailing-comma = false
[tool.ruff.lint.pylint]
max-args = 10
[tool.mypy]
files = ["**/auto_deploy/**"]
install_types = true
non_interactive = true
show_error_codes = true
disable_error_code = [
"import",
"assignment",
"operator",
"has-type",
"var-annotated",
"operator",
"call-arg",
]
explicit_package_bases = true
namespace_packages = true
# strict checks
strict = true
disallow_subclassing_any = false
disallow_untyped_decorators = false
disallow_any_generics = false
disallow_untyped_calls = false
disallow_incomplete_defs = false
disallow_untyped_defs = false
warn_return_any = false
exclude = []
[[tool.mypy.overrides]]
module = ["tests.*"]
ignore_errors = true