diff --git a/open_instruct/dpo.py b/open_instruct/dpo.py new file mode 100644 index 0000000000..5bed506916 --- /dev/null +++ b/open_instruct/dpo.py @@ -0,0 +1,337 @@ +import contextlib +import dataclasses +import enum + +from olmo_core import train +from olmo_core import data +from olmo_core import config +from olmo_core import nn +from olmo_core.internal import experiment + + +@contextlib.contextmanager +def prepare_dpo_training_environment(): + train.prepare_training_environment() + try: + yield + finally: + train.teardown_training_environment() + + +class DPOLossType(enum.Enum): + dpo = 1 + dpo_norm = 2 + simpo = 3 + wpo = 4 + +class DatasetCacheMode(enum.Enum): + LOCAL = 1 + HF = 2 + + +@dataclasses.dataclass +class DPOExperiment: + trainer: train.Trainer + + def run(): + with prepare_dpo_training_environment(): + self.trainer.fit() + + +@dataclasses.dataclass +class DPOTrainerConfig: + +@dataclasses.dataclass +class WandbConfig: + enabled: bool = True + project: str = "open_instruct" + entity: str = "ai2-llm" + group: str = "dpo_experiments" + + +@dataclasses.dataclass +class DPOExperimentConfig(config.Config): + # Experiment names + exp_name: str = "dpo_experiment" # Name of this experiment (e.g. DPO). + run_name: str | None = None # Unique name of this run. + + # + checkpoint_every: int | str = 500 # Save a checkpoint every N steps or "epoch" to save at the end of each epoch. + keep_last_n_checkpoints: int = 3 # Number of last checkpoints to keep. Older checkpoints will be deleted. + + # Model config + model_name_or_path: str | None + use_flash_attn: bool = True + model_revision: str | None = None # Model revision to use (branch, tag, or commit id). + additional_model_kwargs: dict[str, config.ConfigField] | None = None # Additional kwargs for model initialization. + + # DPO loss config + dpo_beta: float = 0.1 # DPO beta parameter. + dpo_loss_type: DPOLossType # Type of DPO loss to use. + dpo_gamma_beta_ratio: float = 0.3 # Ratio for SIMPO loss. Not used for other loss types. + dpo_label_smoothing: float = 0.0 # Label smoothing for DPO loss. Default is 0.0 (no smoothing). + + # Optimization config + clip_grad_norm: float = 1.0 # Gradient clipping norm. + gradient_accumulation_steps: int = 1 # Number of gradient accumulation steps. + learning_rate: float = 2e-5 + lr_scheduler_type: str = "cosine" # Learning rate scheduler type. + log_every: int = 10 # Logging frequency (in steps). + num_epochs: int = 2 + per_device_train_batch_size: int = 8 + warmup_ratio: float = 0.03 # Warmup ratio for learning rate scheduler. + weight_decay: float = 0.01 # Weight decay for AdamW. + gradient_checkpointing: bool = False # Whether to use gradient checkpointing. + use_liger_kernel: bool = False + max_train_steps: int | None = None # Maximum number of training steps. If set, overrides num_epochs. + seed: int = 42 + fused_optimizer: bool = True # Whether to use fused AdamW. + load_balancing_loss: bool = False # Whether to include a load balancing loss (for OLMoE). + load_balancing_weight: float = 1e-3 # Weight for the load balancing loss. + + + + + + # LoRA config + use_lora: bool = False + use_qlora: bool = False + lora_rank: int = 64 + lora_alpha: float = 16 + lora_dropout: float = 0.1 + + # Export config + output_dir: str = "output/" + save_to_hub: str | None = None # Repository name to save the model to the Hugging Face Hub. E.g. allenai/your-model. + push_to_hub: bool = False # Whether to push the model to the Hugging Face Hub. + hf_entity: str | None = None # Hugging Face Hub entity (user or organization). + + + # Checkpoint config + checkpoint_config: CheckpointConfig + + # Reporting config + report_to: list[str] = dataclasses.field( + default_factory=lambda: ["all"] + ) # Options are tensorboard, wandb, comet_ml, clearml, all. + wandb_config: WandbConfig + + + # Dataset config + dataset_name: str | None = None + dataset_mixer: dict[str, float] | None = None + dataset_mixer_list: list[str] = field( + default_factory=lambda: ["allenai/tulu-3-wildchat-reused-on-policy-8b", "1.0"] + ) + dataset_mixer_list_splits: list[str] = field(default_factory=lambda: ["train"]) + dataset_transform_fn: list[str] = field( + default_factory=lambda: ["preference_tulu_tokenize_and_truncate_v1", "preference_tulu_filter_v1"] + ) + dataset_target_columns: list[str] = field(default_factory=lambda: TOKENIZED_PREFERENCE_DATASET_KEYS) + dataset_cache_mode: DatasetCacheMode = DatasetCacheMode.LOCAL + dataset_local_cache_dir: str = "local_dataset_cache" + dataset_config_hash: str | None = None + dataset_skip_cache: bool = False + dataset_mix_dir: str | None = None + dataset_config_name: str | None = None + max_train_samples: int | None = None + max_seq_length: int | None = None + overwrite_cache: bool = False + timeout_s: int = 1800 # Timeout for the training process. Useful if tokenization is slow. + + + + + model: nn.transformer.TransformerConfig + dataset: data.NumpyDatasetConfig + data_loader: data.NumpyDataLoaderConfig + trainer_config: train.TrainerConfig + train_module: train.TransformerTrainModuleConfig + init_seed: int = 123 + load_path: str | None = None + load_trainer_state: bool = False + + +@dataclasses.dataclass +class DPOConfig(train.TransformerTrainModuleConfig): + + def build(self, model: Transformer, + device: torch.device | None = None) -> 'DPOTrainModule': + return DPOTrainModule(self) + + +class DPOTrainModule(olmo_core.train.TransformerTrainModule): + def __init__(self, model, device, dpo_config: DPOConfig): + super().__init__(model, device) + self.config = dpo_config + + + def train_batch(self, batch: Dict[str, Any], dry_run: bool = False): + """This is largely copy/pasted from the base class, with modifications for DPO loss.""" + # Set model to train mode if it isn't already. + self._set_model_mode("train") + + # Generate labels. + if "labels" not in batch: + batch["labels"] = get_labels(batch, label_ignore_index=self.label_ignore_index) + + # Record how many instances are going to be skipped (masked out). + if (instance_mask := batch.get("instance_mask")) is not None and not dry_run: + self.record_metric( + "train/masked instances (%)", (~instance_mask).float().mean(), ReduceType.mean + ) + + # Calculate and record how many tokens are going to be used in the loss. + batch_num_tokens = batch["labels"].numel() + batch_num_tokens_for_loss = move_to_device( + (batch["labels"] != self.label_ignore_index).sum(), self.device + ) + self.record_metric( + "train/masked labels (%)", + (batch_num_tokens - batch_num_tokens_for_loss) / batch_num_tokens, + ReduceType.mean, + ) + + # Batch losses to record. + policy_chosen_ = move_to_device(torch.tensor(0.0), self.device) + z_batch_loss: Optional[torch.Tensor] = None + if self.z_loss_multiplier is not None: + z_batch_loss = move_to_device(torch.tensor(0.0), self.device) + + # Split into micro-batches. + if self.rank_microbatch_size < (seq_len := batch["input_ids"].shape[1]): + raise RuntimeError( + f"Microbatch size ({self.rank_microbatch_size}) is too small relative to sequence length ({seq_len})" + ) + micro_batches = split_batch(batch, self.rank_microbatch_size // seq_len) + num_micro_batches = len(micro_batches) + batch_loss = move_to_device(torch.tensor(0.0), self.device) + aux_loss = move_to_device(torch.tensor(0.0), self.device) + # Train one micro-batch at a time. + for micro_batch_idx, micro_batch in enumerate(micro_batches): + with self._train_microbatch_context(micro_batch_idx, num_micro_batches): + input_ids, labels, model_kwargs = self._prepare_batch(micro_batch) + + # Run forward pass, get losses. + # `aux_loss` is only used when `args.load_balancing_loss = True` + policy_chosen_logps, policy_rejected_logps, aux_loss = forward_fn( + model, batch, average_log_prob=average_log_prob, + output_router_logits=args.load_balancing_loss) + losses, _, _ = dpo_utils.dpo_loss( + policy_chosen_logps, + policy_rejected_logps, + reference_chosen_logps, + reference_rejected_logps, + loss_kwargs=self.config.loss_kwargs + ) + + # Update total batch CE and Z loss. + batch_loss += get_local_tensor(losses) + del losses + if aux_batch_loss is not None: + assert aux_loss is not None + aux_loss += get_local_tensor(aux_batch_loss + del aux_batch_loss + + # Run backward pass. + loss.backward() + + del batch # In case this helps with memory utilization. + + self.model.post_batch(dry_run=dry_run) + + if dry_run: + self.model.reset_auxiliary_metrics() + return + + # Record loss metrics. + if isinstance(self.optim, SkipStepOptimizer): + # Need to reduce the loss right away for the SkipStepOptimizer. + if is_distributed(): + ce_batch_loss.div_(self._reduce_divide_factor) + dist.all_reduce(ce_batch_loss) + ce_batch_loss.div_(self.world_size) + ce_batch_loss.mul_(self._reduce_divide_factor) + self.record_ce_loss(ce_batch_loss) + self.optim.latest_loss = ce_batch_loss + else: + self.record_ce_loss(ce_batch_loss, ReduceType.mean) + if z_batch_loss is not None: + assert self.z_loss_multiplier is not None + self.record_metric( + "Aux batch loss", + aux_batch_loss, + ReduceType.mean, + namespace="train", + ) + + # And additional metrics. + for metric_name, (metric_val, reduction) in self.model.compute_auxiliary_metrics( + reset=True + ).items(): + self.record_metric( + metric_name, + metric_val, + reduction, + namespace="train", + ) + + +def build_config(config) -> DPOExperimentConfig: + config.wandb_config.config = config.as_dict() + run_name = f"{common.run_name}-{datetime.now().astimezone().strftime('%Y%m%dT%H%M%S%z')}" + trainer_config = train.TrainerConfig( + save_folder=f"/weka/oe-adapt-default/checkpoints/{common.run_name}", + save_overwrite=True, + max_duration=train.Duration.steps(config.steps) + ) + .with_callback( + "checkpointer", + callbacks.CheckpointerCallback(**config.checkpoint_config.as_dict() + )) + .with_callback( + "wandb", + callbacks.WandbCallback(**config.wandb_config), + ) + model_config = nn.transformer.TransformerConfig.olmo3_7B( + vocab_size=common.tokenizer.padded_vocab_size(), + attn_backend=AttentionBackendName.flash_2, + ) + dataset_config = data.NumpyDatasetConfig( + dataset_name=config.dataset_name, + dataset_mixer=config.dataset_mixer, + target_columns=config.dataset_target_columns, + transform_fn=config.dataset_transform_fn, + max_samples=config.max_train_samples, + max_seq_length=config.max_seq_length, + cache_mode=config.dataset_cache_mode, + local_cache_dir=config.dataset_local_cache_dir, + config_hash=config.dataset_config_hash, + skip_cache=config.dataset_skip_cache, + mix_dir=config.dataset_mix_dir, + config_name=config.dataset_config_name, + overwrite_cache=config.overwrite_cache, + timeout_s=config.timeout_s, + ) + return DPOExperimentConfig( + exp_name=common.run_name, + run_name=run_name, + trainer_config=trainer_config, + model=model_config, + dataset=dataset_config, + + + + +if __name__ == "__main__": + config_builder = functools.partial(config_builder = partial( + build_config, + global_batch_size=GLOBAL_BATCH_SIZE, + max_sequence_length=SEQUENCE_LENGTH, + model_config_builder=build_model_config, + train_module_config_builder=build_train_module_config, + trainer_config_builder=build_trainer_config, + include_default_evals=False, + include_instance_filter=False, # We use SkipStepOptimizer for this problem. + ) + experiment.main(config_builder=config_builder) diff --git a/pyproject.toml b/pyproject.toml index 53eb7b57a7..0a42609ae0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ dependencies = [ "immutabledict==1.2.0", "flash-attn>=2.8.3; platform_system != 'Darwin'", "liger-kernel>=0.5.4; platform_system != 'Darwin'", + "ai2-olmo-core==2.3.0", ] [build-system] diff --git a/uv.lock b/uv.lock index a6c81c00b1..d2dedc273f 100644 --- a/uv.lock +++ b/uv.lock @@ -36,6 +36,28 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/5f/a0/d9ef19f780f319c21ee90ecfef4431cbeeca95bec7f14071785c17b6029b/accelerate-1.10.1-py3-none-any.whl", hash = "sha256:3621cff60b9a27ce798857ece05e2b9f56fcc71631cfb31ccf71f0359c311f11", size = 374909, upload-time = "2025-08-25T13:57:04.55Z" }, ] +[[package]] +name = "ai2-olmo-core" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "bettermap" }, + { name = "cached-path" }, + { name = "importlib-resources" }, + { name = "numpy" }, + { name = "omegaconf" }, + { name = "packaging" }, + { name = "requests" }, + { name = "rich" }, + { name = "safetensors" }, + { name = "torch", version = "2.8.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'darwin'" }, + { name = "torch", version = "2.8.0+cu128", source = { registry = "https://download.pytorch.org/whl/cu128" }, marker = "sys_platform != 'darwin'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/68/f8/0a55822e471a1143fc4e55dbe6995259141260ed9c460c7eac448e9e9acd/ai2_olmo_core-2.3.0.tar.gz", hash = "sha256:7745fea1268cf0d882d28c25fbbfbedc969e2f9bf4f187d8c042105429d0dff7", size = 345084, upload-time = "2025-10-17T16:22:04.579Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7d/d2/353853a4de4ccf209dd04d3ceb28e2d8ce11c06816a2517eb6b412524294/ai2_olmo_core-2.3.0-py3-none-any.whl", hash = "sha256:7b22d09aaaf8e49000c808833b377b7cef774f10e93114fb3c6e61b74cb75df8", size = 404339, upload-time = "2025-10-17T16:22:02.903Z" }, +] + [[package]] name = "aiohappyeyeballs" version = "2.6.1" @@ -192,6 +214,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/58/e9/40dddcd8b77a7bed3ce154f8c7a87c35982650367576d329fb16dfb9d167/beaker_py-2.5.1-py3-none-any.whl", hash = "sha256:e160e1e5d1b2b4a868dc9557ce9076b2ff79643276eb8a000698181db5c7615e", size = 106856, upload-time = "2025-10-14T20:28:56.513Z" }, ] +[[package]] +name = "bettermap" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "dill" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/80/b4/1d74b7740723c1b85f3ae15d7b8d4a3d869f614fb1aa1982ed0055daf0ba/bettermap-1.3.1.tar.gz", hash = "sha256:e25cdaf85c1190eb84e7b1d462fc7ba20c85121d6a6e49178c63491929f6e152", size = 7602, upload-time = "2023-01-05T18:55:08.801Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a1/8d/84c67a7245e018111d1bcd0e253b37df813ac5d4404716dff43d76dd923e/bettermap-1.3.1-py3-none-any.whl", hash = "sha256:eaf5190cb3f1eadafdbbfef30f0379f9a80a2be93085c5acdfb55e37344305a6", size = 7690, upload-time = "2023-01-05T18:55:07.189Z" }, +] + [[package]] name = "bitsandbytes" version = "0.48.1" @@ -227,6 +261,52 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/4d/42/bbd02647169e3fbed27558555653ac2578c6f17ccacf7d1956c58ef1d214/blake3-1.0.8-cp312-cp312-win_amd64.whl", hash = "sha256:6a6eafc29e4f478d365a87d2f25782a521870c8514bb43734ac85ae9be71caf7", size = 215704, upload-time = "2025-10-14T06:46:02.79Z" }, ] +[[package]] +name = "boto3" +version = "1.40.66" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "botocore" }, + { name = "jmespath" }, + { name = "s3transfer" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9a/95/db1f23bbc5cf1a9b66cb1828a0940305ea300162ae12c55522c738ab6f0e/boto3-1.40.66.tar.gz", hash = "sha256:f2038d9bac5154da7390c29bfd013546ac96609e7ce5a7f3cb6f99412be3f4c0", size = 111564, upload-time = "2025-11-04T20:28:59.274Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bd/c2/3097e2492931b8fdcab47217b917c7964dbc8bfce31f89ace49568ed47f8/boto3-1.40.66-py3-none-any.whl", hash = "sha256:ee4fe21c5301cc0e11cc11a53e71e5ddd82d5fae42b10fa8e5403f3aa06434e3", size = 139361, upload-time = "2025-11-04T20:28:57.146Z" }, +] + +[[package]] +name = "botocore" +version = "1.40.66" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "jmespath" }, + { name = "python-dateutil" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c3/f3/5dae6e3b06493f2ac769c6764543b84fa50a8de3fec1e33252271166b394/botocore-1.40.66.tar.gz", hash = "sha256:e49a55ad54426c4ea853a59ff9d8243023a90c935782d4c287e9b3424883c3fa", size = 14411853, upload-time = "2025-11-04T20:28:48.07Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9a/48/43f9335e28351f35a939dce366a3943296f381ecd4660bd1c8d2bb8f3006/botocore-1.40.66-py3-none-any.whl", hash = "sha256:98d5766e17e72110b1d08ab510a8475a6597c59d9560235e2d28ae1a4b043b92", size = 14076509, upload-time = "2025-11-04T20:28:44.233Z" }, +] + +[[package]] +name = "cached-path" +version = "1.8.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "boto3" }, + { name = "filelock" }, + { name = "google-cloud-storage" }, + { name = "huggingface-hub" }, + { name = "packaging" }, + { name = "requests" }, + { name = "rich" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/36/6d/9e2a5983702e411097f39fa0040376fb1abd016605e9faa0db3ba847f7d9/cached_path-1.8.0.tar.gz", hash = "sha256:265adb13c8f2c8ec14219029e770475a1cf886eeeeec87c45195fd8718af2652", size = 33131, upload-time = "2025-09-30T17:20:43.789Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d0/0c/adf5acf2dad49f98f7a8869b0edc5b4d87ffac5c060fd2f357985e682dba/cached_path-1.8.0-py3-none-any.whl", hash = "sha256:e24aefa67e41722274e1ecac8453d0d908a6eabdb02cb9fafe1a99520ed1a453", size = 37786, upload-time = "2025-09-30T17:20:42.757Z" }, +] + [[package]] name = "cachetools" version = "6.2.1" @@ -802,6 +882,36 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/be/a4/7319a2a8add4cc352be9e3efeff5e2aacee917c85ca2fa1647e29089983c/google_auth-2.41.1-py2.py3-none-any.whl", hash = "sha256:754843be95575b9a19c604a848a41be03f7f2afd8c019f716dc1f51ee41c639d", size = 221302, upload-time = "2025-09-30T22:51:24.212Z" }, ] +[[package]] +name = "google-cloud-core" +version = "2.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "google-api-core" }, + { name = "google-auth" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a6/03/ef0bc99d0e0faf4fdbe67ac445e18cdaa74824fd93cd069e7bb6548cb52d/google_cloud_core-2.5.0.tar.gz", hash = "sha256:7c1b7ef5c92311717bd05301aa1a91ffbc565673d3b0b4163a52d8413a186963", size = 36027, upload-time = "2025-10-29T23:17:39.513Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/89/20/bfa472e327c8edee00f04beecc80baeddd2ab33ee0e86fd7654da49d45e9/google_cloud_core-2.5.0-py3-none-any.whl", hash = "sha256:67d977b41ae6c7211ee830c7912e41003ea8194bff15ae7d72fd6f51e57acabc", size = 29469, upload-time = "2025-10-29T23:17:38.548Z" }, +] + +[[package]] +name = "google-cloud-storage" +version = "2.19.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "google-api-core" }, + { name = "google-auth" }, + { name = "google-cloud-core" }, + { name = "google-crc32c" }, + { name = "google-resumable-media" }, + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/36/76/4d965702e96bb67976e755bed9828fa50306dca003dbee08b67f41dd265e/google_cloud_storage-2.19.0.tar.gz", hash = "sha256:cd05e9e7191ba6cb68934d8eb76054d9be4562aa89dbc4236feee4d7d51342b2", size = 5535488, upload-time = "2024-12-05T01:35:06.49Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d5/94/6db383d8ee1adf45dc6c73477152b82731fa4c4a46d9c1932cc8757e0fd4/google_cloud_storage-2.19.0-py2.py3-none-any.whl", hash = "sha256:aeb971b5c29cf8ab98445082cbfe7b161a1f48ed275822f59ed3f1524ea54fba", size = 131787, upload-time = "2024-12-05T01:35:04.736Z" }, +] + [[package]] name = "google-crc32c" version = "1.7.1" @@ -815,6 +925,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0f/d6/77060dbd140c624e42ae3ece3df53b9d811000729a5c821b9fd671ceaac6/google_crc32c-1.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:b7491bdc0c7564fcf48c0179d2048ab2f7c7ba36b84ccd3a3e1c3f7a72d3bba6", size = 33477, upload-time = "2025-03-26T14:29:10.94Z" }, ] +[[package]] +name = "google-resumable-media" +version = "2.7.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "google-crc32c" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/58/5a/0efdc02665dca14e0837b62c8a1a93132c264bd02054a15abb2218afe0ae/google_resumable_media-2.7.2.tar.gz", hash = "sha256:5280aed4629f2b60b847b0d42f9857fd4935c11af266744df33d8074cae92fe0", size = 2163099, upload-time = "2024-08-07T22:20:38.555Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/35/b8d3baf8c46695858cb9d8835a53baa1eeb9906ddaf2f728a5f5b640fd1e/google_resumable_media-2.7.2-py2.py3-none-any.whl", hash = "sha256:3ce7551e9fe6d99e9a126101d2536612bb73486721951e9562fee0f90c6ababa", size = 81251, upload-time = "2024-08-07T22:20:36.409Z" }, +] + [[package]] name = "googleapis-common-protos" version = "1.70.0" @@ -994,6 +1116,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/20/b0/36bd937216ec521246249be3bf9855081de4c5e06a0c9b4219dbeda50373/importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd", size = 27656, upload-time = "2025-04-27T15:29:00.214Z" }, ] +[[package]] +name = "importlib-resources" +version = "6.5.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cf/8c/f834fbf984f691b4f7ff60f50b514cc3de5cc08abfc3295564dd89c5e2e7/importlib_resources-6.5.2.tar.gz", hash = "sha256:185f87adef5bcc288449d98fb4fba07cea78bc036455dd44c5fc4a2fe78fed2c", size = 44693, upload-time = "2025-01-03T18:51:56.698Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a4/ed/1f1afb2e9e7f38a545d628f864d562a5ae64fe6f7a10e28ffb9b185b4e89/importlib_resources-6.5.2-py3-none-any.whl", hash = "sha256:789cfdc3ed28c78b67a06acb8126751ced69a3d5f79c095a98298cd8a760ccec", size = 37461, upload-time = "2025-01-03T18:51:54.306Z" }, +] + [[package]] name = "iniconfig" version = "2.1.0" @@ -1044,6 +1175,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ed/42/5823ec2b1469395a160b4bf5f14326b4a098f3b6898fbd327366789fa5d3/jiter-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:29fff31190ab3a26de026da2f187814f4b9c6695361e20a9ac2123e4d4378a4c", size = 203520, upload-time = "2025-09-15T09:19:41.798Z" }, ] +[[package]] +name = "jmespath" +version = "1.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/00/2a/e867e8531cf3e36b41201936b7fa7ba7b5702dbef42922193f05c8976cd6/jmespath-1.0.1.tar.gz", hash = "sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe", size = 25843, upload-time = "2022-06-17T18:00:12.224Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/31/b4/b9b800c45527aadd64d5b442f9b932b00648617eb5d63d2c7a6587b7cafc/jmespath-1.0.1-py3-none-any.whl", hash = "sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980", size = 20256, upload-time = "2022-06-17T18:00:10.251Z" }, +] + [[package]] name = "joblib" version = "1.5.2" @@ -1745,12 +1885,26 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0e/b1/ed611dd58dec3a3a54a410fbf3c57511b76cef0adc5f03e6448b0749c514/nvitop-1.5.3-py3-none-any.whl", hash = "sha256:5a58c8aea1a021ab0d3c4f1ceffca9335d82326ad7fbe0c6cd9d1f7b955777a5", size = 213939, upload-time = "2025-08-16T06:18:39.478Z" }, ] +[[package]] +name = "omegaconf" +version = "2.0.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyyaml" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/87/d4/ef79d003e6c471ba95fdcddd58f67532d9c39b5fcf420aea199f3cc164e1/omegaconf-2.0.6.tar.gz", hash = "sha256:92ca535a788d21651bf4c2eaf5c1ca4c7a8003b2dab4a87cbb09109784268806", size = 83046, upload-time = "2021-01-19T22:10:54.523Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d0/eb/9d63ce09dd8aa85767c65668d5414958ea29648a0eec80a4a7d311ec2684/omegaconf-2.0.6-py3-none-any.whl", hash = "sha256:9e349fd76819b95b47aa628edea1ff83fed5b25108608abdd6c7fdca188e302a", size = 36834, upload-time = "2021-01-19T22:10:53.31Z" }, +] + [[package]] name = "open-instruct" version = "0.1.0" source = { editable = "." } dependencies = [ { name = "accelerate" }, + { name = "ai2-olmo-core" }, { name = "antlr4-python3-runtime" }, { name = "bitsandbytes", marker = "sys_platform != 'darwin'" }, { name = "datasets" }, @@ -1800,6 +1954,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "accelerate", specifier = ">=1.10.1" }, + { name = "ai2-olmo-core", specifier = "==2.3.0" }, { name = "antlr4-python3-runtime", specifier = "==4.11" }, { name = "bitsandbytes", marker = "sys_platform != 'darwin'", specifier = ">=0.44.1" }, { name = "datasets", specifier = ">=4.0.0" }, @@ -2634,15 +2789,15 @@ wheels = [ [[package]] name = "rich" -version = "14.2.0" +version = "13.9.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "markdown-it-py" }, { name = "pygments" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/fb/d2/8920e102050a0de7bfabeb4c4614a49248cf8d5d7a8d01885fbb24dc767a/rich-14.2.0.tar.gz", hash = "sha256:73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4", size = 219990, upload-time = "2025-10-09T14:16:53.064Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ab/3a/0316b28d0761c6734d6bc14e770d85506c986c85ffb239e688eeaab2c2bc/rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098", size = 223149, upload-time = "2024-11-01T16:43:57.873Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/25/7a/b0178788f8dc6cafce37a212c99565fa1fe7872c70c6c9c1e1a372d9d88f/rich-14.2.0-py3-none-any.whl", hash = "sha256:76bc51fe2e57d2b1be1f96c524b890b816e334ab4c1e45888799bfaab0021edd", size = 243393, upload-time = "2025-10-09T14:16:51.245Z" }, + { url = "https://files.pythonhosted.org/packages/19/71/39c7c0d87f8d4e6c020a393182060eaefeeae6c01dab6a84ec346f2567df/rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90", size = 242424, upload-time = "2024-11-01T16:43:55.817Z" }, ] [[package]] @@ -2743,6 +2898,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c6/2a/65880dfd0e13f7f13a775998f34703674a4554906167dce02daf7865b954/ruff-0.14.0-py3-none-win_arm64.whl", hash = "sha256:f42c9495f5c13ff841b1da4cb3c2a42075409592825dada7c5885c2c844ac730", size = 12565142, upload-time = "2025-10-07T18:21:53.577Z" }, ] +[[package]] +name = "s3transfer" +version = "0.14.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "botocore" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/62/74/8d69dcb7a9efe8baa2046891735e5dfe433ad558ae23d9e3c14c633d1d58/s3transfer-0.14.0.tar.gz", hash = "sha256:eff12264e7c8b4985074ccce27a3b38a485bb7f7422cc8046fee9be4983e4125", size = 151547, upload-time = "2025-09-09T19:23:31.089Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/48/f0/ae7ca09223a81a1d890b2557186ea015f6e0502e9b8cb8e1813f1d8cfa4e/s3transfer-0.14.0-py3-none-any.whl", hash = "sha256:ea3b790c7077558ed1f02a3072fb3cb992bbbd253392f4b6e9e8976941c7d456", size = 85712, upload-time = "2025-09-09T19:23:30.041Z" }, +] + [[package]] name = "safetensors" version = "0.6.2"