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

BUG: Fix float16 einsum fastpaths using wrong tempvar #20462

Merged
merged 2 commits into from Nov 26, 2021

Conversation

charris
Copy link
Member

@charris charris commented Nov 25, 2021

Backport of #20310.

Fix for gh-20305 @Qiyu8 maybe you know where to best add some tests? I was hoping to add some parametrization and be done with it, but didn't really find the right test to parametrize for float16 that would fail without the fixes.

EDIT: In case anyone ever stumbles on this. The previous tests probably did run all the code paths, the problem is the missing fractional part. Using the wrong tempvar here, meant the accumulation was done in (u)int16. Without a fractional part, that ends up with the correct result though.

This hopefully tests things well enough, at least some/most of the
paths get triggered and led to errors without the previous float16
typing fixes.

I manually confirmed that all paths that were *modified* in the
previous commit actually get hit with float16 specialized loops.

NOTE: This test may be a bit fragile with floating point roundoff
errors, and can in parts be relaxed if this happens.
@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Nov 25, 2021
@charris charris added this to the 1.21.5 release milestone Nov 25, 2021
@charris charris merged commit 884c6c8 into numpy:maintenance/1.21.x Nov 26, 2021
@charris charris deleted the backport-20310 branch November 26, 2021 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug 08 - Backport Used to tag backport PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants