-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Update'unit_batch_dynamic_prepacked' tests to use ASSERT_NEAR instead of ASSERT_EQ (#157860) #157861
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/157861
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit d4f38ab with merge base 86251ef ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D77911682 |
Please update the summary. Original code wasnt checking for absolute equivalence. It was checking for 4 ULPs but didnt allow for any way change the ulp. Your change enables the vheck for 3 ulps |
… of ASSERT_EQ (pytorch#157861) Summary: Replaced ASSERT_FLOAT_EQ which defaults to fixed kMaxUlps ( = 4-ULP , See gtest-internal.h) with ASSERT_NEAR which lets us set epsilon to 1e-3, (approximately 3 ULPs). This allows for slightly stricter and tunable comparison. Test Plan: **Before Fix** ✗ Fail: qnnpack:pytorch_qnnpack_testApple - FULLY_CONNECTED_SPARSE_OP_8x1/unit_batch_dynamic_prepacked (0.0s) 'Expected equality of these values: output_dynamic[i * outputChannels() + c] Which is: 9.9160004 accumulators_float[i * outputChannels() + c] Which is: 9.9159956 at 0, 17: reference = 9.9159955978393555, optimized = 9.9160003662109375 ------------------------------ **After Fix** Everything passes Rollback Plan: Differential Revision: D77911682
This pull request was exported from Phabricator. Differential Revision: D77911682 |
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
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.
Sure, but that's a very strange change to be frank. Who relies on qnnpack now?
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
i dont think anyone except some unittest. well i will have to eat my work, some model in some dark corner still might be |
Summary:
Replaced ASSERT_FLOAT_EQ which defaults to fixed kMaxUlps ( = 4-ULP , See gtest-internal.h) with ASSERT_NEAR which lets us set epsilon to 1e-3, (approximately 3 ULPs). This allows for slightly stricter and tunable comparison.
Test Plan:
Before Fix
✗ Fail:
qnnpack:pytorch_qnnpack_testApple - FULLY_CONNECTED_SPARSE_OP_8x1/unit_batch_dynamic_prepacked (0.0s)
'Expected equality of these values:
output_dynamic[i * outputChannels() + c]
Which is: 9.9160004
accumulators_float[i * outputChannels() + c]
Which is: 9.9159956
at 0, 17: reference = 9.9159955978393555, optimized = 9.9160003662109375
After Fix
Everything passes
Rollback Plan:
Differential Revision: D77911682
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168