Skip to content

BUG: Fix FP overflow error in division when the divisor is scalar#25191

Merged
charris merged 2 commits intonumpy:maintenance/1.26.xfrom
charris:backport-25129
Nov 19, 2023
Merged

BUG: Fix FP overflow error in division when the divisor is scalar#25191
charris merged 2 commits intonumpy:maintenance/1.26.xfrom
charris:backport-25129

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented Nov 19, 2023

Backport of #25129.

The bug occurred when SIMD partial load was involved,
due to filling remaining lanes of the dividend vector
with ones, which leads to raised overflow warnings
when the divisor is denormal.

This patch replaces the remaining lanes with nans rather
than ones to fix this issue.

closes #25097

@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs component: SIMD Issues in SIMD (fast instruction sets) code or machinery labels Nov 19, 2023
@charris charris added this to the 1.26.3 release milestone Nov 19, 2023
  The bug occurred when SIMD partial load was involved,
  due to filling remaining lanes of the dividend vector
  with ones, which leads to raised overflow warnings
  when the divisor is denormal.

  This patch replaces the remaining lanes with nans rather
  than ones to fix this issue.
  The decision is based on the lack of native SIMD support for
  this operation in the armhf architecture, and the associated challenges
  in performance and evaluate the benefits of emulated SIMD intrinsic versus
  native scalar division.
@charris charris merged commit 9d49d1b into numpy:maintenance/1.26.x Nov 19, 2023
@charris charris deleted the backport-25129 branch November 19, 2023 22:17
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 component: SIMD Issues in SIMD (fast instruction sets) code or machinery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants