-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathpyproject.toml
More file actions
238 lines (203 loc) · 7.54 KB
/
pyproject.toml
File metadata and controls
238 lines (203 loc) · 7.54 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
[build-system]
requires = [
"setuptools>=82",
"setuptools_scm>=8"
]
build-backend = "setuptools.build_meta"
[project]
name = "spyre-inference"
description = "Next iteration of sendnn-inference on the torch-spyre stack"
readme = "README.md"
license = {text = "Apache-2.0"}
dependencies = [
"torch-spyre",
"vllm",
# Listing as direct deps to ensure they're picked up from the correct index.
# Versions intentionally left out because these are dependencies of dependencies.
"torch",
"torchvision",
]
requires-python = ">=3.11"
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/torch-spyre/spyre-inference"
Documentation = "https://torch-spyre.github.io/spyre-inference/"
Repository = "https://github.com/torch-spyre/spyre-inference"
Issues = "https://github.com/torch-spyre/spyre-inference/issues"
[project.entry-points."vllm.platform_plugins"]
spyre_inference = "spyre_inference:register"
[project.entry-points."vllm.general_plugins"]
spyre_inference_ops = "spyre_inference:register_ops"
[tool.setuptools.packages.find]
where = ["."] # list of folders that contain the packages (["."] by default)
include = ["spyre_inference*"] # package names should match these glob patterns (["*"] by default)
exclude = ["spyre_inference.testing*"] # exclude testing module (now a separate package)
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
[tool.setuptools_scm]
# Version files are optional, this just marginally speeds up version inspection
# at runtime
version_file = "spyre_inference/_version.py"
# Version strings are formatted as `{version}+{local}`, e.g. "0.1.dev1+gb1a7032"
# Local versioning is incompatible with pypi, so we disable it by default.
local_scheme = "no-local-version"
[tool.uv]
default-groups = ["dev"]
override-dependencies = [
# No triton support yet, don't allow any dependencies to pull it in
"triton; sys_platform == 'never'",
"arctic-inference; sys_platform == 'never'",
"perf-analyzer; sys_platform == 'never'",
# Skip packages on s390x and ppc64le that are expected to be pre-installed
"vllm ; platform_machine not in 's390x, ppc64le'",
"ray; platform_machine not in 's390x, ppc64le'",
# uv doesn't resolve numba->llvmlite constraint correctly...
# if numba is updated, this version will likely need to be too
"llvmlite==0.44.0; platform_machine not in 's390x, ppc64le'",
"pyarrow; platform_machine not in 's390x, ppc64le'",
# This torch version must match the one below in `build-constraint-dependencies`
"torch==2.10.0 ; platform_machine not in 's390x, ppc64le'",
# torch-spyre declares a dependency on numpy>2.3, conflicting with numba needed by vLLM
# The range here should match the numba dependency
"numpy>=1.24,<2.3",
# opencv-python-headless==4.13.0.90 has a packaging bug that incorrectly depends on libxcb.so.1,
# causing import failure on headless Linux systems.
"opencv-python-headless==4.12.0.88",
# setuptools is specified as a runtime dep by vllm, make sure it's patched for CVEs
"setuptools>=82",
# requests is used by many dependencies, make sure it's patched for CVEs
"requests>=2.32.4",
]
# This adds constraints to all dependent build environments, which will ensure everything is built
# with the same version of torch. This CANNOT conflict with a package's existing build dependencies
build-constraint-dependencies = ["torch==2.10.0"]
# This ensures that we build the cpu backend for vLLM
extra-build-variables = { vllm = { VLLM_TARGET_DEVICE = "cpu" } }
# vLLM and torch-spyre must be pulled from github to be built from source
# NB: torch-spyre can only be compiled where `sendnn` is available
[tool.uv.sources]
vllm = { git = "https://github.com/vllm-project/vllm", rev = "v0.19.1" }
torch-spyre = { git = "https://github.com/torch-spyre/torch-spyre", rev = "bdd54af5549532e4ff7a21c9787b1397aeb85c75" }
torch = [
{ index = "pytorch-cpu" },
]
torchvision = [
{ index = "pytorch-cpu" },
]
# Testing plugin package
spyre-testing-plugin = { workspace = true }
[tool.uv.workspace]
members = ["tests/plugin"]
# vllm specifies "common" build dependencies in pyproject.toml, while specific requirements for
# cpu builds are specified here:
# See https://github.com/vllm-project/vllm/blob/v0.15.1/requirements/cpu-build.txt
# In the future, we may need to use this section to specify extra dependencies required to build
# vllm from source for the cpu backend.
# NB: This section CANNOT be used to override dependencies to a conflicting version. For example,
# you cannot add torch==2.9.1 if vllm's build dependencies already specify torch>=2.10.0
# [tool.uv.extra-build-dependencies]
# vllm = [
# "ninja",
# ]
# The pytorch-cpu index here ensures we always pull the cpu version of torch everywhere
# The `explicit=true` setting means this index will only be used for packages that we explicitly set
# it for in `tool.uv.sources`. This is important to avoid requiring the use of
# `--index-strategy unsafe-best-match`
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.ty.rules]
possibly-missing-attribute = "ignore"
# TODO: re-enable once vllm/torch-spyre imports resolve in CI.
unresolved-import = "ignore"
# TODO: re-enable after fixing subclass attribute lookups in custom_ops/linear.py.
unresolved-attribute = "ignore"
[tool.ty.src]
exclude = ["spyre_inference/__init__.py"]
[tool.ruff]
# Use widescreen monitors 😎😎😎
line-length = 100
[tool.ruff.lint.per-file-ignores]
"spyre_inference/version.py" = ["F401"]
"spyre_inference/_version.py" = ["ALL"]
"spyre_inference/custom_ops/__init__.py" = ["F401"]
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
# "I",
"G",
]
ignore = [
# star imports
"F405", "F403",
# lambda expression assignment
"E731",
# Loop control variable not used within loop body
"B007",
# f-string format
"UP032",
# % formatters
"UP031",
# ternary operators
"SIM108",
# TODO: Fix all of these in code instead
# Type unions
"UP007",
# Callable
"UP035",
# Zip
"B905",
]
[tool.codespell]
ignore-words-list = "dout, te, indicies, subtile, ElementE"
skip = "*.svg,./tests/hf_cache.json"
#skip = "./tests/models/fixtures,./tests/prompts,./benchmarks/sonnet.txt,./tests/lora/data,./build"
[tool.isort]
use_parentheses = true
skip_gitignore = true
[tool.pytest.ini_options]
pythonpath = ["."]
asyncio_default_fixture_loop_scope = "function"
filterwarnings = [
"ignore::_pytest.warning_types.PytestUnknownMarkWarning"
]
# --8<-- [start:test-markers-definition]
markers = [
"spyre: Tests that require a Spyre device",
"upstream: Tests coming from upstream vLLM",
]
# --8<-- [end:test-markers-definition]
[tool.markdownlint]
#MD013.line_length = 100
MD013 = false # line-length
MD033 = false # inline-html
MD038 = false # no-space-in-code
MD041 = false # first-line-h1
MD046 = false # code-block-style
MD024.allow_different_nesting = true # no-duplicate-headers
MD007.indent = 4 # ul-indent
MD037 = false # no-space-in-emphasis (allow MkDocs Admonitions)
[tool.pymarkdown]
plugins.md013.enabled = false # line-length
plugins.md033.enabled = false # inline-html
plugins.md041.enabled = false # first-line-h1
plugins.md046.enabled = false # code-block-style
plugins.md024.allow_different_nesting = true # no-duplicate-headers
plugins.md007.enabled = true
plugins.md007.indent = 4
[dependency-groups]
dev = [
"pytest",
"pyyaml",
"spyre-testing-plugin",
]