heat icon indicating copy to clipboard operation
heat copied to clipboard

Features/1243 refactoring of communication separate mpi4py wrappers from dn darrays

Open mrfh92 opened this issue 1 year ago • 7 comments

This PR addresses #1243

Description: TBD ... see comments below

mrfh92 avatar Nov 20 '23 15:11 mrfh92

Current problem: everything fails due to circular imports

mrfh92 avatar Nov 20 '23 15:11 mrfh92

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

ghost avatar Nov 20 '23 15:11 ghost

Thank you for the PR!

github-actions[bot] avatar Nov 22 '23 13:11 github-actions[bot]

Thank you for the PR!

github-actions[bot] avatar Nov 22 '23 13:11 github-actions[bot]

Done so far:

  • a new module communication_backends has been introduced
  • communication.py from heat/core has been divided into communications.py (containing the basis Communication-class) and mpi4py4torch.py (containing the MPICommunication-class and the wrappers for mpi4py-functionality for torch)
  • calling any MPI-communication with DNDarrays as buffers is deprecated; everywhere in the code such calls have been replaced by the equivalent way using the local arrays of a DNDarray as buffers instead (actually, such a check and reference of the local arrays has been done in all communication-functions previously)

To do:

  • the tests for the no-more existing heat/core/communication.py are still in heat/core/tests/test_communication.py (although being adapted according to the last bullet point above); however, it would be favourable to rewrite them as tests to heat/communication_backends/mpi4py4torch.py, i.e. to remove any reference to DNDarrays there in order to achieve a clear separation.

mrfh92 avatar Nov 22 '23 13:11 mrfh92

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (6a5115c) 91.81% compared to head (47a4d25) 91.83%. Report is 1 commits behind head on main.

:exclamation: Current head 47a4d25 differs from pull request most recent head abe3d20. Consider uploading reports for the commit abe3d20 to get more accurate results

Files Patch % Lines
heat/core/linalg/solver.py 50.00% 4 Missing :warning:
heat/communication_backends/communication.py 96.36% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1265      +/-   ##
==========================================
+ Coverage   91.81%   91.83%   +0.01%     
==========================================
  Files          79       79              
  Lines       11463    11171     -292     
==========================================
- Hits        10525    10259     -266     
+ Misses        938      912      -26     
Flag Coverage Δ
unit 91.83% <94.59%> (+0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 22 '23 15:11 codecov[bot]

Thank you for the PR!

github-actions[bot] avatar Nov 24 '23 14:11 github-actions[bot]