diff --git a/sdk/python/kubeflow/training/api/training_client.py b/sdk/python/kubeflow/training/api/training_client.py index 54837b34fe..670bcadf54 100644 --- a/sdk/python/kubeflow/training/api/training_client.py +++ b/sdk/python/kubeflow/training/api/training_client.py @@ -139,11 +139,8 @@ def train( if isinstance(resources_per_worker, dict): if "gpu" in resources_per_worker: - if ( - resources_per_worker["gpu"] is not None - and (num_procs_per_worker > resources_per_worker["gpu"]) - ) or ( - resources_per_worker["gpu"] is None and num_procs_per_worker != 0 + if resources_per_worker["gpu"] is not None and ( + num_procs_per_worker > resources_per_worker["gpu"] ): raise ValueError( "Insufficient gpu resources allocated to the container."