Repository navigation
Expand file tree
/
Copy pathpyproject_tpu.toml
More file actions
244 lines (223 loc) · 6.5 KB
/
Copy pathpyproject_tpu.toml
File metadata and controls
244 lines (223 loc) · 6.5 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
239
240
241
242
243
244
[build-system]
requires = ["setuptools>=61.0", "setuptools-scm>=8.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "sglang"
dynamic = ["version"]
description = "SGLang is a fast serving framework for large language models and vision language models."
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
]
dependencies = [
"IPython",
"aiohttp",
"anthropic>=0.20.0",
"anyio>=4.13.0",
"blake3>=1.0.0",
"blobfile==3.0.0",
"av",
# SGLang decodes video with torchcodec or, failing that, decord; this stack
# ships neither, so without it every video request fails to decode.
"decord2==3.4.0",
"build",
"compressed-tensors",
"datasets",
"deepseek-recipe==0.2.0 ; (sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64')) or sys_platform == 'darwin'",
"einops",
"fastapi",
"easydict",
"gguf",
"grpcio>=1.81.1",
"grpcio-health-checking>=1.81.1",
"grpcio-reflection>=1.81.1",
"hf_transfer",
"huggingface_hub",
"interegular",
"llguidance>=0.7.11,<0.8.0",
"modelscope",
"msgspec",
"ninja",
"numpy",
"openai-harmony==0.0.4",
"openai==2.6.1",
"orjson",
"outlines==0.1.11",
"packaging",
"partial_json_parser",
# The Rust image pipeline (dynamo-multimodal) reproduces Pillow 12.x bicubic.
"pillow<13",
"prometheus-client>=0.20.0",
"protobuf>=6.33.5",
"psutil",
"py-spy",
"pybase64",
"pydantic",
"python-multipart",
"pyzmq>=25.1.2",
"requests",
"scipy",
"sentencepiece",
"setproctitle",
"soundfile==0.13.1",
"tiktoken",
"timm==1.0.25",
"torchao==0.9.0",
"tqdm",
"mistral_common>=1.11.0",
"transformers==5.19.0",
"uvicorn",
"uvloop",
"xxhash",
"zstandard",
"xgrammar==0.2.7",
# The pins below form one TPU stack and must be upgraded and validated
# together:
# - torch_tpu and torch must be ABI compatible.
# - torch, torchvision and torchaudio must be ABI compatible.
# - torch_tpu and libtpu must be validated together.
# - jax and jaxlib must be compatible with libtpu.
# - tpu-sync-torch's native extension links torch_tpu's per-torch-version
# glue library, so it must be upgraded and validated with torch_tpu.
"torch_tpu==0.2.1.dev20261028201649",
# PJRT raw-transfer / KV-cache DMA engine backing the raiden disaggregation
# connector (sglang/srt/disaggregation/raiden/) and the raiden HiCache
# transfer backend (sglang/srt/hardware_backend/tpu/raiden_transfer.py).
# Published to PyPI as nightly .dev pre-releases.
# Minimum floor: >= 0.0.1.dev20261110081704 (contains google/tpu-sync
# 4e61045e5 + 47e9f2001 fixing PP->TP pool-reshard Chunk-out-of-bounds
# regression from #1391; dev20261031081414 breaks PP->TP P/D).
"tpu-sync-torch==0.0.1.dev20261112081648",
"libtpu==0.0.50",
"torch==2.11.0",
"torchvision==0.26.0",
"torchaudio==2.11.0",
"jax==0.11.2",
"jaxlib==0.11.2",
]
[project.optional-dependencies]
checkpoint-engine = ["checkpoint-engine==0.1.2"]
runai = ["runai-model-streamer[s3,gcs,azure]>=0.17.0"]
# Ray is required only for the --use-ray multihost launch path (RayEngine).
# Mirrors the `ray` extra in the base pyproject so `sglang[ray]` resolves on TPU
# builds too; pulled into dev_tpu so the TPU unit-test image gets it (otherwise
# test_ray_bundle_order.py's importorskip("ray") silently skips forever).
ray = ["ray[default]>=2.54.0"]
# Kernels for --attention-backend flywheel; pulled into dev_tpu so the TPU
# test image runs its unit and e2e tests.
flywheel = ["flywheel-tpu==0.4.1"]
tracing = [
"opentelemetry-api",
"opentelemetry-exporter-otlp",
"opentelemetry-exporter-otlp-proto-grpc",
"opentelemetry-sdk",
]
test = [
"accelerate",
"blobfile",
"expecttest",
"gguf",
"jsonlines",
"lm-eval[api]>=0.4.9.2",
"matplotlib",
"openai",
"pandas",
"peft>=0.18.0",
"pytest",
"sentence_transformers",
# mini-LB for the P/D feature-combo row (sglang_router.launch_router --mini-lb).
"sglang-router",
"tabulate",
]
# Mirrors srt_npu / all_npu / dev_npu shape. All TPU stack pins (torch_tpu,
# libtpu, torch, torchvision, torchaudio, jax, jaxlib) live in `dependencies`.
srt_tpu = []
all_tpu = []
# The `diffusion` extra minus CUDA-only kernels and model-specific tooling;
# pins track pyproject.toml.
diffusion_tpu = [
"addict==2.4.0",
"av==16.1.0",
"cache-dit==1.3.0",
"cloudpickle==3.1.2",
"diffusers==0.37.0",
"imageio==2.36.0",
"imageio-ffmpeg==0.5.1",
# test/test_utils.py imports cv2 unconditionally; the server harness needs it.
"opencv-python-headless==4.10.0.84",
"PyYAML==6.0.1",
]
dev_tpu = [
"sglang[all_tpu]",
"sglang[test]",
"sglang[ray]",
"sglang[runai]",
"sglang[flywheel]",
]
[project.urls]
"Homepage" = "https://github.com/sgl-project/sglang"
"Bug Tracker" = "https://github.com/sgl-project/sglang/issues"
[project.entry-points."sglang.srt.platforms"]
tpu = "sglang.srt.hardware_backend.tpu:activate"
# The plugin's hooks under the in-tree tpu platform, whose selection skips the
# sglang-tpu dist; mode B loads the same function from sglang-tpu.
[project.entry-points."sglang.srt.plugins"]
tpu_hooks = "sglang_tpu.hooks:register"
[project.scripts]
sglang = "sglang.cli.main:main"
[tool.setuptools.package-data]
"sglang" = [
"srt/**/*",
"kernels/**/*",
"multimodal_gen/apps/realtime_webui/**/*"
]
[tool.setuptools.exclude-package-data]
"sglang" = [
"kernels/aot/*",
"kernels/aot/**/*",
]
# .claude/skills is a directory symlink; setuptools build_py cannot copy it.
"sglang.multimodal_gen" = [".claude/*"]
[tool.setuptools.packages.find]
exclude = [
"assets*",
"benchmark*",
"docs*",
"dist*",
"playground*",
"scripts*",
"sglang.kernels.aot*",
"tests*",
]
[tool.wheel]
exclude = [
"assets*",
"benchmark*",
"docs*",
"dist*",
"playground*",
"scripts*",
"tests*",
]
[tool.setuptools_scm]
root = ".."
version_file = "sglang/_version.py"
git_describe_command = ["python3", "python/tools/get_version_tag.py"]
# Allow editable installs even when .git metadata is not available.
fallback_version = "0.0.0.dev0"
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch-tpu = { index = "torch-tpu-registry" }
torch = { index = "pytorch-cpu" }
torchvision = { index = "pytorch-cpu" }
torchaudio = { index = "pytorch-cpu" }
[[tool.uv.index]]
name = "torch-tpu-registry"
url = "https://us-python.pkg.dev/ml-oss-artifacts-transient/torch-tpu-virtual-registry/simple/"
explicit = true