Skip to content

2330 Enhance all_gather APIs for regular PyTorch programs#2331

Merged
Nic-Ma merged 14 commits into
Project-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 into
Project-MONAI:devfrom
Nic-Ma:2330-enhance-all-gather

Conversation

@Nic-Ma

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

Copy link
Copy Markdown
Contributor

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 added 2 commits June 8, 2021 18:49
Signed-off-by: Nic Ma <nma@nvidia.com>
Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented Jun 8, 2021

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma Nic-Ma requested review from ericspod, rijobro and wyli June 8, 2021 10:59
monai-bot and others added 3 commits June 8, 2021 11:02
Signed-off-by: monai-bot <monai.miccai2019@gmail.com>
Signed-off-by: Nic Ma <nma@nvidia.com>
Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented Jun 8, 2021

Copy link
Copy Markdown
Contributor Author

/black

1 similar comment
@Nic-Ma

Nic-Ma commented Jun 8, 2021

Copy link
Copy Markdown
Contributor Author

/black

Signed-off-by: monai-bot <monai.miccai2019@gmail.com>

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

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?

Comment thread monai/utils/misc.py
Comment thread monai/utils/misc.py
Comment thread monai/utils/misc.py Outdated
Comment thread monai/handlers/utils.py
Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented Jun 8, 2021

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma

Nic-Ma commented Jun 8, 2021

Copy link
Copy Markdown
Contributor Author

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

ericspod commented Jun 8, 2021

Copy link
Copy Markdown
Member

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

Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma Nic-Ma force-pushed the 2330-enhance-all-gather branch from 7ac69c8 to cbebdff Compare June 8, 2021 15:33
@Nic-Ma

Nic-Ma commented Jun 8, 2021

Copy link
Copy Markdown
Contributor Author

Hi @ericspod ,

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

Thanks.

@Nic-Ma

Nic-Ma commented Jun 8, 2021

Copy link
Copy Markdown
Contributor Author

/black

Comment thread monai/utils/misc.py Outdated
monai-bot and others added 2 commits June 8, 2021 15:42
Signed-off-by: monai-bot <monai.miccai2019@gmail.com>
Signed-off-by: Nic Ma <nma@nvidia.com>

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

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