question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: ppc64le uses double-double for np.float128, routines need adjustment

See original GitHub issue

EDIT: TL;DR: the initial problem description below results from np.float128 being a double-double and the manylinux2014 image using glibc2.17, which blacklists some glibc trig functions triggering use of our replacements which are 80-bit double specific

Original issue report:

On some systems, LDBL_EPSILON, which is defined as a number that fits (1.0L + LDBL_EPSILON) != 1.0L && (1.0L + LDBL_EPSILON/2) == 1.0L, is 0. This causes problems in complex math routines, especially when calculating the recipricol as const npy_longdouble RECIP_EPSILON = 1.0L / LDBL_EPSILON;

I discovered this when running -mfull tests on ppc64le. I got an overflow warning when calling np.arcsinh, and debugging led to the conclusion that LDBL_EPSILON is 0.

One possible mitigation is to add RECIP_EPSILON to the pre-calculated values on the line above it, but that presumes that the internal representation of longdouble, which wikipedia says may be problematic. On the other hand, all the values in these calculations seem to presume a X86 80-bit long double.

Thoughts?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
charriscommented, Mar 16, 2020

I am not quite remember the story behind the new getlimits.py definitions

We needed to fix it in order to support PPC. It used to be computed but didn’t work because the computation assumed the usual mantissa/exponent representation. The number used was recommended somewhere (IBM?). @matthew-brett was responsible for the actual work in #8504.

What is long double on those machines to begin with?

IBM DoubleDouble, or should be.

0reactions
Flamefirecommented, Aug 4, 2022

This is still an issue (numpy 1.22.3)

Read more comments on GitHub >

github_iconTop Results From Across the Web

99708 – __SIZEOF_FLOAT128__ not defined on ...
No, far from it. E.g. on linux -mlong-double-128 -mabi=ieeelongdouble -mno-float128 means that __ieee128 works, long double works too and ...
Read more >
ppc64le: Invalid IFUNC resolver from libgcc calls getauxval ...
The crash seems to happen with --enable-bind-now only and is at the last line of the disassembly (from libc.so.6).
Read more >
Cannot use 128bit float in Python on 64bit architecture
I've a 64bit architecture and working with numpy.float64 is just fine. But I cannot use np.float128 ? np.array([1,1, ...
Read more >
Untitled
Note that you normally wouldn't need to install this package separately. It is a dependency of qemu-system-ppc64. CentOS Buildsys <bugs@centos.org> ...
Read more >
https://src.fedoraproject.org/rpms/glibc/raw/f33/f...
One problem is you can't have "no" locales installed, # in that case we offer ... developing programs which use the standard C...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found