Add centralized tolerance registry and integrate with Tester harness#20014
Open
RiyaP2508 wants to merge 1 commit into
Open
Add centralized tolerance registry and integrate with Tester harness#20014RiyaP2508 wants to merge 1 commit into
RiyaP2508 wants to merge 1 commit into
Conversation
Add a tolerance registry that documents per-backend numerical accuracy defaults extracted from a cross-backend audit of all ExecuTorch test files. Wire it into the Tester harness so backends that identify themselves via the new `backend` parameter get appropriate tolerance defaults automatically. New files: - backends/test/harness/tolerance.py: ToleranceConfig dataclass, BACKEND_TOLERANCES registry (15 backends), get_tolerance() lookup with fallback chain (dtype-specific → backend default → global default) - backends/test/harness/tests/test_tolerance.py: 37 unit tests Tester integration: - New optional `backend` param in Tester.__init__() - run_method_and_compare_outputs() consults registry when tolerances are not explicitly provided - Fully backward-compatible: no backend set = same defaults as before (atol=1e-3, rtol=1e-3, qtol=0); explicit values always win Part of pytorch#19910. See pytorch#13347 for the broader tolerance strategy discussion.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20014
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Author
|
@pytorchbot label "release notes: none" |
This was referenced Jun 4, 2026
Author
|
cc: @gjcomer @kirklandsign @metascroy @digantdesai Would appreciate any feedback on the approach. Thank you! |
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.
Summary
Add a centralized tolerance registry for the backend test harness that documents per-backend numerical accuracy defaults and integrates with the
Testerclass.ToleranceConfigdataclass andget_tolerance()lookup API inbackends/test/harness/tolerance.pyTester.__init__()accepts optionalbackendparameterrun_method_and_compare_outputs()consults registry when tolerances aren't explicitly providedPart of #19910.
Test plan
backends/test/harness/tests/test_tolerance.py— all passing