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

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

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mrfh92
Copy link
Collaborator

@mrfh92 mrfh92 commented Nov 20, 2023

This PR addresses #1243

Description: TBD ... see comments below

@mrfh92
Copy link
Collaborator Author

mrfh92 commented Nov 20, 2023

Current problem: everything fails due to circular imports

@mrfh92 mrfh92 self-assigned this Nov 20, 2023
@ghost
Copy link

ghost commented Nov 20, 2023

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

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@mrfh92 mrfh92 added MPI Anything related to MPI communication communication labels Nov 20, 2023
Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

Thank you for the PR!

@mrfh92
Copy link
Collaborator Author

mrfh92 commented Nov 22, 2023

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.

Copy link

codecov bot commented Nov 22, 2023

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.

❗ 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 ⚠️
heat/communication_backends/communication.py 96.36% 2 Missing ⚠️
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%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Thank you for the PR!

@mrfh92 mrfh92 added this to the 2.0.0 milestone Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
communication MPI Anything related to MPI communication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant