From 02faa686363b0449a11071a0415dcfd06c85382c Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Sat, 1 Dec 2018 10:33:36 -0500 Subject: [PATCH] v2.3 patch notes (#76) * Docs: Adds v2.3 changelog * Cleanup: Minor imports and style --- docs/source/changelog.rst | 29 ++++++++++++++++++++++++++++- opt_einsum/backends/__init__.py | 3 +-- opt_einsum/helpers.py | 5 +++-- opt_einsum/tests/test_contract.py | 4 +--- opt_einsum/tests/test_input.py | 2 -- 5 files changed, 33 insertions(+), 10 deletions(-) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index fbfdf21..187cb82 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -1,7 +1,34 @@ Changelog ========= -2.2.0 / 2018-MM-DD +2.3.0 / 2018-12-01 +------------------ + +This release primarily focuses on expanding the suite of available path +technologies to provide better optimization characistics for 4-20 tensors while +decreasing the time to find paths for 50-200+ tensors. See `Path Overview `_ for more information. + +New Features +++++++++++++ +- (:pr:`60`) A new ``greedy`` implementation has been added which is up to two orders of magnitude faster for 200 tensors. +- (:pr:`73`) Adds a new ``branch`` path that uses ``greedy`` ideas to prune the ``optimal`` exploration space to provide a better path than ``greedy`` at sub ``optimal`` cost. +- (:pr:`73`) Adds a new ``auto`` keyword to the :func:`opt_einsum.contract` ``path`` option. This keyword automatically chooses the best path technology that takes under 1ms to execute. + +Enhancements +++++++++++++ +- (:pr:`61`) The :func:`opt_einsum.contract` ``path`` keyword has been changed to ``optimize`` to more closely match NumPy. ``path`` will be deprecated in the future. +- (:pr:`61`) The :func:`opt_einsum.contract_path` now returns a :func:`opt_einsum.contract.PathInfo` object that can be queried for the scaling, flops, and intermediates of the path. The print representation of this object is identical to before. +- (:pr:`61`) The default ``memory_limit`` is now unlimited by default based on community feedback. +- (:pr:`66`) The Torch backend will now use ``tensordot`` when using a version of Torch which includes this functionality. +- (:pr:`68`) Indices can now be any hashable object when provided in the `"Interleaved Input" `_ syntax. +- (:pr:`74`) Allows the default `transpose` operation to be overridden to take advantage of more advanced tensor transpose libraries. +- (:pr:`73`) The ``optimal`` path is now significantly faster. + +Bug fixes ++++++++++ +- (:pr:`72`) Fixes the `"Interleaved Input" `_ syntax and adds documentation. + +2.2.0 / 2018-07-29 ------------------ New Features diff --git a/opt_einsum/backends/__init__.py b/opt_einsum/backends/__init__.py index 37df3bc..05e77c8 100644 --- a/opt_einsum/backends/__init__.py +++ b/opt_einsum/backends/__init__.py @@ -2,10 +2,9 @@ Compute backends for opt_einsum. """ -from .dispatch import (get_func, has_einsum, build_expression, evaluate_constants, has_backend) - # Backends from .cupy import to_cupy +from .dispatch import (get_func, has_einsum, build_expression, evaluate_constants, has_backend) from .tensorflow import to_tensorflow from .theano import to_theano from .torch import to_torch diff --git a/opt_einsum/helpers.py b/opt_einsum/helpers.py index 6a71792..0e3e170 100644 --- a/opt_einsum/helpers.py +++ b/opt_einsum/helpers.py @@ -3,6 +3,7 @@ """ import numpy as np + from .parser import get_symbol __all__ = ["build_views", "compute_size_by_dict", "find_contraction", "flop_count"] @@ -18,9 +19,9 @@ def build_views(string, dimension_dict=None): Parameters ---------- - tensor_list : list of str + string : list of str List of tensor strings to build - dimension_dictionary : dictionary + dimension_dict : dictionary Dictionary of index _sizes Returns diff --git a/opt_einsum/tests/test_contract.py b/opt_einsum/tests/test_contract.py index 0f5cdc6..f5ff2d4 100644 --- a/opt_einsum/tests/test_contract.py +++ b/opt_einsum/tests/test_contract.py @@ -96,7 +96,6 @@ 'aef,fbc,dca->bde', ] - all_optimizers = ['optimal', 'branch-all', 'branch-2', 'branch-1', 'greedy'] @@ -181,8 +180,7 @@ def test_contract_expressions(string, optimize, use_blas, out_spec): shapes = [view.shape for view in views] expected = contract(string, *views, optimize=False, use_blas=False) - expr = contract_expression( - string, *shapes, optimize=optimize, use_blas=use_blas) + expr = contract_expression(string, *shapes, optimize=optimize, use_blas=use_blas) if out_spec and ("->" in string) and (string[-2:] != "->"): out, = helpers.build_views(string.split('->')[1]) diff --git a/opt_einsum/tests/test_input.py b/opt_einsum/tests/test_input.py index b82d59e..5cc3a74 100644 --- a/opt_einsum/tests/test_input.py +++ b/opt_einsum/tests/test_input.py @@ -2,8 +2,6 @@ Tests the input parsing for opt_einsum. Duplicates the np.einsum input tests. """ -import sys - import numpy as np import pytest