-
Notifications
You must be signed in to change notification settings - Fork 633
[Backend Tester] Add tensor error statistic reporting #12809
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
base: gh/GregoryComer/88/head
Are you sure you want to change the base?
Conversation
Stack from ghstack (oldest at bottom): |
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/12809
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ef7af5c with merge base 4fd2079 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -302,17 +303,15 @@ def run_method_and_compare_outputs( | |||
atol=1e-03, | |||
rtol=1e-03, | |||
qtol=0, | |||
statistics_callback: Callable[[ErrorStatistics], None] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not completely happy with the callback approach for exposing this, but I don't really have a better idea, since the tester relies on a builder-style pattern where it returns self to allow chaining. I'm open to suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just update the tester method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify what you're thinking? Are you meaning update the tester run_method_and_compare outputs to directly return the error stats and then update all of the callers to not use it in a chained fashion? Or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modify the existing method, keeping the outside behavior but also add def get_comparison_stats(self)
method on that stage or something?
Or if you want to pass a callback for flexibility that's also fine.
I'll add some tests for the error statistic calculation to this PR shortly. |
Report various error statistics for the test outputs, including SQNR, mean absolute error (MAE), and L2 norm. These are saved in the detail report per test case.
As an example, here is the output from Core ML running MobileNet V2 (roughly formatted from csv -> sheets -> markdown):
TODO: Round to a reasonable number of significant figures. (Or leave in full precision in the report?)