Skip to content

SIMD, BUG: fix reuses the previous values during the fallback to libc - #17763

Merged
charris merged 2 commits into
numpy:masterfrom
seiko2plus:issue_17761
Nov 14, 2020
Merged

charris merged 2 commits into
numpy:masterfrom
seiko2plus:issue_17761

Conversation

@seiko2plus

Copy link
Copy Markdown
Member

closes #17761

@charris charris added 00 - Bug 09 - Backport-Candidate PRs tagged should be backported component: SIMD Issues in SIMD (fast instruction sets) code or machinery labels Nov 12, 2020
@charris charris added this to the 1.19.5 release milestone Nov 12, 2020

@seberg seberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, not fluid with SIMD, but this looks good to me! Also good you noticed the sincos issue. I guess the last test could do an exact check, but probably no good reason either.

@mattip

mattip commented Nov 13, 2020

Copy link
Copy Markdown
Member

ping @r-devulap

@r-devulap

Copy link
Copy Markdown
Member

Wouldn't preventing the store from writing to these elements be a simpler and efficient fix? That is, change
_mm512_mask_storeu_pd(op, load_mask, res); to _mm512_mask_storeu_pd(op, or(glibc_mask, load_mask) , res); I think that might fix it or am I missing something?

@seiko2plus

Copy link
Copy Markdown
Member Author

@r-devulap,

I think that might fix it or am I missing something?

yes, sure it will fix it but I just tried to take advantage and slightly improve performance.

I removed unlikely hint to avoid flush the pipe and I added a constant hint
which leads to increase the performance in between 10 to 20% for mixed and out-ranged values.

@seiko2plus

seiko2plus commented Nov 14, 2020 •

Copy link
Copy Markdown
Member Author

actually using unlikely leads to a roughly 10% increase in performance for in-ranged values but it has a bad impact on
out-ranged values. I will update #17587 after this pr getting merged.

@charris
charris merged commit 0dfbc05 into numpy:master Nov 14, 2020
@charris

charris commented Nov 14, 2020

Copy link
Copy Markdown
Member

Thanks Sayed. I expect we will be tweaking the SIMD code going forward once it is all working.

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Nov 14, 2020
@r-devulap

Copy link
Copy Markdown
Member

actually using unlikely leads to a roughly 10% increase in performance for in-ranged values but it has a bad impact on
out-ranged values.

Very surprising to see any measurable difference with just the use of __builtin_expect .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug component: SIMD Issues in SIMD (fast instruction sets) code or machinery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Invalid value in inplace log

5 participants