Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

796 Reduction Scoping #832

Merged
merged 30 commits into from
Jun 9, 2020
Merged

796 Reduction Scoping #832

merged 30 commits into from
Jun 9, 2020

Conversation

lifflander
Copy link
Collaborator

@lifflander lifflander commented Jun 4, 2020

Fixes #796
Fixes #821

Rewrite machinery for scoping and stamping reductions.

This PR solves long-standing issues with collisions in asynchronous reductions. Create reducer instances with scoping for each instance and stamping reductions within a scope for identification across reductions in the same scope.

Note, this a breaking API change.

theCollective()->reduce<>(..) is no longer allowed.
You may access theCollective()->global()->reduce(..) but this not recommended.

  • Every component now has its own scope with an accessor in the base component class.
  • Every collection instance has its own reducer scope (accessed automatically through the proxy.reduce)
  • Every group has its own scope (tied to a group's default spanning tree)
  • Every obj group has its own scope (accessed automatically through proxy.reduce)

The new implementation is far more compact in bits sent with a reduction message by using SafeUnion. Probably 1/3 of the space required before.

@codecov
Copy link

codecov bot commented Jun 5, 2020

Codecov Report

Merging #832 into develop will increase coverage by 0.09%.
The diff coverage is 86.82%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #832      +/-   ##
===========================================
+ Coverage    80.41%   80.50%   +0.09%     
===========================================
  Files          347      353       +6     
  Lines        10933    11205     +272     
===========================================
+ Hits          8792     9021     +229     
- Misses        2141     2184      +43     
Impacted Files Coverage Δ
src/vt/collective/reduce/scoping/strong_types.h 0.00% <0.00%> (ø)
src/vt/objgroup/proxy/proxy_objgroup.h 100.00% <ø> (ø)
src/vt/vrt/collection/reducable/reducable.h 100.00% <ø> (ø)
src/vt/objgroup/proxy/proxy_objgroup.impl.h 43.90% <50.00%> (ø)
src/vt/collective/reduce/reduce_manager.impl.h 60.00% <60.00%> (ø)
src/vt/collective/reduce/reduce_scope.impl.h 64.28% <64.28%> (ø)
src/vt/vrt/collection/manager.impl.h 85.01% <75.75%> (-0.23%) ⬇️
src/vt/utils/adt/union.h 83.57% <83.57%> (ø)
src/vt/collective/reduce/reduce_scope.h 90.32% <90.32%> (ø)
src/vt/collective/reduce/reduce.impl.h 97.67% <97.56%> (+1.79%) ⬆️
... and 16 more

@lifflander lifflander self-assigned this Jun 5, 2020
vt::adt::SafeUnion<int64_t, char> y2;

// This makes an assertion about alignment that will hold across these two
// types
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're concerned about alignment, you can (also) assert on alignof

src/vt/utils/adt/union.h Outdated Show resolved Hide resolved
src/vt/utils/adt/union.h Outdated Show resolved Hide resolved
@PhilMiller
Copy link
Member

The Sizer giving the sum of sizes rather than the maximum is the only really substantial concern I have here. Address that, or be explicit that you're OK with it being like that, and I'm +1

Copy link
Member

@PhilMiller PhilMiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've got my comments. The code is generally OK.

@lifflander lifflander force-pushed the 796-reduction-scoping branch from dc2fa31 to 1e26dc2 Compare June 8, 2020 18:31
@lifflander lifflander force-pushed the 796-reduction-scoping branch from 1e26dc2 to 3969222 Compare June 8, 2020 23:57
Copy link
Collaborator Author

Codacy Here is an overview of what got changed by this pull request:

Clones added
============
- src/vt/utils/adt/union.h  2
         

Clones removed
==============
+ src/vt/vrt/collection/reducable/reducable.impl.h  -4
         

See the complete overview on Codacy

@lifflander lifflander merged commit db44813 into develop Jun 9, 2020
@cz4rs cz4rs linked an issue Dec 18, 2020 that may be closed by this pull request
@cz4rs cz4rs removed a link to an issue Dec 18, 2020
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.

Implement some ADTs needed for refactoring Add general scoping for reductions
2 participants