From c6c10a521febf149452fe6d903d7001f1629583d Mon Sep 17 00:00:00 2001 From: Valentin Rigal Date: Thu, 23 May 2024 19:00:14 +0200 Subject: [PATCH] Avoid publishing experiment config when W&B publication is disabled (#627) * Avoid publishing experiment config when W&B publication is disabled * TRASHME Reproduce issue with train-backwards * Revert "TRASHME Reproduce issue with train-backwards" This reverts commit ad2b7a73e5583314eb13d6b34386fc5d52c1fc40. --- .../translations_parser/cli/taskcluster.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tracking/translations_parser/cli/taskcluster.py b/tracking/translations_parser/cli/taskcluster.py index ec2e2e453..8f344f449 100644 --- a/tracking/translations_parser/cli/taskcluster.py +++ b/tracking/translations_parser/cli/taskcluster.py @@ -64,7 +64,10 @@ def get_args() -> argparse.Namespace: ) parser.add_argument( "--publish-group-logs", - help=("Enable publishing a group_logs fake run with the experiment configuration."), + help=( + "Enable publishing a group_logs fake run with the experiment configuration." + "This option requires W&B publication to be enabled, otherwise it will be ignored." + ), action="store_true", default=False, ) @@ -105,12 +108,13 @@ def boot() -> None: ) if wandb_publisher: publishers.append(wandb_publisher) + elif args.publish_group_logs: + logger.warning( + "Ignoring --publish-group-logs option as Weight & Biases publication is disabled." + ) - # Use log filtering when using non-stream (for uploading past experiments) - log_filter = taskcluster_log_filter if not args.from_stream else None - - # publish the config fist - if args.publish_group_logs: + # Publish experiment configuration before parsing the training logs + if wandb_publisher and args.publish_group_logs: logger.info("Publishing experiment config to a 'group_logs' fake run.") # Retrieve experiment configuration from the task group task_id = os.environ.get("TASK_ID") @@ -124,6 +128,8 @@ def boot() -> None: config = task_group.get("extra", {}).get("action", {}).get("context", {}).get("input") publish_group_logs_from_tasks(config=config) + # Use log filtering when using non-stream (for uploading past experiments) + log_filter = taskcluster_log_filter if not args.from_stream else None parser = TrainingParser( lines, publishers=publishers,