-
Notifications
You must be signed in to change notification settings - Fork 534
Expand file tree
/
Copy pathpyproject.toml
More file actions
228 lines (208 loc) · 7.35 KB
/
pyproject.toml
File metadata and controls
228 lines (208 loc) · 7.35 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
[project]
name = "open-instruct"
version = "0.1.0"
description = "Train open, instruction-following language models"
readme = "README.md"
requires-python = "==3.12.*"
dependencies = [
"accelerate>=1.10.1",
"antlr4-python3-runtime==4.11",
"backoff>=2.2.1",
"bitsandbytes>=0.44.1; platform_system != 'Darwin'",
"datasets>=4.0.0",
"debugpy>=1.8.13",
"deepspeed>=0.18.3",
"hf-transfer>=0.1.8",
"litellm>=1.72.0,<1.75.2", # avoid needing backoff https://github.com/BerriAI/litellm/issues/13827
"matplotlib>=3.9.3",
"multiprocess<0.70.18", # avoid AttributeError in ResourceTracker.__del__
"nltk>=3.9.1",
"numpy>=2",
"ai2-olmo-core",
"nvitop>=1.4.2",
"packaging>=24.2",
"peft>=0.13.2",
"pyarrow>=20.0.0",
"pyyaml>=6.0.2",
"ray[default]>=2.49.2",
"setuptools>=75.6.0,<80.0.0",
"tensorboard>=2.18.0",
"torch>=2.10.0",
"transformers>=5.4.0",
"vllm>=0.19.0; platform_system != 'Darwin'",
"wandb==0.23.1",
"langdetect==1.0.9",
"immutabledict==1.2.0",
"flash-attn>=2.8.3; platform_system != 'Darwin' and platform_machine != 'aarch64'",
# The flat FA3 wheel index can publish a newer aarch64-only build than the latest x86_64 build.
# Pin the Linux x86_64 wheel directly so uv doesn't resolve to an aarch64-only version.
"flash-attn-3 @ https://github.com/windreamer/flash-attention3-wheels/releases/download/2026.03.19-850211f/flash_attn_3-3.0.0%2B20260318.cu128torch2100cxx11abitrue.8afc61-cp39-abi3-linux_x86_64.whl ; platform_system == 'Linux' and platform_machine == 'x86_64'",
"flash-attn-4 @ https://github.com/Dao-AILab/flash-attention/releases/download/fa4-v4.0.0.beta6/flash_attn_4-4.0.0b5-py3-none-any.whl ; platform_system != 'Darwin'",
"liger-kernel>=0.7.0; platform_system != 'Darwin'",
"fastapi>=0.100.0",
"uvicorn>=0.20.0",
"mcp>=1.9.0",
"openenv-core>=0.2.1",
"docker>=7.0.0",
"flash-linear-attention>=0.4.2",
]
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
py-modules = ["open_instruct"]
[tool.uv.extra-build-dependencies]
flash-attn = [{ requirement = "torch", match-runtime = true }]
flash-attn-3 = [{ requirement = "torch", match-runtime = true }]
[tool.uv.extra-build-variables]
flash-attn = { FLASH_ATTENTION_SKIP_CUDA_BUILD = "TRUE" }
flash-attn-3 = { FLASH_ATTENTION_SKIP_CUDA_BUILD = "TRUE" }
# pytorch related setups
[tool.uv.sources]
ai2-olmo-core = { git = "https://github.com/allenai/OLMo-core.git", rev = "002958a8f15a" }
flash-attn = [
{ url = "https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.9.0/flash_attn-2.8.3+cu128torch2.10-cp312-cp312-linux_x86_64.whl", marker = "platform_system == 'Linux' and platform_machine == 'x86_64'" },
]
torch = [
{ index = "pytorch-cu128", marker = "platform_system == 'Linux' and platform_machine != 'aarch64'"},
{ index = "pytorch-cu130", marker = "platform_system == 'Linux' and platform_machine == 'aarch64'"},
]
[[tool.uv.index]]
name = "pytorch-cu128"
url = "https://download.pytorch.org/whl/cu128"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[project.optional-dependencies]
code = [
"pydantic>=2.0.0",
"requests>=2.28.0",
]
dr-tulu = [
"dr_agent",
"authlib",
"scipy",
]
[tool.uv]
preview = true
python-preference = "only-managed"
link-mode = "hardlink"
override-dependencies = [
"transformers>=5.4.0",
]
environments = [
"sys_platform == 'linux' and platform_machine == 'x86_64'",
"sys_platform == 'linux' and platform_machine == 'aarch64'",
"sys_platform == 'darwin'",
]
[dependency-groups]
dev = [
"beaker-py>=2.5.7",
"mkdocs-material>=9.6.8",
"pytest>=8.3.4",
"ruff>=0.11.13",
"ty>=0.0.1a13",
"parameterized>=0.9.0",
"rich>=13.7.0",
"responses>=0.25.8",
"pre-commit>=4.5.0",
]
[tool.pytest.ini_options]
addopts = "--ignore=oe-eval-internal/"
filterwarnings = [
"ignore:.*sentry_sdk.Hub.*:DeprecationWarning",
"ignore:builtin type SwigPy.*:DeprecationWarning",
]
[tool.black]
line-length = 119
target-version = ['py310']
[tool.ruff]
target-version = "py310"
line-length = 119
src = ["open_instruct"]
exclude = ["wandb"]
[tool.ruff.format]
# Use black-compatible formatting
quote-style = "double"
indent-style = "space"
line-ending = "auto"
# Preserve original parentheses style to minimize changes
skip-magic-trailing-comma = true
# Enable black-compatible string normalization
docstring-code-format = false
[tool.ruff.lint]
# Enable rules equivalent to previous autoflake and flake8 configs:
# F = Pyflakes (covers autoflake functionality)
# E = pycodestyle errors (flake8)
# W = pycodestyle warnings (flake8)
# I = isort
# SIM = flake8-simplify
# UP = pyupgrade
# B = flake8-bugbear
select = ["F", "E", "W", "I", "SIM", "UP", "B", "PLC0415"]
ignore = [
"B905", # zip() without explicit strict= parameter
"C408", # dict() calls (stylistic)
"C901", # function complexity
"E501", # Line too long (handled by line-length setting)
]
[tool.ruff.lint.isort]
known-first-party = ["open_instruct", "mason"]
# case insensitive to match isort --profile black
case-sensitive = false
# Disable split-on-trailing-comma to work with skip-magic-trailing-comma
split-on-trailing-comma = false
# Ignore unresolved imports because some packages (e.g. vllm) are not available on macOS
# Ignore possibly-missing-attribute for torch.distributed which has incomplete type stubs
[tool.ty.rules]
unresolved-import = "ignore"
possibly-missing-attribute = "ignore"
[tool.ty.src]
include = [
"mason.py",
"open_instruct/actor_manager.py",
"open_instruct/benchmark_generators.py",
"open_instruct/code_utils/api.py",
"open_instruct/context_window_checker.py",
"open_instruct/dataset_processor.py",
"open_instruct/dataset_transformation.py",
"open_instruct/data_loader.py",
"open_instruct/data_types.py",
"open_instruct/dpo_config.py",
"open_instruct/dpo_utils.py",
"open_instruct/grpo.py",
"open_instruct/grpo_callbacks.py",
"open_instruct/grpo_olmo_core_actor.py",
"open_instruct/grpo_utils.py",
"open_instruct/launch_utils.py",
"open_instruct/logger_utils.py",
"open_instruct/mix_data.py",
"open_instruct/mix_data_preferences.py",
"open_instruct/olmo_core_train_modules.py",
"open_instruct/padding_free_collator.py",
"open_instruct/rejection_sampling/prompt_templates.py",
"open_instruct/rl_utils.py",
"open_instruct/distillkit/compression/bitpack.py",
"open_instruct/distillkit/compression/compressor.py",
"open_instruct/distillkit/compression/config.py",
"open_instruct/distillkit/compression/monotonic_logprobs.py",
"open_instruct/distillkit/sample_common.py",
"open_instruct/rubrics/evolving_rubric_step.py",
"open_instruct/rubrics/metrics.py",
"open_instruct/rubrics/prompts.py",
"open_instruct/rubrics/rubric_utils.py",
"open_instruct/rubrics/run_utils.py",
"open_instruct/environments/base.py",
"open_instruct/environments/examples.py",
"open_instruct/environments/tools/generic_mcp.py",
"open_instruct/environments/tools/parsers.py",
"open_instruct/environments/tools/tools.py",
"open_instruct/environments/tools/utils.py",
]
exclude = ["scripts/", "decontamination/", "human_eval/"]