Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
Signed-off-by: Yuvraj <[email protected]>
  • Loading branch information
yindia committed Oct 22, 2021
1 parent 15ed8ae commit a6c95fa
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions plugins/flytekit-kf-mpi/flytekitplugins/kfmpi/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,21 @@
from flytekit import PythonFunctionTask
from flytekit.extend import SerializationSettings, TaskPlugins
from flytekit.models import common as _common
from flytekit.models import model as _model
from flytekit.models import task as _task_model


class MPIJobModel(_common.FlyteIdlEntity):
"""It will define the model for MPI plugin
Args:
num_workers: integer determining the number of worker replicas spawned in the cluster for this job
(in addition to 1 master).
num_launcher_replicas: Number of launcher server replicas to use
slots: Number of slots per worker used in hostfile
"""
def __init__(self, num_workers, num_launcher_replicas, slots):
self._num_workers = num_workers
self._num_launcher_replicas = num_launcher_replicas
Expand Down Expand Up @@ -70,8 +81,8 @@ class MPIJob(object):
slots: int
num_launcher_replicas: int = 1
num_workers: int = 1
per_replica_requests: Optional[_model.Resources] = None
per_replica_limits: Optional[_model.Resources] = None
per_replica_requests: Optional[_task_model.Resources] = None
per_replica_limits: Optional[_task_model.Resources] = None


class MPIFunctionTask(PythonFunctionTask[MPIJob]):
Expand Down

0 comments on commit a6c95fa

Please sign in to comment.