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

RVP: Replace staturating multiply-accumulate with non-saturating one to match CMSIS-NN #46

Open
PhilippvK opened this issue Jun 27, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed packed

Comments

@PhilippvK
Copy link
Member

PhilippvK commented Jun 27, 2024

We use __rv_kmada all over the place for MAC operations. KMADA is a saturating instruction, aka it prevents accumulator overflows.

It turns out that ARM's CMSIS-NN actually uses SMLAD which is a non-saturating (aka. warping) Multiply-Add. To bit bit-accurate in edge cases where an overflow might occur, we should replace the __rv_kmada with __rv_kmda? (Need to double check this!).

However prio is pretty low since we are implementing the outdated RVP draft anyways. The newer draft has dropped saturating accumulating instructions completely (see [email protected]), hence we would have to replace them anyways when migrating to the newer spec (e.g. make use of PM2ADDA.H).

@PhilippvK PhilippvK added bug Something isn't working help wanted Extra attention is needed packed labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed packed
Projects
None yet
Development

No branches or pull requests

1 participant