Project-MONAI / Project-MONAI/model-zoo

A better way to handle DDP raised error

Open
#372 0 comments 1 reaction 1 assignee View on GitHub

@yiheng-wang-nv is already working on this.

Since Apr 18, 2023.

Dominant language
Python
Stars
338
Forks
106
PR merge metrics
No merged PRs in 30d

Description

With the BundleWorkflow interface, we modified some bundles to use this new feature. For example:
https://github.com/Project-MONAI/model-zoo/blob/dev/models/spleen_ct_segmentation/configs/multi_gpu_train.json

However, follow up the discussion in: https://github.com/Project-MONAI/model-zoo/pull/369 users may meet DDP error when calling the initialize or finalize if torch.distributed is not available. According to current settings, users may meet errors like:

AttributeError: module 'torch.distributed' has no attribute 'is_initialized'

The error message is not informative enough, and we may need a better way to handle this situation.

Thanks @wyli very much for posting this case.

Hi @Nic-Ma @holgerroth , do you have any suggestions on it? So far we can still keep the current settings, but it may be a place that can be enhanced in the next version.
I discussed with @wyli and maybe we can add some utility functions to handle DDP errors in the initialize and finalize steps. What do you think?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.