Skip to content

Commit 77f91c3

Browse files
committed
all changes from olmo3 but for olmo2.5
1 parent 1275d36 commit 77f91c3

File tree

7 files changed

+28
-6
lines changed

7 files changed

+28
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,4 @@ dmypy.json
159159
cache/
160160
local_dataset_cache/
161161
scratch/
162+
vllm_olmo2.5/

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ COPY pyproject.toml uv.lock ./
3131
# Annoyingly, we need this before `uv run`, or it complains.
3232
COPY open_instruct open_instruct
3333

34+
# Install custom vllm for olmo3
35+
RUN git clone -b shanea/olmo2-retrofit https://github.com/2015aroras/vllm.git vllm_olmo2.5
36+
3437
# Install dependencies
3538
RUN --mount=type=cache,target=${UV_CACHE_DIR} \
3639
--mount=type=bind,source=uv.lock,target=uv.lock \
@@ -49,4 +52,4 @@ COPY oe-eval-internal oe-eval-internal
4952
COPY mason.py mason.py
5053

5154
# Set up the environment
52-
ENV PATH=/stage/.venv/bin:$PATH
55+
ENV PATH=/stage/.venv/bin:$PATH

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: style quality
1+
.PHONY: style quality docker
22

33
# make sure to test the local checkout in scripts and not the pre-installed one (don't use quotes!)
44
export PYTHONPATH = open_instruct
@@ -16,3 +16,10 @@ style-check: ## *fail* if anything needs rewriting
1616

1717
quality-check: ## *fail* if any rewrite was needed
1818
uv run ruff check --exit-non-zero-on-fix $(check_dirs)
19+
20+
docker:
21+
DOCKER_BUILDKIT=1 docker build -f Dockerfile --build-arg UV_CACHE_DIR=$(UV_CACHE_DIR) -t open_instruct_dev_uv_olmo3 .
22+
# if you are internally at AI2, you can create an image like this:
23+
$(eval beaker_user := $(shell beaker account whoami --format json | jq -r '.[0].name'))
24+
beaker image delete $(beaker_user)/open_instruct_dev_olmo2.5
25+
beaker image create open_instruct_dev_uv_olmo3 -n open_instruct_dev_uv_olmo3 -w ai2/$(beaker_user)

open_instruct/grpo_fast.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ class Args:
382382
"""The beaker evaluation tasks to launch"""
383383
oe_eval_max_length: int = 4096
384384
"""the max generation length for evaluation for oe-eval"""
385+
oe_eval_beaker_image: Optional[str] = None
386+
"""the docker image for evaluation for oe-eval"""
385387
eval_priority: Literal["low", "normal", "high", "urgent"] = "normal"
386388
"""the priority of auto-launched evaluation jobs"""
387389

@@ -1078,6 +1080,7 @@ def launch_ai2_evals_on_weka_wrapper(self, step_dir, leaderboard_name, wandb_url
10781080
args.stop_strings,
10791081
args.gs_bucket_path,
10801082
args.eval_priority,
1083+
args.oe_eval_beaker_image,
10811084
)
10821085

10831086

open_instruct/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,7 @@ def launch_ai2_evals_on_weka(
10451045
stop_strings: Optional[List[str]] = None,
10461046
gs_bucket_path: Optional[str] = None,
10471047
eval_priority: Optional[str] = "normal",
1048+
beaker_image: Optional[str] = None,
10481049
) -> None:
10491050
weka_cluster = "ai2/saturn-cirrascale ai2/neptune-cirrascale"
10501051
gcp_cluster = "ai2/augusta-google-1"
@@ -1096,6 +1097,8 @@ def launch_ai2_evals_on_weka(
10961097
command += f" --oe_eval_tasks {','.join(oe_eval_tasks)}"
10971098
if stop_strings is not None:
10981099
command += f" --oe_eval_stop_sequences '{','.join(stop_strings)}'"
1100+
if beaker_image is not None:
1101+
command += f" --beaker_image {beaker_image}"
10991102
print(f"Launching eval jobs with command: {command}")
11001103
process = subprocess.Popen(["bash", "-c", command], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
11011104
stdout, stderr = process.communicate()

open_instruct/vllm_utils3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ def create_vllm_engines(
306306
results_queue=None,
307307
eval_results_queue=None,
308308
) -> list[LLMRayActor]:
309-
assert vllm.__version__ >= "0.8.1", "OpenRLHF only supports vllm >= 0.8.1"
309+
# if we installed from source, don't worry about it
310+
if "dev" not in vllm.__version__:
311+
assert vllm.__version__ >= "0.8.1", "OpenRLHF only supports vllm >= 0.8.1"
310312

311313
# Convert max_tool_calls to a dict mapping tool end strings to their limits
312314
assert len(max_tool_calls) == 1 or len(max_tool_calls) == len(tools), (

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ dependencies = [
1919
"nvitop>=1.4.2",
2020
"packaging>=24.2",
2121
"peft>=0.13.2",
22-
"ray[default]>=2.44.1",
22+
"ray[default]==2.46.0",
2323
"setuptools>=75.6.0,<80.0.0",
2424
"tensorboard>=2.18.0",
2525
"torch==2.7.0",
26-
"transformers>=4.52.4,<4.54.0", # see https://github.com/vllm-project/vllm-ascend/issues/2046
27-
"vllm==0.9.1",
26+
"transformers @ git+https://github.com/2015aroras/transformers.git@shanea/olmo2-retrofit",
2827
"wandb==0.18.1",
2928
"langdetect==1.0.9",
3029
"immutabledict==1.2.0",
3130
"pytest-xdist==3.8.0",
3231
"flash-attn>=2.8.0.post2; platform_system != 'Darwin'",
3332
"liger-kernel>=0.5.4; platform_system != 'Darwin'",
3433
"flashinfer-python==0.2.8; platform_system != 'Darwin'",
34+
"vllm",
3535
]
3636

3737
[build-system]
@@ -46,12 +46,14 @@ flash-attn = [{ requirement = "torch", match-runtime = true }]
4646

4747
[tool.uv.extra-build-variables]
4848
flash-attn = { FLASH_ATTENTION_SKIP_CUDA_BUILD = "TRUE" }
49+
vllm = { VLLM_USE_PRECOMPILED = "1" }
4950

5051
# pytorch related setups
5152
[tool.uv.sources]
5253
torch = [
5354
{ index = "pytorch-cu128", marker = "platform_system != 'Darwin'"},
5455
]
56+
vllm = { path = "./vllm_olmo3", editable = true }
5557

5658
[[tool.uv.index]]
5759
name = "pytorch-cu128"
@@ -101,6 +103,7 @@ target-version = ['py310']
101103

102104
[tool.isort]
103105
known_first_party = ["open_instruct"]
106+
known-third-party = ["wandb"]
104107
profile = "black"
105108
src_paths = ["open_instruct"]
106109

0 commit comments

Comments
 (0)