From 16a933652149b06fcdd0c5096a3aba994b6f66ad Mon Sep 17 00:00:00 2001 From: Garrett Goon Date: Fri, 27 Jun 2025 16:52:57 -0400 Subject: [PATCH] rm run_name, add_seed_and_date_to_exp_name prev-branch: padding-free-squashing-3 --- open_instruct/finetune.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/open_instruct/finetune.py b/open_instruct/finetune.py index 587754a654..b0e398d7b9 100644 --- a/open_instruct/finetune.py +++ b/open_instruct/finetune.py @@ -87,8 +87,6 @@ class FlatArguments: exp_name: str = os.path.basename(__file__)[: -len(".py")] """The name of this experiment""" - run_name: Optional[str] = None - """A unique name of this run""" do_not_randomize_output_dir: bool = False """By default the output directory will be randomized""" model_name_or_path: Optional[str] = field( @@ -380,6 +378,7 @@ class FlatArguments: " Only for linear schedulers, currently." }, ) + add_seed_and_date_to_exp_name: bool = True def __post_init__(self): if self.reduce_loss not in ["mean", "sum"]: @@ -437,9 +436,13 @@ def main(args: FlatArguments, tc: TokenizerConfig): # ------------------------------------------------------------ # Set up runtime variables - args.run_name = f"{args.exp_name}__{args.seed}__{int(time.time())}" + + if args.add_seed_and_date_to_exp_name: + args.exp_name = f"{args.exp_name}__{args.seed}__{int(time.time())}" + else: + args.exp_name = args.exp_name if not args.do_not_randomize_output_dir: - args.output_dir = os.path.join(args.output_dir, args.run_name) + args.output_dir = os.path.join(args.output_dir, args.exp_name) logger.info("using the output directory: %s", args.output_dir) args.dataset_local_cache_dir = os.path.abspath(args.dataset_local_cache_dir) if is_beaker_job(): @@ -453,7 +456,7 @@ def main(args: FlatArguments, tc: TokenizerConfig): args.hf_entity = HfApi().whoami()["name"] args.hf_repo_id = f"{args.hf_entity}/{args.hf_repo_id}" if args.hf_repo_revision is None: - args.hf_repo_revision = args.run_name + args.hf_repo_revision = args.exp_name args.hf_repo_url = f"https://huggingface.co/{args.hf_repo_id}/tree/{args.hf_repo_revision}" if is_beaker_job(): beaker_config = maybe_get_beaker_config() @@ -477,7 +480,7 @@ def main(args: FlatArguments, tc: TokenizerConfig): experiment_config, init_kwargs={ "wandb": { - "name": args.run_name, + "name": args.exp_name, "entity": args.wandb_entity, "tags": [args.exp_name] + get_wandb_tags(), }