arena: support permuted Hadamard add/subt/mult on Tensor<ArenaTensor> ToT#555
Open
evaleev wants to merge 1 commit into
Open
arena: support permuted Hadamard add/subt/mult on Tensor<ArenaTensor> ToT#555evaleev wants to merge 1 commit into
evaleev wants to merge 1 commit into
Conversation
… ToT The permuted, arena ToT x arena ToT overloads of add, subt, and mult (scaled and unscaled) previously threw "permuted ... of a tensor-of-tensors is not yet supported". This blocked CSV/PNO-based coupled-cluster, whose residual evaluates permuted ToT Hadamard products at the tile-op level (a binary Mult/Add op calling left.mult(right, perm) etc.). By the time a permuted product reaches a tile op, the expression engine has already brought both operands to a common (congruent) layout, so the elementwise product/sum is valid and perm is purely the result permutation. Compute the unpermuted result, then apply perm as a post-pass via permute(), which already handles arena ToT: a shallow outer-cell reindex (arena_permute_shallow) plus an inner-slab rewrite (arena_inner_permute) when the bipartite permutation's inner part is non-trivial. This mirrors the existing numeric x arena permuted-mult branches.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The permuted, arena ToT × arena ToT overloads of
add,subt, andmult(scaled and unscaled) onTA::Tensor<ArenaTensor>threw"permuted ... of a tensor-of-tensors is not yet supported". This blocks CSV/PNO-based coupled-cluster in MPQC, whose residual evaluates permuted ToT Hadamard products at the tile-op level (the binary Mult/Add tile op callsleft.mult(right, perm)directly).Fix
By the time a permuted product reaches a tile op, the expression engine has already brought both operands to a common (congruent) layout, so the elementwise product/sum is valid and
permis purely the result permutation. Compute the unpermuted result, then applypermas a post-pass viapermute(), which already handles arena ToT — a shallow outer-cell reindex (arena_permute_shallow) plus an inner-slab rewrite (arena_inner_permute) when the bipartite permutation's inner part is non-trivial. This mirrors the existing numeric × arena permuted-multbranches.Covers all six overloads that shared the stub:
add(perm),add(factor,perm),subt(perm),subt(factor,perm),mult(perm),mult(factor,perm).Validation
A previously-failing MPQC PNO-CCSD job (H₂O/cc-pVDZ,
PaoPnoRMP2→CCk) now runs to convergence (13 iterations, E = −76.23928119138472) with no exception.