Skip to content

Commit 60f7d88

Browse files
authored
Merge branch 'main' into publish-auto-cuda13
2 parents a1c2128 + b08d6dc commit 60f7d88

8 files changed

Lines changed: 855 additions & 1273 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88

99
### Changed
1010
- Automatically publish stable CUDA 12 and CUDA 13 Beaker image aliases after merge-queue integration tests pass (https://github.com/allenai/open-instruct/pull/1783).
11+
- Wire `keep_last_n_checkpoints` through `build_checkpointer_callback` and `build_base_callbacks` to OLMo-core's new `max_checkpoints` parameter across SFT, DPO, and GRPO training paths; bump OLMo-core to the commit that added `max_checkpoints` (`fa6c501`). Negative values (e.g. `-1`) mean unlimited (https://github.com/allenai/open-instruct/pull/1701).
1112
- Add selectable CUDA 12.8 and CUDA 13.0 Docker builds, including matching torch, vLLM, and flash-attention dependency variants, and add B300 support on the new `ai2/holmes` cluster (https://github.com/allenai/open-instruct/pull/1758).
1213
- Increase default environment pool acquire timeout to 7200s (https://github.com/allenai/open-instruct/pull/1729).
1314
- Change the default generation `temperature` to 1.0 and make `SamplingConfig.temperature` a required field so `StreamingConfig.temperature` is the single source of truth (https://github.com/allenai/open-instruct/pull/1725).

open_instruct/dpo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def _setup_callbacks(args: dpo_utils.DPOExperimentConfig, dp_world_size: int):
7272
wandb_project=args.wandb_project,
7373
wandb_entity=args.wandb_entity,
7474
save_async=False,
75+
max_checkpoints=args.keep_last_n_checkpoints,
7576
)
7677
slack_webhook_url = os.environ.get("SLACK_WEBHOOK_URL")
7778
if args.send_slack_alerts and slack_webhook_url:

open_instruct/grpo_olmo_core_actor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,9 @@ def fit(self) -> dict:
377377

378378
if self.grpo_config.checkpoint_state_freq > 0:
379379
trainer_callbacks["checkpointer"] = olmo_core_utils.build_checkpointer_callback(
380-
checkpointing_steps=self.grpo_config.checkpoint_state_freq, ephemeral_save_interval=None
380+
checkpointing_steps=self.grpo_config.checkpoint_state_freq,
381+
ephemeral_save_interval=None,
382+
max_checkpoints=self.grpo_config.keep_last_n_checkpoints,
381383
)
382384
trainer_callbacks["data_prep_state"] = grpo_callbacks_lib.DataPreparationActorCheckpointCallback()
383385

open_instruct/olmo_core_finetune.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ def main(args: SFTArguments, tc: dataset_transformation.TokenizerConfig) -> None
288288
with_tracking=args.logging.with_tracking,
289289
wandb_project=args.logging.wandb_project,
290290
wandb_entity=args.logging.wandb_entity or "ai2-llm",
291+
max_checkpoints=args.checkpoint.keep_last_n_checkpoints,
291292
)
292293
trainer_callbacks["config_saver"] = callbacks.ConfigSaverCallback(_config=config_dict)
293294
trainer_callbacks["garbage_collector"] = callbacks.GarbageCollectorCallback()

open_instruct/olmo_core_utils.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,21 @@ class CheckpointConfig:
240240

241241

242242
def build_checkpointer_callback(
243-
checkpointing_steps: int, ephemeral_save_interval: int | None, save_async: bool = True
243+
checkpointing_steps: int,
244+
ephemeral_save_interval: int | None,
245+
save_async: bool = True,
246+
max_checkpoints: int | None = 3,
244247
) -> CheckpointerCallback:
245-
"""Construct a CheckpointerCallback with shared Open Instruct defaults."""
248+
"""Construct a CheckpointerCallback with shared Open Instruct defaults.
249+
250+
``max_checkpoints`` accepts the open-instruct convention where ``-1`` means
251+
unlimited. Negative values are mapped to ``None`` (keep all).
252+
"""
246253
return CheckpointerCallback(
247-
save_interval=checkpointing_steps, ephemeral_save_interval=ephemeral_save_interval, save_async=save_async
254+
save_interval=checkpointing_steps,
255+
ephemeral_save_interval=ephemeral_save_interval,
256+
save_async=save_async,
257+
max_checkpoints=max_checkpoints if max_checkpoints is not None and max_checkpoints >= 0 else None,
248258
)
249259

250260

@@ -294,13 +304,14 @@ def build_base_callbacks(
294304
wandb_project: str | None = None,
295305
wandb_entity: str | None = None,
296306
save_async: bool = True,
307+
max_checkpoints: int | None = 3,
297308
) -> dict[str, Any]:
298309
"""Build the callbacks shared across SFT and DPO: beaker, gpu monitor, checkpointer, and optional wandb."""
299310
result: dict[str, Any] = {
300311
"beaker": olmo_core_callbacks.BeakerCallbackV2(config=config_dict),
301312
"gpu_monitor": train_callbacks.GPUMemoryMonitorCallback(),
302313
"checkpointer": build_checkpointer_callback(
303-
checkpointing_steps, ephemeral_save_interval, save_async=save_async
314+
checkpointing_steps, ephemeral_save_interval, save_async=save_async, max_checkpoints=max_checkpoints
304315
),
305316
}
306317
if with_tracking and wandb_project:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ flash-attn-3 = { FLASH_ATTENTION_SKIP_CUDA_BUILD = "TRUE" }
7171

7272
# pytorch related setups
7373
[tool.uv.sources]
74-
ai2-olmo-core = { git = "https://github.com/allenai/OLMo-core.git", rev = "9aa3280fd5331b93fc766206eadec42ee73befc0" }
74+
ai2-olmo-core = { git = "https://github.com/allenai/OLMo-core.git", rev = "fa6c5014c9f6e9ee789da2d9c20d5126fee8df0d" }
7575
flash-attn = [
7676
{ 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", group = "cuda12" },
7777
{ url = "https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.9.0/flash_attn-2.8.3+cu130torch2.10-cp312-cp312-linux_x86_64.whl", group = "cuda13" },

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ accelerate==1.12.0 ; (platform_machine == 'aarch64' and sys_platform == 'linux')
66
# via
77
# open-instruct
88
# peft
9-
ai2-olmo-core @ git+https://github.com/allenai/OLMo-core.git@9aa3280fd5331b93fc766206eadec42ee73befc0 ; (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or sys_platform == 'darwin'
9+
ai2-olmo-core @ git+https://github.com/allenai/OLMo-core.git@fa6c5014c9f6e9ee789da2d9c20d5126fee8df0d ; (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or sys_platform == 'darwin'
1010
# via open-instruct
1111
aiofiles==25.1.0 ; (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux') or sys_platform == 'darwin'
1212
# via crawl4ai

0 commit comments

Comments
 (0)