-
Notifications
You must be signed in to change notification settings - Fork 322
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
Math: Replace exp() function with more accurate and fast version #9786
Open
singalsu
wants to merge
1
commit into
thesofproject:main
Choose a base branch
from
singalsu:add_new_taylor_approx_exp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+533
−628
Conversation
This file contains 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
Collaborator
singalsu
commented
Jan 20, 2025
•
edited
Loading
edited
singalsu
force-pushed
the
add_new_taylor_approx_exp
branch
2 times, most recently
from
January 21, 2025 18:09
07c8627
to
31636d1
Compare
singalsu
force-pushed
the
add_new_taylor_approx_exp
branch
from
January 22, 2025 17:00
31636d1
to
929029f
Compare
singalsu
requested review from
lgirdwood,
plbossart,
mmaka1,
lbetlej,
dbaluta and
kv2019i
as code owners
January 23, 2025 09:24
singalsu
commented
Jan 23, 2025
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.
Please address checkpatch space preference.
Over all the implementation looks sound to me.
Thank you
Ah that, it's an issue in checkpatch. It doesn't understand numbers in exponential format, e.g. |
ShriramShastry
approved these changes
Jan 24, 2025
The function sofm_exp_int32() is replaced with new sofm_exp_approx() function. It's not a direct replacement so the name is changed. The input range changes from +/- 5 to +/- 8. The wrapper function sofm_exp_fixed() with input range -16 .. +7.6 is updated to use the new function with a simpler range reduction for large negative input values. All current exponent function usage in SOF components is for the wrapper function that remains compatible. The function sofm_db2lin_fixed() is updated to handle larger negative input decibels values made possible by the new more accurate exponent function. The accuracy in exponent function for input ranges from -8 to +8 or -16 to 7.6 depending on used exponent function improves from absolute error of 1 to 1000 ppm to constant less than 1 ppm. The cycles count for exponent function calculate decreases from about 369 max to 78 max on MTL platform for HiFi code version with -O2 or -O3 optimization. The generic C version on MTL platform is max 88 cycles. The DRC component is a heavy user of the exponent function. The saving in MTL build of DRC is 10.5 MCPS, it drops from 22.17 to 11.70 with profiler run: "scripts/sof-testbench-helper.sh -x -m drc -p profile.txt" The saving in MTL build of multiband DRC is 30.2 MCPS, it drops from 127.95 to 97.78 with profiler run: "scripts/sof-testbench-helper.sh -x -m drc_multiband -p profile.txt" This patch also updates the cmocka test. The test functions are changed due to changed function name, changed achievable accuracy. Also the random values test points vector is replaced fixed a fixed linearly spaced vector for repeatable test and risk for random failures. Signed-off-by: Shriram Shastry <[email protected]> Signed-off-by: Seppo Ingalsuo <[email protected]>
singalsu
force-pushed
the
add_new_taylor_approx_exp
branch
from
January 24, 2025 17:45
929029f
to
c6b4925
Compare
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.