[Numpy-discussion] Optimizing numpy's einsum expression (again)

Dave Hirschfeld dave.hirschfeld at gmail.com
Fri Jan 16 05:54:41 EST 2015


Daniel Smith <dgasmith <at> icloud.com> writes:

> 
> Hello everyone,I originally brought an optimized einsum routine 
forward a few weeks back that attempts to contract numpy arrays together 
in an optimal way. This can greatly reduce the scaling and overall cost 
of the einsum expression for the cost of a few intermediate arrays. The 
current version (and more details) can be found here:
> https://github.com/dgasmith/opt_einsum
> 
> I think this routine is close to a finalized version, but there are 
two problems which I would like the community to weigh in on:
> 
> Thank you for your time,
> 
> 
> -Daniel Smith
> 

I wasn't aware of this work, but it's very interesting to me as a user 
of einsum whose principal reason for doing so is speed. Even though I 
use it on largish arrays I'm only concerned with the performance as I'm 
on x64 with plenty of memory even were it to require temporaries 5x the 
original size.

I don't use einsum that much because I've noticed the performance can be 
very problem dependant so I've always profiled it to check. Hopefully 
this work will make the performance more consistent, allowing it to be 
used more generally throughout my code.

Thanks,
Dave


* An anecdotal example from a user only.





More information about the NumPy-Discussion mailing list