What happened?
Description:
Summary
The trainer.kubeflow.org/v1alpha1 API definition supports OpenMPI, Intel, and MPICH as valid values for MPIImplementation. However, the MPI plugin (pkg/runtime/framework/plugins/mpi/mpi.go) currently only supports OpenMPI. Specifying MPICH or Intel causes the controller to throw an unhandled runtime error.
Steps to Reproduce
- Create a
TrainingRuntime or TrainJob manifest with mpiImplementation set to MPICH or Intel:
apiVersion: trainer.kubeflow.org/v1alpha1
kind: TrainJob
spec:
trainer:
resourcesPerNode:
limits:
cpu: "2"
runtimeRef:
name: mpi-runtime
- Apply the manifest to the cluster.
- Observe the controller reconciliation logs.
Expected Behavior
The controller should accept MPICH and Intel implementations, correctly mount the hostfile, inject the appropriate environment variables, and reconcile the job without errors.
Actual Behavior
The controller fails at runtime with the error:
MPI implementation for MPICH doesn't supported
Line 52 in pkg/runtime/framework/plugins/mpi/mpi.go explicitly marks this unaddressed TODO:
// TODO : Support MPICH and IntelMPI implementations.
Proposed Fix
- Extend
EnforceMLPolicy() in pkg/runtime/framework/plugins/mpi/mpi.go to handle MPIImplementationMPICH and MPIImplementationIntel.
- Update
buildHostFileConfigMap() to render hostfiles for MPICH and Intel MPI.
- Add unit test coverage in
pkg/runtime/framework/plugins/mpi/mpi_test.go.
Environment & Affected Files
- Kubeflow Trainer version: v2 (master branch)
pkg/runtime/framework/plugins/mpi/mpi.go
pkg/runtime/framework/plugins/mpi/mpi_test.go
7:44 PM
What did you expect to happen?
When setting mpiImplementation: MPICH or mpiImplementation: Intel in a TrainingRuntime or TrainJob, the controller should accept these valid API enum values, inject the appropriate hostfile and environment variables for MPICH or Intel MPI, and successfully reconcile the job without errors.
Environment
Kubernetes version:
Kubeflow Trainer version:
$ kubectl get pods -n kubeflow-system -l app.kubernetes.io/name=kubeflow-trainer -o jsonpath="{.items[*].spec.containers[*].image}"
Kubeflow Python SDK version:
Impacted by this bug?
Give it a 👍 We prioritize the issues with most 👍
What happened?
Description:
Summary
The
trainer.kubeflow.org/v1alpha1API definition supportsOpenMPI,Intel, andMPICHas valid values forMPIImplementation. However, the MPI plugin (pkg/runtime/framework/plugins/mpi/mpi.go) currently only supportsOpenMPI. SpecifyingMPICHorIntelcauses the controller to throw an unhandled runtime error.Steps to Reproduce
TrainingRuntimeorTrainJobmanifest withmpiImplementationset toMPICHorIntel:Expected Behavior
The controller should accept
MPICHandIntelimplementations, correctly mount the hostfile, inject the appropriate environment variables, and reconcile the job without errors.Actual Behavior
The controller fails at runtime with the error:
MPI implementation for MPICH doesn't supportedLine 52 in
pkg/runtime/framework/plugins/mpi/mpi.goexplicitly marks this unaddressed TODO:// TODO : Support MPICH and IntelMPI implementations.Proposed Fix
EnforceMLPolicy()inpkg/runtime/framework/plugins/mpi/mpi.goto handleMPIImplementationMPICHandMPIImplementationIntel.buildHostFileConfigMap()to render hostfiles for MPICH and Intel MPI.pkg/runtime/framework/plugins/mpi/mpi_test.go.Environment & Affected Files
pkg/runtime/framework/plugins/mpi/mpi.gopkg/runtime/framework/plugins/mpi/mpi_test.go7:44 PM
What did you expect to happen?
When setting
mpiImplementation: MPICHormpiImplementation: Intelin aTrainingRuntimeorTrainJob, the controller should accept these valid API enum values, inject the appropriate hostfile and environment variables for MPICH or Intel MPI, and successfully reconcile the job without errors.Environment
Kubernetes version:
Kubeflow Trainer version:
$ kubectl get pods -n kubeflow-system -l app.kubernetes.io/name=kubeflow-trainer -o jsonpath="{.items[*].spec.containers[*].image}"Kubeflow Python SDK version:
Impacted by this bug?
Give it a 👍 We prioritize the issues with most 👍