Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of metrics deepcopy before computing the metrics #3180

Merged
merged 4 commits into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions composer/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2247,14 +2247,12 @@ def _ensure_metrics_device_and_dtype(
return metrics

def _compute_and_log_metrics(self, dataloader_label: str, metrics: Dict[str, Metric]):
"""Computes metrics, logs the results, and updates the state with the deep-copied metrics.
"""Computes metrics, logs the results, and updates the state with the metrics.

Args:
dataloader_label (str): The dataloader label.
metrics (Dict[str, Metric]): The metrics to compute.
"""
metrics = deepcopy(metrics)

# log computed metrics
computed_metrics = {}
for metric_name, metric in metrics.items():
Expand Down
Loading