remove check for main process for trackers initialization (#18706)
This commit is contained in:
@@ -414,14 +414,12 @@ def main():
|
|||||||
checkpointing_steps = None
|
checkpointing_steps = None
|
||||||
|
|
||||||
# We need to initialize the trackers we use, and also store our configuration.
|
# We need to initialize the trackers we use, and also store our configuration.
|
||||||
# We initialize the trackers only on main process because `accelerator.log`
|
# The trackers initializes automatically on the main process.
|
||||||
# only logs on main process and we don't want empty logs/runs on other processes.
|
|
||||||
if args.with_tracking:
|
if args.with_tracking:
|
||||||
if accelerator.is_main_process:
|
experiment_config = vars(args)
|
||||||
experiment_config = vars(args)
|
# TensorBoard cannot log Enums, need the raw value
|
||||||
# TensorBoard cannot log Enums, need the raw value
|
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
||||||
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
accelerator.init_trackers("image_classification_no_trainer", experiment_config)
|
||||||
accelerator.init_trackers("image_classification_no_trainer", experiment_config)
|
|
||||||
|
|
||||||
# Get the metric function
|
# Get the metric function
|
||||||
metric = evaluate.load("accuracy")
|
metric = evaluate.load("accuracy")
|
||||||
|
|||||||
@@ -516,14 +516,12 @@ def main():
|
|||||||
checkpointing_steps = None
|
checkpointing_steps = None
|
||||||
|
|
||||||
# We need to initialize the trackers we use, and also store our configuration.
|
# We need to initialize the trackers we use, and also store our configuration.
|
||||||
# We initialize the trackers only on main process because `accelerator.log`
|
# The trackers initializes automatically on the main process.
|
||||||
# only logs on main process and we don't want empty logs/runs on other processes.
|
|
||||||
if args.with_tracking:
|
if args.with_tracking:
|
||||||
if accelerator.is_main_process:
|
experiment_config = vars(args)
|
||||||
experiment_config = vars(args)
|
# TensorBoard cannot log Enums, need the raw value
|
||||||
# TensorBoard cannot log Enums, need the raw value
|
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
||||||
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
accelerator.init_trackers("clm_no_trainer", experiment_config)
|
||||||
accelerator.init_trackers("clm_no_trainer", experiment_config)
|
|
||||||
|
|
||||||
# Train!
|
# Train!
|
||||||
total_batch_size = args.per_device_train_batch_size * accelerator.num_processes * args.gradient_accumulation_steps
|
total_batch_size = args.per_device_train_batch_size * accelerator.num_processes * args.gradient_accumulation_steps
|
||||||
|
|||||||
@@ -560,14 +560,12 @@ def main():
|
|||||||
checkpointing_steps = None
|
checkpointing_steps = None
|
||||||
|
|
||||||
# We need to initialize the trackers we use, and also store our configuration.
|
# We need to initialize the trackers we use, and also store our configuration.
|
||||||
# We initialize the trackers only on main process because `accelerator.log`
|
# The trackers initializes automatically on the main process.
|
||||||
# only logs on main process and we don't want empty logs/runs on other processes.
|
|
||||||
if args.with_tracking:
|
if args.with_tracking:
|
||||||
if accelerator.is_main_process:
|
experiment_config = vars(args)
|
||||||
experiment_config = vars(args)
|
# TensorBoard cannot log Enums, need the raw value
|
||||||
# TensorBoard cannot log Enums, need the raw value
|
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
||||||
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
accelerator.init_trackers("mlm_no_trainer", experiment_config)
|
||||||
accelerator.init_trackers("mlm_no_trainer", experiment_config)
|
|
||||||
|
|
||||||
# Train!
|
# Train!
|
||||||
total_batch_size = args.per_device_train_batch_size * accelerator.num_processes * args.gradient_accumulation_steps
|
total_batch_size = args.per_device_train_batch_size * accelerator.num_processes * args.gradient_accumulation_steps
|
||||||
|
|||||||
@@ -513,14 +513,12 @@ def main():
|
|||||||
checkpointing_steps = None
|
checkpointing_steps = None
|
||||||
|
|
||||||
# We need to initialize the trackers we use, and also store our configuration.
|
# We need to initialize the trackers we use, and also store our configuration.
|
||||||
# We initialize the trackers only on main process because `accelerator.log`
|
# The trackers initializes automatically on the main process.
|
||||||
# only logs on main process and we don't want empty logs/runs on other processes.
|
|
||||||
if args.with_tracking:
|
if args.with_tracking:
|
||||||
if accelerator.is_main_process:
|
experiment_config = vars(args)
|
||||||
experiment_config = vars(args)
|
# TensorBoard cannot log Enums, need the raw value
|
||||||
# TensorBoard cannot log Enums, need the raw value
|
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
||||||
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
accelerator.init_trackers("swag_no_trainer", experiment_config)
|
||||||
accelerator.init_trackers("swag_no_trainer", experiment_config)
|
|
||||||
|
|
||||||
# Metrics
|
# Metrics
|
||||||
metric = evaluate.load("accuracy")
|
metric = evaluate.load("accuracy")
|
||||||
|
|||||||
@@ -787,14 +787,12 @@ def main():
|
|||||||
checkpointing_steps = None
|
checkpointing_steps = None
|
||||||
|
|
||||||
# We need to initialize the trackers we use, and also store our configuration.
|
# We need to initialize the trackers we use, and also store our configuration.
|
||||||
# We initialize the trackers only on main process because `accelerator.log`
|
# The trackers initializes automatically on the main process.
|
||||||
# only logs on main process and we don't want empty logs/runs on other processes.
|
|
||||||
if args.with_tracking:
|
if args.with_tracking:
|
||||||
if accelerator.is_main_process:
|
experiment_config = vars(args)
|
||||||
experiment_config = vars(args)
|
# TensorBoard cannot log Enums, need the raw value
|
||||||
# TensorBoard cannot log Enums, need the raw value
|
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
||||||
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
accelerator.init_trackers("qa_no_trainer", experiment_config)
|
||||||
accelerator.init_trackers("qa_no_trainer", experiment_config)
|
|
||||||
|
|
||||||
# Train!
|
# Train!
|
||||||
total_batch_size = args.per_device_train_batch_size * accelerator.num_processes * args.gradient_accumulation_steps
|
total_batch_size = args.per_device_train_batch_size * accelerator.num_processes * args.gradient_accumulation_steps
|
||||||
|
|||||||
@@ -512,14 +512,12 @@ def main():
|
|||||||
metric = evaluate.load("mean_iou")
|
metric = evaluate.load("mean_iou")
|
||||||
|
|
||||||
# We need to initialize the trackers we use, and also store our configuration.
|
# We need to initialize the trackers we use, and also store our configuration.
|
||||||
# We initialize the trackers only on main process because `accelerator.log`
|
# The trackers initializes automatically on the main process.
|
||||||
# only logs on main process and we don't want empty logs/runs on other processes.
|
|
||||||
if args.with_tracking:
|
if args.with_tracking:
|
||||||
if accelerator.is_main_process:
|
experiment_config = vars(args)
|
||||||
experiment_config = vars(args)
|
# TensorBoard cannot log Enums, need the raw value
|
||||||
# TensorBoard cannot log Enums, need the raw value
|
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
||||||
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
accelerator.init_trackers("semantic_segmentation_no_trainer", experiment_config)
|
||||||
accelerator.init_trackers("semantic_segmentation_no_trainer", experiment_config)
|
|
||||||
|
|
||||||
# Train!
|
# Train!
|
||||||
total_batch_size = args.per_device_train_batch_size * accelerator.num_processes * args.gradient_accumulation_steps
|
total_batch_size = args.per_device_train_batch_size * accelerator.num_processes * args.gradient_accumulation_steps
|
||||||
|
|||||||
@@ -581,14 +581,12 @@ def main():
|
|||||||
checkpointing_steps = None
|
checkpointing_steps = None
|
||||||
|
|
||||||
# We need to initialize the trackers we use, and also store our configuration.
|
# We need to initialize the trackers we use, and also store our configuration.
|
||||||
# We initialize the trackers only on main process because `accelerator.log`
|
# The trackers initializes automatically on the main process.
|
||||||
# only logs on main process and we don't want empty logs/runs on other processes.
|
|
||||||
if args.with_tracking:
|
if args.with_tracking:
|
||||||
if accelerator.is_main_process:
|
experiment_config = vars(args)
|
||||||
experiment_config = vars(args)
|
# TensorBoard cannot log Enums, need the raw value
|
||||||
# TensorBoard cannot log Enums, need the raw value
|
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
||||||
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
accelerator.init_trackers("summarization_no_trainer", experiment_config)
|
||||||
accelerator.init_trackers("summarization_no_trainer", experiment_config)
|
|
||||||
|
|
||||||
# Metric
|
# Metric
|
||||||
metric = evaluate.load("rouge")
|
metric = evaluate.load("rouge")
|
||||||
|
|||||||
@@ -459,14 +459,12 @@ def main():
|
|||||||
checkpointing_steps = None
|
checkpointing_steps = None
|
||||||
|
|
||||||
# We need to initialize the trackers we use, and also store our configuration.
|
# We need to initialize the trackers we use, and also store our configuration.
|
||||||
# We initialize the trackers only on main process because `accelerator.log`
|
# The trackers initializes automatically on the main process.
|
||||||
# only logs on main process and we don't want empty logs/runs on other processes.
|
|
||||||
if args.with_tracking:
|
if args.with_tracking:
|
||||||
if accelerator.is_main_process:
|
experiment_config = vars(args)
|
||||||
experiment_config = vars(args)
|
# TensorBoard cannot log Enums, need the raw value
|
||||||
# TensorBoard cannot log Enums, need the raw value
|
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
||||||
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
accelerator.init_trackers("glue_no_trainer", experiment_config)
|
||||||
accelerator.init_trackers("glue_no_trainer", experiment_config)
|
|
||||||
|
|
||||||
# Get the metric function
|
# Get the metric function
|
||||||
if args.task_name is not None:
|
if args.task_name is not None:
|
||||||
|
|||||||
@@ -574,14 +574,12 @@ def main():
|
|||||||
checkpointing_steps = None
|
checkpointing_steps = None
|
||||||
|
|
||||||
# We need to initialize the trackers we use, and also store our configuration.
|
# We need to initialize the trackers we use, and also store our configuration.
|
||||||
# We initialize the trackers only on main process because `accelerator.log`
|
# The trackers initializes automatically on the main process.
|
||||||
# only logs on main process and we don't want empty logs/runs on other processes.
|
|
||||||
if args.with_tracking:
|
if args.with_tracking:
|
||||||
if accelerator.is_main_process:
|
experiment_config = vars(args)
|
||||||
experiment_config = vars(args)
|
# TensorBoard cannot log Enums, need the raw value
|
||||||
# TensorBoard cannot log Enums, need the raw value
|
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
||||||
experiment_config["lr_scheduler_type"] = experiment_config["lr_scheduler_type"].value
|
accelerator.init_trackers("ner_no_trainer", experiment_config)
|
||||||
accelerator.init_trackers("ner_no_trainer", experiment_config)
|
|
||||||
|
|
||||||
# Metrics
|
# Metrics
|
||||||
metric = evaluate.load("seqeval")
|
metric = evaluate.load("seqeval")
|
||||||
|
|||||||
Reference in New Issue
Block a user