-
Notifications
You must be signed in to change notification settings - Fork 283
Expand file tree
/
Copy pathpyproject.toml
More file actions
314 lines (281 loc) · 8.17 KB
/
pyproject.toml
File metadata and controls
314 lines (281 loc) · 8.17 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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
include = ["skyrl*"]
[project]
name = "skyrl"
dynamic = ["version"]
description = "Unified API for training and inference"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"datasets>=4.0.0",
"pillow>=11.3.0",
"rich>=14.1.0",
"safetensors>=0.6.2",
"tokenizers>=0.21.2",
"transformers>=4.56.1,<5",
"typer>=0.17.4",
# "wandb>=0.22.0",
"peft",
"hf_transfer",
"cloudpathlib>=0.23.0",
]
[project.optional-dependencies]
gpu = [
"jax[cuda12]>=0.7.2; sys_platform == 'linux'",
]
tpu = [
"jax[tpu]>=0.7.2; sys_platform == 'linux'",
]
tinker = [
"tinker>=0.3.0",
"fastapi[standard]",
"sqlmodel",
"sqlalchemy[asyncio]",
"aiosqlite",
"asyncpg",
"psycopg2-binary",
]
aws = [
"cloudpathlib[s3]",
]
gcp = [
"cloudpathlib[gs]",
]
azure = [
"cloudpathlib[azure]",
]
# The extras "jax", "fsdp", and "megatron" are the dependencies the
# engine needs for --backend="jax", --backend="fsdp", and --backend="megatron",
# respectively.
jax = [
"jax>=0.8,<1.0",
"flax>=0.12.2",
"optax>=0.2.5",
]
skyrl-train = [
"loguru",
"tqdm",
"ninja",
"tensorboard",
"func_timeout",
"transformers>=4.51.0",
"hydra-core==1.3.2",
"accelerate",
"torchdata",
"omegaconf",
"ray==2.51.1",
"peft",
"debugpy==1.8.0",
"hf_transfer",
"wandb",
"datasets>=4.0.0",
"tensordict",
"jaxtyping",
"skyrl-gym",
"flash-attn; sys_platform == 'linux'",
"polars",
"s3fs",
"fastapi",
"uvicorn",
"pybind11",
"setuptools",
]
fsdp = [
"skyrl[skyrl-train]",
"vllm==0.16.0; sys_platform == 'linux'",
"flash-attn==2.8.3; sys_platform == 'linux'",
"torch==2.9.1; sys_platform == 'linux'",
"flashinfer-python==0.6.3; sys_platform == 'linux' and platform_machine == 'x86_64'",
"flashinfer-jit-cache==0.6.3; sys_platform == 'linux' and platform_machine == 'x86_64'",
"torchvision; sys_platform == 'linux'",
]
megatron = [
"skyrl[skyrl-train]",
"transformer-engine[pytorch]==2.10.0; sys_platform == 'linux'",
"flash-attn==2.8.1; sys_platform == 'linux'",
"vllm==0.16.0; sys_platform == 'linux'",
"torch==2.9.1; sys_platform == 'linux'",
"flashinfer-python==0.6.3; sys_platform == 'linux' and platform_machine == 'x86_64'",
"torchvision; sys_platform == 'linux'",
"megatron-bridge; sys_platform == 'linux'",
"megatron-core==0.16.0; sys_platform == 'linux'",
"flashinfer-jit-cache==0.6.3; sys_platform == 'linux' and platform_machine == 'x86_64'",
"nvidia-modelopt; sys_platform == 'linux'",
]
flashrl = [
"skyrl[skyrl-train]",
# NOTE: Custom vLLM wheel must be installed separately.
# See examples/flash_rl/README.md for installation instructions.
"flash-attn==2.8.3; sys_platform == 'linux'",
"torch==2.7.0; sys_platform == 'linux'",
"flashinfer-python; sys_platform == 'linux'",
"torchvision; sys_platform == 'linux'",
]
miniswe = [
"skyrl[skyrl-train]",
# NOTE (sumanthrh): Needs to be a commit after https://github.com/SWE-agent/mini-swe-agent/commit/4f5d445e99d13b5482478c23508bf2fbf7c0670c
"mini-swe-agent>=1.12.0",
"litellm",
]
harbor = [
"harbor; python_version >= '3.12'",
]
dev = [
"mkdocs",
"mkdocs-material",
"mkdocstrings[python]>=0.24.0",
"pymdown-extensions>=10.7",
"pytest",
"pytest-forked",
"pytest-asyncio",
"pre-commit",
"litellm",
"torch",
"ty",
"cloudpathlib[s3]",
"alembic",
"griffe2md",
]
[tool.setuptools]
include-package-data = true
[tool.setuptools.dynamic]
version = {attr = "skyrl.__version__"}
[project.entry-points."vllm.general_plugins"]
skyrl_ipc_engine = "skyrl.backends.skyrl_train.weight_sync.vllm_ipc_engine:register_ipc_engine"
[project.scripts]
# The following is for supporting the skyrl-train dependency
[tool.uv]
# Resolve for both Linux (production) and macOS (dev)
required-environments = [
"sys_platform == 'linux'",
"sys_platform == 'darwin' and platform_machine == 'arm64'",
]
constraint-dependencies = [
"flashinfer-jit-cache==0.6.3",
]
# each backend should have separate dependencies that can potentially clash
# megatron also clashes with the jax dependency from gpu and tpu extras
conflicts = [
[
{ extra = "jax" },
{ extra = "megatron" },
{ extra = "fsdp" },
{ extra = "flashrl" },
],
[
{ extra = "megatron" },
{ extra = "gpu" },
{ extra = "tpu" },
{ extra = "flashrl" },
{ extra = "miniswe" },
]
]
# disable build isolation for megatron related dependencies
no-build-isolation-package = [
"transformer-engine-torch",
"transformer-engine",
"nv-grouped-gemm",
]
# override unnecessary dependencies and pin versions to override Megatron-Bridge
# unpinned dependencies.
override-dependencies = [
"nvidia-resiliency-ext; sys_platform == 'never'",
"mamba-ssm; sys_platform == 'never'",
"causal-conv1d; sys_platform == 'never'",
"transformer-engine[pytorch]==2.10.0; sys_platform == 'linux'",
"megatron-core==0.16.0; sys_platform == 'linux'",
"ml_dtypes>=0.5.0; sys_platform == 'linux'",
]
[tool.uv.extra-build-dependencies]
flash-attn = [{requirement = "torch", match-runtime = true}]
transformer-engine = [{requirement = "torch", match-runtime = true}, "build_tools", "ninja"]
transformer-engine-torch = [{requirement = "torch", match-runtime = true}, "build_tools", "ninja"]
[tool.uv.extra-build-variables]
flash-attn = { FLASH_ATTENTION_SKIP_CUDA_BUILD = "TRUE"}
[[tool.uv.index]]
name = "pytorch-cu128"
url = "https://download.pytorch.org/whl/cu128"
explicit = true
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "jax-tpu"
url = "https://storage.googleapis.com/jax-releases/libtpu_releases.html"
[[tool.uv.index]]
name = "flashinfer-cu128"
url = "https://flashinfer.ai/whl/cu128"
explicit = true
[tool.uv.sources]
skyrl-gym = { path = "./skyrl-gym", editable = true }
# flashinfer wheels are only available from the custom cu128 index
flashinfer-jit-cache = { index = "flashinfer-cu128", marker = "sys_platform == 'linux'" }
# Use CUDA torch on Linux, CPU torch on macOS (must match skyrl-train config)
torch = [
{ index = "pytorch-cu128", marker = "sys_platform == 'linux'" },
{ index = "pytorch-cpu", marker = "sys_platform == 'darwin'" },
]
torchvision = [
{ index = "pytorch-cu128", marker = "sys_platform == 'linux'" },
{ index = "pytorch-cpu", marker = "sys_platform == 'darwin'" },
]
# pin megatron bridge commit to fix for MoE + LoRA merging. Update this when an official release is cut
megatron-bridge = {git = "https://github.com/NVIDIA-NeMo/Megatron-Bridge", rev = "02b5fccab5e5b21856d36c2e357839e0123b4b8f", marker = "sys_platform == 'linux'"}
harbor = { git = "https://github.com/laude-institute/harbor", rev = "8c040e1bb010201fd3c75bee3dede2407b9f57cd" }
[tool.black]
line-length = 120
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''
[tool.flake8]
max-line-length = 120
max-doc-length = 120
extend-ignore = [
# Default ignored errors by flake8
"E121", "E123", "E126", "E226", "E24", "E704",
# F401 module imported but unused
"F401",
# E203 whitespace before ':' (conflict with black)
"E203",
# E231 missing whitespace after ',' (conflict with black)
"E231",
# E501 line too long (conflict with black)
"E501",
# E741 do not use variables named 'l', 'O', or 'I'
"E741",
# W503 line break before binary operator (conflict with black)
"W503",
# W504 line break after binary operator (conflict with black)
"W504",
# W505 doc line too long (conflict with black)
"W505",
# W605 invalid escape sequence 'x' (conflict with latex within docs)
"W605",
]
[tool.ruff]
exclude = [
"skyrl-agent/",
"examples/",
]
[tool.ruff.lint]
extend-select = ["I"]
ignore = [
"F722" # Syntax error in annotation - ignored because this doesn't play well with jaxtyping
]
[tool.ruff.lint.isort]
known-first-party = ["skyrl", "skyrl_gym"]