Refactor optimization pipeline.#520
Draft
bimalgaudel wants to merge 4 commits into
Draft
Conversation
…raction total mem.
…urable
- Add OptFor { Flops, Memsize } and ReorderSum { Reorder, NoReorder } in
a shared optimize/flags.hpp; thread them through single_term_opt and
the top-level optimize() API.
- Add index_to_extent_t alias for the type-erased provider used by the
public API; templated single_term_opt callers still pass callables
directly via the has_index_extent concept.
- Parallelize the outermost Sum's per-summand single-term optimization
with sequant::for_each; recurse sequentially on nested Sums.
- Have opt::reorder reuse pre-binarized eval nodes instead of rebuilding
them inside clusters().
- Harden opt_mixed_product placeholder labels (non-identifier prefix,
starts_with match, digit-walk suffix parse, asserted invariants).
- Fix std::forward misuse in flops_counter / memsize_counter that
prevented compilation under clang.
- Rename optimize/flags.hpp → optimize/options.hpp; move OptFor,
ReorderSum, and index_to_extent_t into it alongside a new
OptimizeOptions struct (opt_for / reorder / idx_to_extent with
sensible defaults).
- Collapse the six optimize() overloads into three (ExprPtr&,
ResultExpr&, ResultExpr&&), each taking OptimizeOptions{} by
default. Existing default-argument call sites are source-compatible.
- Stop including <SeQuant/core/optimize/single_term.hpp> from
optimize.hpp. The public optimize() API now needs only the
lightweight options header, so single_term.hpp (and its range-v3
transitives) no longer leak into consumers. This fixes the CI
unity-build failure in utilities/external-interface, where
range/v3/view/indirect.hpp's use of meta:: became ambiguous against
sequant::meta once a sibling .cpp in the same TU had issued
`using namespace sequant;`.
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.
No description provided.