Skip to content

arena: grow_to_cover builds inner ranges only for cells that grow - #622

Draft
kshitij-05 wants to merge 4 commits into
masterfrom
kshitij/perf/arena-grow-to-cover-on-demand
Draft

kshitij-05 wants to merge 4 commits into
masterfrom
kshitij/perf/arena-grow-to-cover-on-demand

Conversation

@kshitij-05

Copy link
Copy Markdown
Member

Summary

Two changes to the arena ToT (tensor-of-tensors) kernels that remove per-cell work from grow_to_cover in SUMMA ToT contractions.

  • Inner ranges on demand (26c45f644): operand_inner_ranges built a range for every output cell at every K-panel, and arena_tot_grow_inplace copied every existing cell's range again, although in the steady state nothing grows. On a PNS-CCD residual (uranyl, MPQC) this was 37 % of all CPU time, more than the zgemm kernels. The per-cell range is now a callable (cell_range_fn); grow_to_cover evaluates it only for cells that are still null and stops at the first one that grows. The full range vector is built only when a panel actually grows the tile. reserve_and_construct is unchanged.
  • Growth test by per-panel masks (b78d6c305): the on-demand form still built a range for every null cell at every K-panel, and most cells of a pair-screened ToT are null. cell_grows_fn now builds, once per panel, per-row (left) and per-column (right) bitmasks of the non-empty operand cells over K. The per-cell growth test is a mask test (an AND for the gemm_result kind), and a range is built only for a panel that actually grows the tile. arena_tot_grow_inplace takes the predicate and the range callable separately; the two-argument form (used by arena_tot_add_to) derives the predicate from the range as before.

Files: src/TiledArray/tensor/arena_einsum.h, src/TiledArray/tensor/arena_kernels.h (+155 / -25).

The branch also merges master twice (1b2f6a4, eae2ad7), so it is current with master; the PR diff is the two commits above.

The same two changes are on the older branch kshitij/perf/arena-grow-on-demand, which is not current with master and has one more commit (an einsum fence change) that is not part of this PR.

Testing

  • MPQC's Kramers PNS-CC runs on owl (uranyl, DCH disk-backed checks) have used this branch since 2026-11-15, the last ones built on 2ace11e (this head).
  • The TiledArray unit tests were not rerun locally on this head; CI will run them.

…ells

operand_inner_ranges materialized a range per output cell for every K-panel
of a SUMMA ToT contraction, and arena_tot_grow_inplace copied every existing
cell's range again, only to find that nothing grows in the steady state. On
the uranyl PNS-CCD residual this was 37 % of all CPU time, more than the
zgemm kernels. The per-cell range is now a callable (cell_range_fn);
grow_to_cover evaluates it only for cells that are still null and stops at
the first one that grows; the full range vector is built only when a panel
actually grows the tile. reserve_and_construct is unchanged (one full
evaluation per result tile).
…per-cell range

The on-demand form still constructed a range for every null cell at every
K-panel (most cells of a pair-screened ToT are null), which merely moved the
cost from operand_inner_ranges into arena_tot_grow_inplace. cell_grows_fn now
builds, once per panel, per-row (left) and per-column (right) bitmasks of
the non-empty operand cells over K; the per-cell growth test is a mask test
(an AND for the gemm_result kind), and a range is constructed only for a
panel that actually grows the tile. arena_tot_grow_inplace takes the
predicate and the range callable separately; the two-argument form (used by
arena_tot_add_to) derives the predicate from the range as before.
…(a product's result keeps the map it was computed on; archives read onto a chosen process map; MADNESS a97477f72, BTAS ae94ff3e1)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant