[Numpy-discussion] Disabling Extended Precision in NumPy (like -ffloat-store)
Charles R Harris
Fri Apr 23 12:13:06 CDT 2010
On Wed, Apr 21, 2010 at 9:04 PM, Adrien Guillon <firstname.lastname@example.org>wrote:
> Thank you for your questions... I'll answer them now.
> The motivation behind using Python and NumPy is to be able to "double
> check" that the numerical algorithms work okay in an
> engineer/scientist friendly language. We're basically prototyping a
> bunch of algorithms in Python, validating that they work right... so
> that when we move to the GPU we (hopefully) know that the algorithms
> are okay sequentially... any problems we come against therefore would
> have to be something else with the implementation (i.e. we don't want
> to be debugging too much at once). We are only targeting GPUs that
> support IEEE floating point... in theory the results should be similar
> on the GPU and CPU under certain assumptions (that the floating point
> is limited to single precision throughout... which Intel processors
> are a bit funny about).
> The main concern I have, and thus my motivation for wanting a
> restricted mode, is that parts of the algorithm may not work properly
> if done in extended precision. We are trying to ensure that
> theoretically there should be no problems, but realistically it's nice
> to have an extra layer of protection where we say "oh, wait, that's
> not right" when we look at the results.
> The idea here, is that if I can ensure there is never extended
> precision in the Python code... it should closely emulate the GPU
> which in fact has no extended precision in the hardware. Ordinarily,
> it's probably a silly thing to want to do (who would complain about
> extended precision for free)? But in this case I think it's the right
> Hope this clarifies the reasons and intentions.
Thanks for the explanation. You might be able to do something with the
variable precision float types in mpmath, they would allow you to select
whatever precision you want. If your algorithms aren't too complicated you
could then explore the effects of different precisions.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion