Add an api to clear counter and metrics - #4109
Merged
Merged
Conversation
Collaborator
Author
|
I think I will have better luck to put this test in a separate file. It is a bad idea to clear all metrics for the |
alanwaketan
added a commit
to pytorch/pytorch
that referenced
this pull request
Nov 23, 2022
Summary: This change allow MetricsArena to ResetMetrics too. And then rename Reset to ResetCounters given that's what it does for real. This matches pytorch/xla#4109. Test Plan: CI.
alanwaketan
added a commit
to pytorch/pytorch
that referenced
this pull request
Nov 24, 2022
Summary: This change allow MetricsArena to ResetMetrics too. And then rename Reset to ResetCounters given that's what it does for real. This matches pytorch/xla#4109. Test Plan: CI.
alanwaketan
added a commit
to pytorch/pytorch
that referenced
this pull request
Nov 24, 2022
Summary: This change allow MetricsArena to ResetMetrics too. And then rename Reset to ResetCounters given that's what it does for real. This matches pytorch/xla#4109. Test Plan: CI.
alanwaketan
added a commit
to pytorch/pytorch
that referenced
this pull request
Nov 28, 2022
Summary: This change allow MetricsArena to ResetMetrics too. And then rename Reset to ResetCounters given that's what it does for real. This matches pytorch/xla#4109. Test Plan: CI.
pytorchmergebot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Nov 28, 2022
Summary: This change allow MetricsArena to ResetMetrics too. And then rename Reset to ResetCounters given that's what it does for real. This matches pytorch/xla#4109, and is paired with pytorch/xla#4245. Test Plan: CI. Pull Request resolved: #89606 Approved by: https://github.com/JackCaoG
kulinseth
pushed a commit
to kulinseth/pytorch
that referenced
this pull request
Dec 10, 2022
Summary: This change allow MetricsArena to ResetMetrics too. And then rename Reset to ResetCounters given that's what it does for real. This matches pytorch/xla#4109, and is paired with pytorch/xla#4245. Test Plan: CI. Pull Request resolved: pytorch#89606 Approved by: https://github.com/JackCaoG
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 25, 2026
Summary: This change allow MetricsArena to ResetMetrics too. And then rename Reset to ResetCounters given that's what it does for real. This matches pytorch/xla#4109, and is paired with pytorch/xla#4245. Test Plan: CI. Pull Request resolved: pytorch#89606 Approved by: https://github.com/JackCaoG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream version at https://github.com/pytorch/pytorch/blob/d9ff56ccc03cd5c2f95112ef3ec2316557f5699c/torch/csrc/lazy/core/metrics.h#L92 actually reset the counter instead of clearing it.
However I found it is more intuitive to clear the counters and there is no way to resert metrics(metrics can not be empty). I think I will submit a pr to update upstream later.