3

Why is the default not optimize=True or one of the specific optimization options?

I'm asking this because as a user of course I want the most optimal computation by default.

  • This feature and parameter has been changing over the course of several versions. I expect you can find discussion of it on github. Last I looked `True` requires some added upfront analysis that isn't always cost effective. – hpaulj Aug 02 '21 at 16:02
  • Here are more details on optimization of einsum and contractions https://optimized-einsum.readthedocs.io/en/stable/ – sehan2 Aug 02 '21 at 16:06
  • AFAIK, the optimization take some time so it is only interesting to use it when the computation is expected to take a while. – Jérôme Richard Aug 02 '21 at 16:12

1 Answers1

1

In the docs of the numpy.einsum (which may be found here) it says that for using optimization may increase calculation of contractions with >3 elements. The speed improvement thought, comes in an expanse of memory usage, which will be used during the computation.

So basically it's left for the consideration of the user to decide if he has a sufficient memory footprint to use optimization, and to guarantee that the method will run on most of the devices, which may lack the necessary memory resources.

Cheers.

Michael
  • 2,167
  • 5
  • 23
  • 38