Skip to content

2330 Enhance all_gather APIs for regular PyTorch programs#2331

Merged
Nic-Ma merged 14 commits intoProject-MONAI:devfrom
Nic-Ma:2330-enhance-all-gather
Jun 8, 2021
Merged

2330 Enhance all_gather APIs for regular PyTorch programs#2331
Nic-Ma merged 14 commits intoProject-MONAI:devfrom
Nic-Ma:2330-enhance-all-gather

Conversation

@Nic-Ma
Copy link
Copy Markdown
Contributor

@Nic-Ma Nic-Ma commented Jun 8, 2021

Fixes #2330 .

basic warnings for #2335

Description

This PR adjusted the evenly_divisible_all_gather and string_list_all_gather APIs to support regular PyTorch programs.
Thanks for @vfdev-5 's help, referring to the basic idea of ignite all_gather(string).
And resolved the max_length=1024 issue of ignite v0.4.4.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@Nic-Ma Nic-Ma force-pushed the 2330-enhance-all-gather branch from 7997bf0 to 2ae5eee Compare June 8, 2021 10:31
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 8, 2021

/black

@Nic-Ma Nic-Ma requested review from ericspod, rijobro and wyli June 8, 2021 10:59
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 8, 2021

/black

1 similar comment
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 8, 2021

/black

Copy link
Copy Markdown
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks, please see some comments inline. there are some utility functions moved from monai.handlers.utils to monai.utils, we need a deprecation method for this type of change as well @ericspod, any suggestions for this PR or shall we have another PR for the deprecating module?

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 8, 2021

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 8, 2021

Hi @wyli ,

Thanks for your review and comments.
For this kind of deprecated API, maybe I should not delete the previous implementation, just add a warning in the function:

warnings.warn("evenly_divisible_all_gather had been moved to monai.utils module, will deprecate this API in MONAI v0.7.", DeprecationWarning)

Or any other suggestions? Or some overall advanced method to handle it?

Thanks.

@ericspod
Copy link
Copy Markdown
Member

ericspod commented Jun 8, 2021

For now you can add the warning but I'm going to have a PR shortly on a more involved mechanism.

@Nic-Ma Nic-Ma force-pushed the 2330-enhance-all-gather branch from 7ac69c8 to cbebdff Compare June 8, 2021 15:33
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 8, 2021

Hi @ericspod ,

Sounds good!
I added the warning message to the deprecated APIs.

Thanks.

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 8, 2021

/black

Copy link
Copy Markdown
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks, this PR also had a workaround for #2335

@Nic-Ma Nic-Ma enabled auto-merge (squash) June 8, 2021 16:00
@Nic-Ma Nic-Ma merged commit 369ab00 into Project-MONAI:dev Jun 8, 2021
@Nic-Ma Nic-Ma deleted the 2330-enhance-all-gather branch July 2, 2021 23:38
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.

Enhance the all_gather APIs for non-ignite programs

4 participants