Skip to content

Commit d4b5416

Browse files
author
Dan Choi
committed
change: set num_processes_per_host only if provided by user
1 parent fb309bc commit d4b5416

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/sagemaker/tensorflow/estimator.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,12 @@ def hyperparameters(self):
545545
mpi_dict = self.distributions["mpi"]
546546
mpi_enabled = mpi_dict.get("enabled", False)
547547
additional_hyperparameters[self.LAUNCH_MPI_ENV_NAME] = mpi_enabled
548-
additional_hyperparameters[self.MPI_NUM_PROCESSES_PER_HOST] = mpi_dict.get(
549-
"processes_per_host", 1
550-
)
548+
549+
if mpi_dict.get("processes_per_host"):
550+
additional_hyperparameters[self.MPI_NUM_PROCESSES_PER_HOST] = mpi_dict.get(
551+
"processes_per_host"
552+
)
553+
551554
additional_hyperparameters[self.MPI_CUSTOM_MPI_OPTIONS] = mpi_dict.get(
552555
"custom_mpi_options", ""
553556
)

0 commit comments

Comments
 (0)