"deploy/docker-compose.yml" did not exist on "95dd9426d8117e0d0ea07492744ab8261a399725"
pyproject.toml 12.7 KB
Newer Older
1
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 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 = "1.0.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==1.0.0",
17
    "transformers>=4.56.0",
18
19
    "pytest>=8.3.4",
    "types-psutil>=7.0.0.20250218",
Tzu-Ling Kan's avatar
Tzu-Ling Kan committed
20
    "types-requests>=2.32.4.20260107",
21
22
    "kubernetes>=32.0.1,<33.0.0",
    "fastapi>=0.115.0",
23
    "distro",
24
25
    # filelock: required by planner
    "filelock",
26
    "typer",
27
    "click<8.2.0",
28
    "setuptools",
29
    "prometheus_client>=0.23.1,<1.0",
Neelay Shah's avatar
Neelay Shah committed
30
]
31

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

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

51
[project.optional-dependencies]
52
53
trtllm =[
    "uvloop",
54
    "msgpack==1.1.2",
55
    "tensorrt-llm==1.3.0rc5",
56
57
]

58
59
vllm = [
    "uvloop",
60
    "nixl[cu12]<=0.10.1",
61
62
63
64
65
    "vllm[flashinfer,runai]==0.16.0",
    # vllm-omni 0.16.0rc1 is not on PyPI; installed from source in container builds
    # (see container/deps/vllm/install_vllm.sh). pip install ai-dynamo[vllm] will
    # not include vllm-omni — install it separately from source if needed.
    # "vllm-omni==0.16.0rc1",
66
    "blake3>=1.0.0,<2.0.0",
67
68
]

69
70
sglang = [
    "uvloop",
71
    "sglang[diffusion]==0.5.9",
72
    "nixl[cu12]<=0.10.1",
73
    "cupy-cuda12x>=13.0.0",
74
75
]

76
77
78
79
80
[project.entry-points.pytest11]
vllm_tests = "dynamo.vllm.tests.conftest"
trtllm_tests = "dynamo.trtllm.tests.conftest"
sglang_tests = "dynamo.sglang.tests.conftest"

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[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",
96
    "sphinx-reredirects>=1.0.0",
97
98
99
100
101
102
    # Markdown and notebook support
    "myst-parser>=4.0",
    "myst-nb>=1.2",
    "nbsphinx>=0.9",
]

103
[build-system]
104
105
106
requires = ["hatchling"]
build-backend = "hatchling.build"

107
108
109
[tool.hatch.build.hooks.custom]
path = "hatch_build.py"

110
[tool.hatch.build.targets.wheel]
111
packages = [
112
    "components/src/dynamo",
113
]
114

115
116
117
[tool.hatch.metadata]
allow-direct-references = true

118
119
120
121
122
[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

123
124
# Ignore data files and auto-generated files
skip = "./.git,./.github,./lib/llm/tests/data,*.lock,*.sum"
125

126
127
# ignore allowed words used in code
ignore-words-list = "afterall,ser,ende"
128
129
# use the 'clear' dictionary for unambiguous spelling mistakes
builtin = "clear"
130
131
# use custom dictionary in addition to the built-in one
dictionary = "./codespell.txt"
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# 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"]
146
known_first_party = ["dynamo", "deploy"]
147
148
149
150
151
152
# isort may confuse what is 1st or 3rd library. e.g.
# when dynamo/vllm/omni/xx.py import vllm, local isort may treat this `vllm` as first
# party heuristically. This causes local sort differs from GitHub sort and pre-commit
# failure. To mitigate 1) one can install 3rd party lib so that isort is aware of it,
# 2) hardcode 3rd party lib here, 3) add "# isort: skip_file" to problematic files
# as the last resort.
153
known_third_party = ["vllm", "tensorrt_llm", "sglang", "aiconfigurator"]
154
155
156

[tool.pytest.ini_options]
minversion = "8.0"
157
tmp_path_retention_policy = "failed"
Neelay Shah's avatar
Neelay Shah committed
158
159

# NOTE
160
# We ignore model.py explicitly here to avoid mypy errors with duplicate modules
Neelay Shah's avatar
Neelay Shah committed
161
# pytest overrides the default mypy exclude configuration and so we exclude here as well
162
163
164
165
166
167
168
addopts = [
    "-ra",
    "--showlocals",
    "--strict-markers",
    "--strict-config",
    "--mypy",
    "--ignore-glob=*model.py",
Ryan Olson's avatar
Ryan Olson committed
169
    "--ignore-glob=*vllm_integration*",
170
    "--ignore-glob=*trtllm_integration*",
Richard Huo's avatar
Richard Huo committed
171
    "--ignore-glob=*kvbm/python/kvbm*",
172
    "--ignore-glob=*_inc.py",
173
    "--ignore-glob=*/llm/tensorrtllm*",
174
    "--ignore-glob=docs/*",
175
    "--ignore-glob=components/src/dynamo/sglang/request_handlers/*",
176
    "--ignore-glob=components/src/dynamo/sglang/multimodal_utils/*",
177
    "--ignore-glob=components/src/dynamo/vllm/multimodal_utils/*",
178
    "--ignore-glob=examples/backends/sglang/slurm_jobs/*",
179
180
    # FIXME: Get relative/generic blob paths to work here
]
181
182
183
xfail_strict = true
log_cli_level = "INFO"
filterwarnings = [
184
185
186
    "error",
    "ignore:.*cuda*:DeprecationWarning", # Need this to avoid deprecation warnings from CUDA in tensorrt_llm.
    "ignore:.*pkg_resources.*:DeprecationWarning",
187
188
    "ignore:.*pkg_resources.*:UserWarning",
    "ignore:.*multipart.*:PendingDeprecationWarning",
189
    "ignore:.*PyType_Spec.*custom tp_new.*:DeprecationWarning", # Ignore protobuf deprecation warning
190
191
192
    "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
193
    "ignore:The pynvml package is deprecated.*:FutureWarning", # Ignore pynvml deprecation warning, temporary until upstream library updates to nvidia-ml-py
194
    "ignore:The behavior of DataFrame concatenation with empty or all-NA entries is deprecated.*:FutureWarning", # pandas 2.x concat deprecation in AIC SDK TODO: fix in AIC
195
    "ignore:Automatic KV events configuration is deprecated.*:FutureWarning", # Ignore Dynamo's own KV events deprecation warning in tests
196
197
198
199
    # 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",
200
201
    # Pydantic warning about field shadowing in tensorrt_llm.serve.openai_protocol.ResponseFormat
    'ignore:Field name "schema" in "ResponseFormat" shadows an attribute in parent:UserWarning',
202
203
    # pytest-benchmark automatically disables when xdist is active, ignore the warning
    "ignore:.*Benchmarks are automatically disabled.*:pytest_benchmark.logger.PytestBenchmarkWarning",
204

205
206
207
208
209
210
    ################################################################################################
    # vLLM
    ################################################################################################
    # vLLM tokenizer deprecation warning (AnyTokenizer moved to vllm.tokenizers.TokenizerLike)
    "ignore:.*vllm\\.transformers_utils\\.tokenizer\\.AnyTokenizer.*has been moved.*:DeprecationWarning",

211
212
213
    ################################################################################################
    # TRT-LLM
    ################################################################################################
214
215
216
217
218
    # torchao sometimes emits SyntaxWarning from docstrings (e.g. invalid escape sequences) at import
    # time; our global `error` policy would otherwise fail test collection. Do not rely on module=
    # matching here because these can be raised during compilation where the module field may not
    # match as expected.
    "ignore:.*invalid escape sequence.*:SyntaxWarning",
219
220
221
222
    # torchao deprecation warnings for import path changes (see https://github.com/pytorch/ao/issues/2752)
    "ignore:Importing.*torchao\\.dtypes.*:DeprecationWarning",
    # nvidia-modelopt warning about transformers version incompatibility
    "ignore:transformers version .* is incompatible with nvidia-modelopt.*:UserWarning",
223
]
224
225


226
227
# NOTE: Can also manually mark tests with @pytest.mark.asyncio
asyncio_mode = "auto"
228
229
230
# IMPORTANT: tests/conftest.py also registers a subset of these markers for
# environments where pyproject.toml is not available (e.g. some CI containers).
# Keep the marker definitions here and in tests/conftest.py synchronized.
Neelay Shah's avatar
Neelay Shah committed
231
markers = [
232
    "pre_merge: marks tests to run before merging",
233
    "post_merge: marks tests to run after merge",
234
    "parallel: marks tests that can run in parallel with pytest-xdist",
235
236
    "nightly: marks tests to run nightly",
    "weekly: marks tests to run weekly",
237
    "release: marks tests to run on release pipelines",
238
    "gpu_0: marks tests that don't require GPU",
Neelay Shah's avatar
Neelay Shah committed
239
240
    "gpu_1: marks tests to run on GPU",
    "gpu_2: marks tests to run on 2GPUs",
241
242
    "gpu_4: marks tests to run on 4GPUs",
    "gpu_8: marks tests to run on 8GPUs",
Neelay Shah's avatar
Neelay Shah committed
243
244
245
246
    "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",
247
    "performance: marks tests as performance tests",
248
    "benchmark: marks tests as benchmark tests",
Neelay Shah's avatar
Neelay Shah committed
249
    "vllm: marks tests as requiring vllm",
250
    "trtllm: marks tests as requiring trtllm",
Neelay Shah's avatar
Neelay Shah committed
251
    "sglang: marks tests as requiring sglang",
252
    "multimodal: marks tests as multimodal (image/video) tests",
Ryan Olson's avatar
Ryan Olson committed
253
    "slow: marks tests as known to be slow",
254
    "h100: marks tests to run on H100",
255
    "aiconfigurator: marks e2e tests that cover aiconfigurator functionality",
256
257
    "router: marks tests for router component",
    "planner: marks tests for planner component",
Alec's avatar
Alec committed
258
    "kvbm: marks tests for KV behavior and model determinism",
259
    "kvbm_concurrency: marks concurrency stress tests for KVBM (runs separately)",
260
    "model: model id used by a test or parameter",
261
262
    "custom_build: marks tests that require custom builds or special setup (e.g., MoE models)",
    "k8s: marks tests as requiring Kubernetes",
263
    "fault_tolerance: marks tests as fault tolerance tests",
264
    "deploy: marks tests as deployment tests",
265
266
267
268
269
270
271
    # Built-in markers
    "skip: skip this test",
    "skipif: skip if condition is true",
    "xfail: expected failure",
    "usefixtures: use fixtures",
    "parametrize: parameterized test",
    "filterwarnings: filter warnings",
272
273
274
    "asyncio: asyncio test marker",
    # Third-party plugin markers
    "timeout: test timeout in seconds (pytest-timeout plugin)",
Neelay Shah's avatar
Neelay Shah committed
275
]
276
277
278
279
280
281
282

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

Blazej's avatar
Blazej committed
283
284
[tool.ruff.lint.extend-per-file-ignores]
"icp/tests/**/test_*.py" = ["F811", "F401"]
285
"*_inc.py" = ["F821"]
Blazej's avatar
Blazej committed
286

287
288
289
290
291
292
293
294
295
# This is IDE (e.g. Cursor's default Python language server)
# Configure it so that developers can use "go-to-definition", "hover types" and other
# features.
[tool.basedpyright]
extraPaths = ["components/src", "lib/bindings/python/src"]
# This is for external dependencies.
venvPath = "."
venv = ".venv"

296
[tool.mypy]
Neelay Shah's avatar
Neelay Shah committed
297

298
299
# --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
300
301
# disable_error_code = []

302
# --explicit-package-bases: WAR errors about duplicate module names used
303
304
305
#   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
306

307
308
309
310
# --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
311
312
ignore_missing_imports = true

313
314
315
316
check_untyped_defs = true

[[tool.mypy.overrides]]
# Skip mypy analysis on internal dependencies of vllm
317
module = ["vllm.*"]
318
follow_imports = "skip"
319
ignore_missing_imports = true
320

321
322
[tool.sphinx]

323
# extra-content-head
324
325
326
327
328
329
330
331
332
333
334
335
336
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>
   ''',
]