diff --git a/torch/csrc/distributed/c10d/ProcessGroupMPI.cpp b/torch/csrc/distributed/c10d/ProcessGroupMPI.cpp index 3d49085eaa885..c97ace85cbf09 100644 --- a/torch/csrc/distributed/c10d/ProcessGroupMPI.cpp +++ b/torch/csrc/distributed/c10d/ProcessGroupMPI.cpp @@ -1,5 +1,8 @@ #include - +// Define the bfloat16 MPI datatype if it's not already defined +#ifndef MPIX_BFLOAT16 +#define MPIX_BFLOAT16 ((MPI_Datatype)0x4c00024c) +#endif #ifdef USE_C10D_MPI #include