pyproject.toml 6.86 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.5.1"
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.5.1",
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",
Neelay Shah's avatar
Neelay Shah committed
27
]
28

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

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

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

54
55
vllm = [
    "uvloop",
56
    "nixl<=0.4.1",
57
    "vllm[flashinfer]==0.10.2",
58
59
]

60
61
sglang = [
    "uvloop",
62
    "nixl<=0.4.1",
63
    "sglang[all]==0.5.3rc0",
64
65
]

66
67
68
69
llama_cpp = [
    "uvloop",
    "llama-cpp-python",
]
70
71

[build-system]
72
73
74
requires = ["hatchling"]
build-backend = "hatchling.build"

75
76
77
[tool.hatch.build.hooks.custom]
path = "hatch_build.py"

78
[tool.hatch.build.targets.wheel]
79
packages = [
80
    "components/src/dynamo",
81
]
82

83
84
85
[tool.hatch.metadata]
allow-direct-references = true

86
87
88
89
90
[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

91
92
# Ignore data files and auto-generated files
skip = "./.git,./.github,./lib/llm/tests/data,*.lock,*.sum"
93

94
95
# ignore allowed words used in code
ignore-words-list = "afterall,ser,ende"
96
97
# use the 'clear' dictionary for unambiguous spelling mistakes
builtin = "clear"
98
99
# use custom dictionary in addition to the built-in one
dictionary = "./codespell.txt"
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# 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
114
known_first_party = ["dynamo"]
115
116
117

[tool.pytest.ini_options]
minversion = "8.0"
118
tmp_path_retention_policy = "failed"
Neelay Shah's avatar
Neelay Shah committed
119
120
121
122

# 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
123
124
125
126
127
128
129
addopts = [
    "-ra",
    "--showlocals",
    "--strict-markers",
    "--strict-config",
    "--mypy",
    "--ignore-glob=*model.py",
Ryan Olson's avatar
Ryan Olson committed
130
    "--ignore-glob=*vllm_integration*",
131
    "--ignore-glob=*trtllm_integration*",
132
    "--ignore-glob=*_inc.py",
133
    "--ignore-glob=*/llm/tensorrtllm*",
134
    "--ignore-glob=docs/*",
135
    "--ignore-glob=components/src/dynamo/sglang/request_handlers/*",
136
    "--ignore-glob=components/backends/sglang/slurm_jobs/*",
137
138
    # FIXME: Get relative/generic blob paths to work here
]
139
140
141
xfail_strict = true
log_cli_level = "INFO"
filterwarnings = [
142
143
144
    "error",
    "ignore:.*cuda*:DeprecationWarning", # Need this to avoid deprecation warnings from CUDA in tensorrt_llm.
    "ignore:.*pkg_resources.*:DeprecationWarning",
145
146
    "ignore:.*pkg_resources.*:UserWarning",
    "ignore:.*multipart.*:PendingDeprecationWarning",
147
    "ignore:.*PyType_Spec.*custom tp_new.*:DeprecationWarning", # Ignore protobuf deprecation warning
148
149
150
    "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
151
    "ignore:The pynvml package is deprecated.*:FutureWarning", # Ignore pynvml deprecation warning, temporary until upstream library updates to nvidia-ml-py
152
]
153
154


155
156
# NOTE: Can also manually mark tests with @pytest.mark.asyncio
asyncio_mode = "auto"
Neelay Shah's avatar
Neelay Shah committed
157
markers = [
158
159
160
    "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
161
162
    "gpu_1: marks tests to run on GPU",
    "gpu_2: marks tests to run on 2GPUs",
163
164
    "gpu_4: marks tests to run on 4GPUs",
    "gpu_8: marks tests to run on 8GPUs",
Neelay Shah's avatar
Neelay Shah committed
165
166
167
168
169
    "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",
170
    "trtllm: marks tests as requiring trtllm",
171
    "trtllm_marker: marks tests as requiring trtllm",
Neelay Shah's avatar
Neelay Shah committed
172
    "sglang: marks tests as requiring sglang",
Ryan Olson's avatar
Ryan Olson committed
173
    "slow: marks tests as known to be slow",
174
    "h100: marks tests to run on H100",
Alec's avatar
Alec committed
175
176
    "kvbm: marks tests for KV behavior and model determinism",
    "model: model id used by a test or parameter"
Neelay Shah's avatar
Neelay Shah committed
177
]
178
179
180
181
182
183
184

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

Blazej's avatar
Blazej committed
185
186
[tool.ruff.lint.extend-per-file-ignores]
"icp/tests/**/test_*.py" = ["F811", "F401"]
187
"*_inc.py" = ["F821"]
Blazej's avatar
Blazej committed
188

189
[tool.mypy]
Neelay Shah's avatar
Neelay Shah committed
190

191
192
# --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
193
194
# disable_error_code = []

195
# --explicit-package-bases: WAR errors about duplicate module names used
196
197
198
#   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
199

200
201
202
203
# --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
204
205
ignore_missing_imports = true

206
207
208
209
check_untyped_defs = true

[[tool.mypy.overrides]]
# Skip mypy analysis on internal dependencies of vllm
210
module = ["vllm.*"]
211
follow_imports = "skip"
212
ignore_missing_imports = true
213

214
215
[tool.sphinx]

216
# extra-content-head
217
218
219
220
221
222
223
224
225
226
227
228
229
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>
   ''',
]