[build] allow MPI on Unix when NCCL is disabled (#21175)

### Description

CMake logic fixed to allow enabling MPI while NCCL is disabled.

### Motivation and Context

MPI is also used on the CPU backend, not only with CUDA, so it makes
sense to decouple it properly from NCCL (which is for dealing with
multiple Nvidia GPUs).
This commit is contained in:
Ștefan Talpalaru 2024-07-10 06:21:40 +02:00 committed by GitHub
parent d28c26a919
commit 1b19045afa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1529,7 +1529,7 @@ if (onnxruntime_ENABLE_TRAINING)
list(APPEND onnxruntime_EXTERNAL_LIBRARIES tensorboard)
endif()
if (UNIX AND onnxruntime_USE_NCCL)
if (UNIX OR onnxruntime_USE_NCCL)
# MPI is INDEPENDENT of NCCL for now. You can build NCLL without MPI and launch multi-GPU with your own launcher.
if (onnxruntime_USE_MPI)
if (EXISTS "${onnxruntime_MPI_HOME}")