whest._einsum already has a global LRU path cache keyed by (subscripts, shapes, optimize, symmetry, identity, inner_sym) and used by einsum and einsum_path.
Observed overhead still occurs before cache hit on repeated calls:
subscripts split/parse work,
_symmetry_fingerprint(...) materialization,
_identity_pattern(...) grouping,
- symmetry reconstruction that only affects cache keying.
Target optimization opportunities:
- add quick no-symmetry/no-repeated-object fast paths,
- avoid constructing full symmetry fingerprints when no
SymmetricTensor operands are present,
- cache/fuse per-op symmetry metadata where it is reused across repeated calls.
Files
Acceptance Criteria
- Do not change cache-hit correctness or path result.
- Keep
einsum/einsum_path behavior unchanged.
- Reduce pre-cache call overhead for repeated einsum patterns.
whest._einsumalready has a global LRU path cache keyed by(subscripts, shapes, optimize, symmetry, identity, inner_sym)and used byeinsumandeinsum_path.Observed overhead still occurs before cache hit on repeated calls:
subscriptssplit/parse work,_symmetry_fingerprint(...)materialization,_identity_pattern(...)grouping,Target optimization opportunities:
SymmetricTensoroperands are present,Files
src/whest/_einsum.pyAcceptance Criteria
einsum/einsum_pathbehavior unchanged.