Project-MONAI / Project-MONAI/model-zoo
A better way to handle DDP raised error
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.