You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do we currently have a mechanism to allow reducing multiple metrics objects out of the context of DDP? An example of use case is doing distributed evaluation using frameworks other than DDP, where each worker has a metric object that keep track of the state for the worker's shard of data: metrics = [metric_0, metric_1, metric_2, metric_3, ...]. To compute the final metric across the entire dataset, we need a mechanism to reduce the metrics. By looking at the torchmetrics/src/torchmetrics/metric.py, I see one potential solution:
metric_reduced = Metric()
for metric in metrics:
metric_reduced._reduce_states(metric.metric_state)
# Compute final metric
final_metric = metric_reduced.comput()
Is this a reasonable approach other than the fact that_reduced_state is meant to be private? Is there a better approach? Thanks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Do we currently have a mechanism to allow reducing multiple metrics objects out of the context of DDP? An example of use case is doing distributed evaluation using frameworks other than DDP, where each worker has a metric object that keep track of the state for the worker's shard of data:
metrics = [metric_0, metric_1, metric_2, metric_3, ...]
. To compute the final metric across the entire dataset, we need a mechanism to reduce the metrics. By looking at thetorchmetrics/src/torchmetrics/metric.py
, I see one potential solution:Is this a reasonable approach other than the fact that
_reduced_state
is meant to be private? Is there a better approach? Thanks.Beta Was this translation helpful? Give feedback.
All reactions