Your message dated Tue, 15 Sep 2009 21:14:10 +0200
with message-id <[email protected]>
and subject line python-numeric removed from unstable, closing the outstanding 
bug reports
has caused the Debian Bug report #277061,
regarding python-numeric: FP underflow throws exception on i386.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
277061: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=277061
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-numeric
Version: 23.5-1
Severity: normal



-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.7
Locale: LANG=en_AU, LC_CTYPE=en_AU (ignored: LC_ALL set to C)

Versions of packages python-numeric depends on:
ii  python                        2.3.4-4    An interactive high-level object-o
ii  python2.3-numeric             23.5-1     Numerical (matrix-oriented) Mathem

-- no debconf information

Basic problem: in my environment, Numpy exp (at least) used to
silently underflow to zero. Currently, however, executing the
following code

>>> import Numeric as N
>>> a = N.array([-1700.])
>>> N.exp(a)

yields the following:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
OverflowError: math range error

I've googled for this problem, and found that such behavior is not
uncommon with each platform's variations in libm.  Python by design
tries to silently underflow in this case with workarounds for
"underflow to zero" in it's source since 2.0 days (see Tim Peters'
thread starting at
http://mail.python.org/pipermail/python-dev/2000-October/009851.html
for a discussion of how compiling with -lieee seemed to affect the
results prior to the python source changes). Numpy, however, doesn't
have any way to deal with the problem and is seemingly at the mercy of
the libc6 implementation du jour. (See Konrad Hinsen's post at
http://aspn.activestate.com/ASPN/Mail/Message/numpy-discussion/586349
....)

I understand that Debian has multiple platforms, releases, versions of
libraries, compilers, et al. That implies that there is no (can not
be) one single fix for this "bug".

I guess what I'm really after is/are some binary-package-building-time
option(s) that allows people desperate enough to try and fix this with a
"boilerplate" set of levers that are known to work on some platforms. 

At the moment, I'm struggling to even find what the equivalent of
-lieee has metamorphosed into on i386/Sid. Once that is found, what is the
"Debian approved" way to hack such changes into debian/rules and/or
setup.py in such a fashion that future victims of this problem have a
chance of playing around in the effectively random configuration space
to solve their problem. 

Once those controls are in place, then we can contemplate baking a
test case like the above code into the python-numeric platform independent
acceptance tests. 

Incidentally, for the benefit of future Debian Numpy-heads reading
this tome, there's presently a slow workaround for exp in Fernando Perez'
IPython/numutils.py ... The code goes:


exp_safe_MIN = math.log(2.2250738585072014e-308)
exp_safe_MAX = 1.7976931348623157e+308

def exp_safe(x):
    """Compute exponentials which safely underflow to zero.

    Slow but convenient to use. Note that NumArray will introduce proper
    floating point exception handling with access to the underlying
    hardware."""

    if type(x) is ArrayType:
        return exp(clip(x,exp_safe_MIN,exp_safe_MAX))
    else:
        return math.exp(x)


Let us hope that Numarray gets IEEE 754 right, so that at least we'll
have some runtime control.

Best,
        Frank Horowitz


--- End Message ---
--- Begin Message --- python-numeric removed from unstable, closing the outstanding bug reports as won't fix.


--- End Message ---

Reply via email to