[Numpy-discussion] GSoC : Performance parity between numpy arrays and Python scalars

Arink Verma arinkverma at iitrpr.ac.in
Thu May 2 00:25:12 EDT 2013


@Raul
I will pull new version, and try to include that also.
What is wrong with macros for inline function?
Yes, time for ufunc is reduced to almost half, for lookup table, I
am generating key from argument type and returning
the appropriated value.[1]

@Chuck
Yes I did some profiling with oprofiler for "python -m timeit -n 1000000 -s
'import numpy as np;x = np.asarray(1.0)' 'x+x'". see data sheet.[2]

As every time a ufunc is invoked, the code has to check every single data
type possible (bool, int, double, etc) until if finds the best match for
the data that the operation is being performed on. In scalar, we can send
best match, from pre-populated table. At present the implementation is not
well-structured and support only addition for int+int and float+float. [1]

[1]
https://github.com/arinkverma/numpy/commit/e2d8de7e7b643c7a76ff92bc1219847f9328aad0
[2]
https://docs.google.com/spreadsheet/ccc?key=0AnPqyp8kuQw0dG1hdjZiazE2dGtTY1JXVGFsWEEzbXc#gid=0



On Thu, May 2, 2013 at 12:09 AM, Raul Cota <raul at virtualmaterials.com>wrote:

>
> It is great that you are looking into this !! We are currently running on
> a fork of numpy because we really need these performance improvements .
>
>
> I noticed that, as suggested, you took from the pull request I posted a
> while ago for the
> PyObject_GetAttrString
> PyObject_GetBuffer
>
> issues.
>
> ( https://github.com/raulcota/numpy )
>
>
> A couple of comments on that,
>
> - Seems like you did not grab the latest revisions of that code that I
> posted that fixes the style of the comments and 'attempts' to fix an issue
> reported about Python 3 . I say 'attempts' because I thought it was fixed
> but I someone mentioned this was not correct.
>
> - There was also some feedback from Nathaniel about not liking the macros
> and siding for inline functions. I have not gotten around to it, but it
> would be nice if you jump on that boat.
>
> On the has lookup table, haven't looked at the implementation but the
> speed up is remarkable.
>
>
> Cheers !
>
> Raul
>
>
>
> On 30/04/2013 8:26 PM, Arink Verma wrote:
>
>  Hi all!
> I have written my application[1] for *Performance parity between numpy
> arrays and Python scalars[2]. *It would be a great help if you view it.
> Does it look achievable and deliverable according to the project.
>
>  [1]
> http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/arinkverma/40001#
>  [2] http://projects.scipy.org/scipy/wiki/SummerofCodeIdeas
>
>
> --
> Arink
> Computer Science and Engineering
> Indian Institute of Technology Ropar
> www.arinkverma.in
>
>
> _______________________________________________
> NumPy-Discussion mailing listNumPy-Discussion at scipy.orghttp://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>


-- 
Arink
Computer Science and Engineering
Indian Institute of Technology Ropar
www.arinkverma.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130502/c60b417a/attachment.html>


More information about the NumPy-Discussion mailing list