mpmath creates Memory Error on import
See original GitHub issueI wasn’t able to determine the reason, but it seems that when importing mpmath with gmp=6.2.0 it creates a Memory Error during this operation:
mpmath/mpmath/libmp/libelefun.py
# ~= next power of two + 20
cache_prec_steps = [22,22]
for k in xrange(1, bitcount(LOG_TAYLOR_PREC)+1):
cache_prec_steps += [min(2**k,LOG_TAYLOR_PREC)+20] * 2**(k-1)
When I downgraded gmp<=6.1.2.
mpmath imported successfully.
Stack trace is unavailable. If I am able to reproduce behavior I will attach.
python 3.7.6 gmpy2 2.1.0b1
Issue Analytics
- State:
- Created 4 years ago
- Comments:15
Top Results From Across the Web
Precision and representation issues - mpmath
This section gives an overview of arbitrary-precision binary floating-point arithmetic and some concepts from numerical analysis. The following concepts are ...
Read more >Python uses huge amount of RAM to import file - Stack Overflow
I have hit a snag when I increase the matrix size, which causes the exernal file ... from __future__ import division import mpmath...
Read more >Out of memory on big expressions · Issue #17609 - GitHub
For some particular expressions, SymPy eats my 512 GB of RAM, and ends up crashing ... from sympy.parsing.sympy_parser import parse_expr ...
Read more >MemoryError when importing a custom module
When I try to import the module through the UART REPL, I get the following error: Code: Select all MemoryError: memory allocation failed, ......
Read more >Utility functions — SymPy 0.7.4.1 documentation - omz:software
from mpmath import * >>> mp.dps = 15; mp.pretty = False ... Exact addition avoids cancellation errors, enforcing familiar laws of numbers such...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I can confirm that the 6.2.0 build 1 packages (conda-forge/linux-64::gmp-6.2.0-he1b5a44_1) give the expect results for the test program and the python test.
I can also confirm that this now works after updating to the latest version of gmp=6.2.0 gmp 6.2.0 he1b5a44_1 conda-forge
I was able to get it to work on two intel cpus: An old Intel® Xeon® CPU E5-2643 0 @ 3.30GHz And a newer Intel® Core™ i5-10210U CPU @ 1.60GHz
Thanks for the help in getting to the bottom of the issue.