[Numpy-discussion] New NEP: merging multiarray and umath

Julian Taylor jtaylor.debian at googlemail.com
Fri Mar 9 06:33:21 EST 2018


On 08.03.2018 17:20, Charles R Harris wrote:
> 
> 
> On Thu, Mar 8, 2018 at 2:52 AM, Gregor Thalhammer
> <gregor.thalhammer at gmail.com <mailto:gregor.thalhammer at gmail.com>> wrote:
> 
> 
>     Hi,
> 
>     long time ago I wrote a wrapper to to use optimised and parallelized
>     math functions from Intels vector math library 
>     geggo/uvml: Provide vectorized math function (MKL) for numpy
>     <https://github.com/geggo/uvml>
> 
>     I found it useful to inject (some of) the fast methods into numpy
>     via np.set_num_ops(), to gain more performance without changing my
>     programs.
> 
> 
> I think that was much of the original motivation for `set_num_ops` back
> in the Numeric days, where there was little commonality among platforms
> and getting hold of optimized libraries was very much an individual
> thing. The former cblas module, now merged with multiarray, was present
> for the same reasons.
>   
> 
> 
>     While this original project is outdated, I can imagine that a
>     centralised way to swap the implementation of math functions is
>     useful. Therefor I suggest to keep np.set_num_ops(), but admittedly
>     I do not understand all the technical implications of the proposed
>     change.
> 
> 
> I suppose we could set it up to detect and use an external library
> during compilation. The CBLAS implementations currently do that and
> should pick up the MKL version when available. Where are the MKL
> functions you used presented? That is an admittedly lower level
> interface, however.
> 
> Chuck



As the functions of the different libraries have vastly different
accuracies you want to be able to exchange numeric ops at runtime or at
least during load time (like our cblas) and not limit yourself one
compile time defined set of functions.
Keeping set_numeric_ops would be preferable to me.

Though I am not clear on why the two things are connected?
Why can't we keep set_numeric_ops and merge multiarray and umath into
one shared object?


More information about the NumPy-Discussion mailing list