Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lightning/fabric/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Fixed

-
- Fix issue in detecting MPIEnvironment with partial mpi4py installation ([#21353](https://github.com/Lightning-AI/pytorch-lightning/pull/21353))


---
Expand Down
6 changes: 5 additions & 1 deletion src/lightning/fabric/plugins/environments/mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ def detect() -> bool:
if not _MPI4PY_AVAILABLE:
return False

from mpi4py import MPI
try:
# mpi4py may be installed without MPI being present
from mpi4py import MPI
except ImportError:
return False

return MPI.COMM_WORLD.Get_size() > 1

Expand Down
Loading