pyproject.toml 8.54 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
# SPDX-License-Identifier: Apache-2.0

Neelay Shah's avatar
Neelay Shah committed
4
[project]
5
name = "ai-dynamo"
6
version = "0.7.0"
Neelay Shah's avatar
Neelay Shah committed
7
8
9
description = "Distributed Inference Framework"
readme = "README.md"
authors = [
Neelay Shah's avatar
Neelay Shah committed
10
    { name = "NVIDIA Inc.", email = "sw-dl-dynamo@nvidia.com" },
Neelay Shah's avatar
Neelay Shah committed
11
]
12
13
license = { text = "Apache-2.0" }
license-files = ["LICENSE"]
Neelay Shah's avatar
Neelay Shah committed
14
15
requires-python = ">=3.10"
dependencies = [
16
    "ai-dynamo-runtime==0.7.0",
17
18
19
20
    "pytest>=8.3.4",
    "types-psutil>=7.0.0.20250218",
    "kubernetes>=32.0.1,<33.0.0",
    "fastapi>=0.115.0",
21
    "distro",
22
23
    # filelock: required by planner
    "filelock",
24
    "typer",
25
    "click<8.2.0",
26
    "setuptools",
27
    "prometheus_client>=0.23.1,<1.0",
Neelay Shah's avatar
Neelay Shah committed
28
]
29

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
45

46
47
48
[project.urls]
Repository = "https://github.com/ai-dynamo/dynamo.git"

49
[project.optional-dependencies]
50
51
trtllm =[
    "uvloop",
52
    "tensorrt-llm==1.1.0rc5",
53
54
]

55
56
vllm = [
    "uvloop",
57
    "nixl[cu12]<=0.7.1",
58
    "vllm[flashinfer]==0.10.2",
59
60
]

61
62
sglang = [
    "uvloop",
63
    "nixl[cu12]<=0.7.1",
64
    "sglang==0.5.4.post3",
65
66
]

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
[dependency-groups]
docs = [
    # Core Sphinx
    "sphinx>=8.1",
    "nvidia-sphinx-theme>=0.0.8",
    # Sphinx extensions
    "ablog>=0.11",
    "sphinx-copybutton>=0.5",
    "sphinx-design>=0.6",
    "sphinx-prompt>=1.9",
    "sphinx-sitemap>=2.6",
    "sphinx-tabs>=3.4",
    "sphinx-book-theme>=1.1",
    "sphinxcontrib-mermaid>=1.0",
    "sphinxcontrib-bibtex>=2.6",
82
    "sphinx-reredirects>=1.0.0",
83
84
85
86
87
88
    # Markdown and notebook support
    "myst-parser>=4.0",
    "myst-nb>=1.2",
    "nbsphinx>=0.9",
]

89
[build-system]
90
91
92
requires = ["hatchling"]
build-backend = "hatchling.build"

93
94
95
[tool.hatch.build.hooks.custom]
path = "hatch_build.py"

96
[tool.hatch.build.targets.wheel]
97
packages = [
98
    "components/src/dynamo",
99
]
100

101
102
103
[tool.hatch.metadata]
allow-direct-references = true

104
105
106
107
108
[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

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

112
113
# ignore allowed words used in code
ignore-words-list = "afterall,ser,ende"
114
115
# use the 'clear' dictionary for unambiguous spelling mistakes
builtin = "clear"
116
117
# use custom dictionary in addition to the built-in one
dictionary = "./codespell.txt"
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# 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
132
known_first_party = ["dynamo"]
133
134
135

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

# NOTE
139
# We ignore model.py explicitly here to avoid mypy errors with duplicate modules
Neelay Shah's avatar
Neelay Shah committed
140
# pytest overrides the default mypy exclude configuration and so we exclude here as well
141
142
143
144
145
146
147
addopts = [
    "-ra",
    "--showlocals",
    "--strict-markers",
    "--strict-config",
    "--mypy",
    "--ignore-glob=*model.py",
Ryan Olson's avatar
Ryan Olson committed
148
    "--ignore-glob=*vllm_integration*",
149
    "--ignore-glob=*trtllm_integration*",
Richard Huo's avatar
Richard Huo committed
150
    "--ignore-glob=*kvbm/python/kvbm*",
151
    "--ignore-glob=*_inc.py",
152
    "--ignore-glob=*/llm/tensorrtllm*",
153
    "--ignore-glob=docs/*",
154
    "--ignore-glob=components/src/dynamo/sglang/request_handlers/*",
155
    "--ignore-glob=components/src/dynamo/sglang/multimodal_utils/*",
156
157
    "--ignore-glob=components/src/dynamo/vllm/multimodal_utils/*",
    "--ignore-glob=components/src/dynamo/vllm/multimodal_handlers/*",
158
    "--ignore-glob=examples/backends/sglang/slurm_jobs/*",
159
160
    # FIXME: Get relative/generic blob paths to work here
]
161
162
163
xfail_strict = true
log_cli_level = "INFO"
filterwarnings = [
164
165
166
    "error",
    "ignore:.*cuda*:DeprecationWarning", # Need this to avoid deprecation warnings from CUDA in tensorrt_llm.
    "ignore:.*pkg_resources.*:DeprecationWarning",
167
168
    "ignore:.*pkg_resources.*:UserWarning",
    "ignore:.*multipart.*:PendingDeprecationWarning",
169
    "ignore:.*PyType_Spec.*custom tp_new.*:DeprecationWarning", # Ignore protobuf deprecation warning
170
171
172
    "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
173
    "ignore:The pynvml package is deprecated.*:FutureWarning", # Ignore pynvml deprecation warning, temporary until upstream library updates to nvidia-ml-py
174
175
176
177
    # Pydantic V2 deprecation warnings from TRTLLM dependencies (raised at import time during collection)
    "ignore:Support for class-based `config`.*:pydantic.warnings.PydanticDeprecatedSince20",
    "ignore:Using extra keyword arguments on `Field`.*:pydantic.warnings.PydanticDeprecatedSince20",
    "ignore:The `schema` method is deprecated.*:pydantic.warnings.PydanticDeprecatedSince20",
178
179
    # pytest-benchmark automatically disables when xdist is active, ignore the warning
    "ignore:.*Benchmarks are automatically disabled.*:pytest_benchmark.logger.PytestBenchmarkWarning",
180
]
181
182


183
184
# NOTE: Can also manually mark tests with @pytest.mark.asyncio
asyncio_mode = "auto"
Neelay Shah's avatar
Neelay Shah committed
185
markers = [
186
    "pre_merge: marks tests to run before merging",
187
    "parallel: marks tests that can run in parallel with pytest-xdist",
188
189
    "nightly: marks tests to run nightly",
    "weekly: marks tests to run weekly",
Neelay Shah's avatar
Neelay Shah committed
190
191
    "gpu_1: marks tests to run on GPU",
    "gpu_2: marks tests to run on 2GPUs",
192
193
    "gpu_4: marks tests to run on 4GPUs",
    "gpu_8: marks tests to run on 8GPUs",
Neelay Shah's avatar
Neelay Shah committed
194
195
196
197
198
    "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",
199
    "trtllm: marks tests as requiring trtllm",
200
    "trtllm_marker: marks tests as requiring trtllm",
Neelay Shah's avatar
Neelay Shah committed
201
    "sglang: marks tests as requiring sglang",
202
    "multimodal: marks tests as multimodal (image/video) tests",
Ryan Olson's avatar
Ryan Olson committed
203
    "slow: marks tests as known to be slow",
204
    "h100: marks tests to run on H100",
Alec's avatar
Alec committed
205
    "kvbm: marks tests for KV behavior and model determinism",
jthomson04's avatar
jthomson04 committed
206
    "kvbm_v2: marks tests using KVBM V2",
207
    "model: model id used by a test or parameter",
208
209
210
    "custom_build: marks tests that require custom builds or special setup (e.g., MoE models)",
    "k8s: marks tests as requiring Kubernetes",
    "fault_tolerance: marks tests as fault tolerance tests"
Neelay Shah's avatar
Neelay Shah committed
211
]
212
213
214
215
216
217
218

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

Blazej's avatar
Blazej committed
219
220
[tool.ruff.lint.extend-per-file-ignores]
"icp/tests/**/test_*.py" = ["F811", "F401"]
221
"*_inc.py" = ["F821"]
Blazej's avatar
Blazej committed
222

223
[tool.mypy]
Neelay Shah's avatar
Neelay Shah committed
224

225
226
# --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
227
228
# disable_error_code = []

229
# --explicit-package-bases: WAR errors about duplicate module names used
230
231
232
#   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
233

234
235
236
237
# --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
238
239
ignore_missing_imports = true

240
241
242
243
check_untyped_defs = true

[[tool.mypy.overrides]]
# Skip mypy analysis on internal dependencies of vllm
244
module = ["vllm.*"]
245
follow_imports = "skip"
246
ignore_missing_imports = true
247

248
249
[tool.sphinx]

250
# extra-content-head
251
252
253
254
255
256
257
258
259
260
261
262
263
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>
   ''',
]