pyproject.toml 7.12 KB
Newer Older
Neelay Shah's avatar
Neelay Shah committed
1
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

Neelay Shah's avatar
Neelay Shah committed
16
[project]
17
name = "ai-dynamo"
18
version = "0.4.0"
Neelay Shah's avatar
Neelay Shah committed
19
20
21
description = "Distributed Inference Framework"
readme = "README.md"
authors = [
Neelay Shah's avatar
Neelay Shah committed
22
    { name = "NVIDIA Inc.", email = "sw-dl-dynamo@nvidia.com" },
Neelay Shah's avatar
Neelay Shah committed
23
]
24
25
license = { text = "Apache-2.0" }
license-files = ["LICENSE"]
Neelay Shah's avatar
Neelay Shah committed
26
27
requires-python = ">=3.10"
dependencies = [
28
    "ai-dynamo-runtime==0.4.0",
29
30
31
32
    "pytest>=8.3.4",
    "types-psutil>=7.0.0.20250218",
    "kubernetes>=32.0.1,<33.0.0",
    "fastapi>=0.115.0",
33
    "distro",
34
35
    # filelock: required by planner
    "filelock",
36
    "typer",
37
    "circus>=0.19.0",
38
    "click<8.2.0",
39
    "setuptools",
Neelay Shah's avatar
Neelay Shah committed
40
]
41

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "Intended Audience :: Information Technology",
    "License :: OSI Approved :: Apache Software License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Topic :: Scientific/Engineering",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
    "Operating System :: POSIX :: Linux",
]
keywords = ["llm", "genai", "inference", "nvidia", "distributed", "dynamo"]
Neelay Shah's avatar
Neelay Shah committed
57

58
59
60
[project.urls]
Repository = "https://github.com/ai-dynamo/dynamo.git"

61
[project.optional-dependencies]
62
63
64
65
66
trtllm =[
    "uvloop",
    "tensorrt-llm==1.0.0rc4"
]

67
68
vllm = [
    "uvloop",
69
    "nixl",
70
    "vllm==0.10.0",
71
72
]

73
74
75
sglang = [
    "uvloop",
    "nixl",
76
    "sglang[all]==0.4.9.post6",
77
78
]

79
80
81
82
llama_cpp = [
    "uvloop",
    "llama-cpp-python",
]
83
84

[build-system]
85
86
87
88
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
89
90
91
92
93
94
95
96
97
packages = [
    "components/frontend/src/dynamo",
    "components/planner/src/dynamo",
    "components/backends/llama_cpp/src/dynamo",
    "components/backends/mocker/src/dynamo",
    "components/backends/trtllm/src/dynamo",
    "components/backends/sglang/src/dynamo",
    "components/backends/vllm/src/dynamo"
]
98

99
100
101
[tool.hatch.metadata]
allow-direct-references = true

102
103
104
105
106
[tool.codespell]
# note: pre-commit passes explicit lists of files here, which this skip file list doesn't override -
# this is only to allow you to run codespell interactively
# this also overrides the grpc_generated folder, since it is generated

107
108
# Ignore data files and auto-generated files
skip = "./.git,./.github,./lib/llm/tests/data,*.lock,*.sum"
109

110
111
# ignore allowed words used in code
ignore-words-list = "afterall,ser,ende"
112
113
# use the 'clear' dictionary for unambiguous spelling mistakes
builtin = "clear"
114
115
# use custom dictionary in addition to the built-in one
dictionary = "./codespell.txt"
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# disable warnings about binary files and wrong encoding
quiet-level = 3

[tool.isort]
profile = "black"
use_parentheses = true
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
ensure_newline_before_comments = true
line_length = 88
balanced_wrapping = true
indent = "    "
skip = ["build"]
Neelay Shah's avatar
Neelay Shah committed
130
known_first_party = ["dynamo"]
131
132
133

[tool.pytest.ini_options]
minversion = "8.0"
134
tmp_path_retention_policy = "failed"
Neelay Shah's avatar
Neelay Shah committed
135
136
137
138

# NOTE
# We ignore model.py explcitly here to avoid mypy errors with duplicate modules
# pytest overrides the default mypy exclude configuration and so we exclude here as well
139
140
141
142
143
144
145
addopts = [
    "-ra",
    "--showlocals",
    "--strict-markers",
    "--strict-config",
    "--mypy",
    "--ignore-glob=*model.py",
146
    "--ignore-glob=*_inc.py",
147
    "--ignore-glob=*/llm/tensorrtllm*",
148
    "--ignore-glob=docs/*",
149
    "--ignore-glob=components/backends/sglang/src/dynamo/sglang/common/*",
150
151
    # FIXME: Get relative/generic blob paths to work here
]
152
153
154
xfail_strict = true
log_cli_level = "INFO"
filterwarnings = [
155
156
157
    "error",
    "ignore:.*cuda*:DeprecationWarning", # Need this to avoid deprecation warnings from CUDA in tensorrt_llm.
    "ignore:.*pkg_resources.*:DeprecationWarning",
158
159
    "ignore:.*pkg_resources.*:UserWarning",
    "ignore:.*multipart.*:PendingDeprecationWarning",
160
    "ignore:.*PyType_Spec.*custom tp_new.*:DeprecationWarning", # Ignore protobuf deprecation warning
161
162
163
    "ignore:.*unclosed.*socket.*:ResourceWarning", # Ignore unclosed socket warnings
    "ignore:.*unclosed event loop.*:ResourceWarning", # Ignore unclosed event loop warnings
    "ignore:.*Exception ignored in.*:pytest.PytestUnraisableExceptionWarning", # Ignore unraisable exception warnings
164
]
165
166


167
168
# NOTE: Can also manually mark tests with @pytest.mark.asyncio
asyncio_mode = "auto"
Neelay Shah's avatar
Neelay Shah committed
169
markers = [
170
171
172
    "pre_merge: marks tests to run before merging",
    "nightly: marks tests to run nightly",
    "weekly: marks tests to run weekly",
Neelay Shah's avatar
Neelay Shah committed
173
174
    "gpu_1: marks tests to run on GPU",
    "gpu_2: marks tests to run on 2GPUs",
175
176
    "gpu_4: marks tests to run on 4GPUs",
    "gpu_8: marks tests to run on 8GPUs",
Neelay Shah's avatar
Neelay Shah committed
177
178
179
180
181
182
183
184
    "e2e: marks tests as end-to-end tests",
    "integration: marks tests as integration tests",
    "unit: marks tests as unit tests",
    "stress: marks tests as stress tests",
    "vllm: marks tests as requiring vllm",
    "tensorrtllm: marks tests as requiring tensorrtllm",
    "sglang: marks tests as requiring sglang",
    "slow: marks tests as known to be slow"
Neelay Shah's avatar
Neelay Shah committed
185
]
186
187
188
189
190
191
192

# Linting/formatting
[tool.ruff]
# Same as Black.
line-length = 88
indent-width = 4

Blazej's avatar
Blazej committed
193
194
[tool.ruff.lint.extend-per-file-ignores]
"icp/tests/**/test_*.py" = ["F811", "F401"]
195
"*_inc.py" = ["F821"]
Blazej's avatar
Blazej committed
196

197
[tool.mypy]
Neelay Shah's avatar
Neelay Shah committed
198

199
200
# --disable-error-code: WAR large set of errors due to mypy not being run
#   previously. We can slowly enable sets of errors to fix over time.
Neelay Shah's avatar
Neelay Shah committed
201
202
# disable_error_code = []

203
# --explicit-package-bases: WAR errors about duplicate module names used
204
205
206
#   throughout the llm examples. For example, the common module in
#   tensorrt_llm and vllm are both named common.
explicit_package_bases = true
Neelay Shah's avatar
Neelay Shah committed
207

208
209
210
211
# --ignore-missing-imports: WAR too many errors when developing outside
#   of container environment with PYTHONPATH set and packages installed.
#   NOTE: Can possibly move mypy from pre-commit to a github action run only in
#   a container with the expected environment and PYTHONPATH setup.
Neelay Shah's avatar
Neelay Shah committed
212
213
ignore_missing_imports = true

214
215
216
217
check_untyped_defs = true

[[tool.mypy.overrides]]
# Skip mypy analysis on internal dependencies of vllm
218
module = ["vllm.*"]
219
follow_imports = "skip"
220
ignore_missing_imports = true
221

222
223
[tool.sphinx]

224
# extra-content-head
225
226
227
228
229
230
231
232
233
234
235
236
237
extra_content_head = [
   '''
   <script src="https://assets.adobedtm.com/5d4962a43b79/c1061d2c5e7b/launch-191c2462b890.min.js" ></script>
   ''',
]

#extra-content-footer
extra_content_footer = [
   '''
   <script type="text/javascript">if (typeof _satellite !== "undefined") {_satellite.pageBottom();}</script>
   ''',
]