Repository navigation
arena: grow_to_cover builds inner ranges only for cells that grow - #622
Draft
kshitij-05 wants to merge 4 commits into
Draft
kshitij-05 wants to merge 4 commits into
kshitij-05 wants to merge 4 commits into
Conversation
…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
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.
Summary
Two changes to the arena ToT (tensor-of-tensors) kernels that remove per-cell work from
grow_to_coverin SUMMA ToT contractions.26c45f644):operand_inner_rangesbuilt a range for every output cell at every K-panel, andarena_tot_grow_inplacecopied 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_coverevaluates 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_constructis unchanged.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_fnnow 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 thegemm_resultkind), and a range is built only for a panel that actually grows the tile.arena_tot_grow_inplacetakes the predicate and the range callable separately; the two-argument form (used byarena_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