Skip to content
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

Use absolute tolerance for sum_of_poly kernel #654

Merged
merged 1 commit into from
Oct 22, 2023

Conversation

argilo
Copy link
Member

@argilo argilo commented Oct 14, 2023

Fixes #650.

The "sum of poly" kernel output is the sum of many positive & negative values, and the final sum can end up being close to zero. This causes test failures, because the relative error becomes large when the sum is near zero. Here I've switched to an absolute tolerance. I tested the generic kernel against a double-precision implementation and found that the error can be as high as 120 (which isn't surprising, since 131071 * 5 = 655355 polynomial terms are summed), so I set the tolerance at 1000 to keep it a safe distance away.

Copy link
Contributor

@jdemel jdemel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

This issue is one of the reasons why we should think of a better test environment. However, implementing more manual tests is tedious work.

In any case, we should try to strike a balance between more automated tests and more tailoring where necessary.

My comments are obviously out of scope of this PR.

Copy link
Member

@marcusmueller marcusmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. This kernel is not the most precise anyway, I don't think anyone who needs precision would use it.

@jdemel jdemel merged commit 9f982ea into gnuradio:main Oct 22, 2023
@argilo argilo deleted the fix-flaky-sum-poly branch December 2, 2023 16:50
Alesha72003 pushed a commit to Alesha72003/volk that referenced this pull request May 15, 2024
Use absolute tolerance for sum_of_poly kernel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

qa_volk_32f_x3_sum_of_poly_32f sometimes fails on ARM
3 participants