Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change flytekit Pytorch, TFJob and MPI plugins to use new kubeflow config #1627

Merged
merged 12 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/pythonbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ jobs:
# See: https://github.com/flyteorg/flytekit/actions/runs/4493746408/jobs/7905368664
- python-version: 3.11
plugin-names: "flytekit-whylogs"


steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
65 changes: 64 additions & 1 deletion plugins/flytekit-kf-mpi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,67 @@ To install the plugin, run the following command:
pip install flytekitplugins-kfmpi
```

_Example coming soon!_
yubofredwang marked this conversation as resolved.
Show resolved Hide resolved
## Code Example
MPI usage:
```python
@task(
task_config=MPIJob(
launcher=Launcher(
replicas=1,
),
worker=Worker(
replicas=5,
requests=Resources(cpu="2", mem="2Gi"),
limits=Resources(cpu="4", mem="2Gi"),
),
slots=2,
),
cache=True,
requests=Resources(cpu="1"),
cache_version="1",
)
def my_mpi_task(x: int, y: str) -> int:
return x
```


Horovod Usage:
You can override the command of a replica group by:
```python
@task(
task_config=HorovodJob(
launcher=Launcher(
replicas=1,
requests=Resources(cpu="1"),
limits=Resources(cpu="2"),
),
worker=Worker(
replicas=1,
command=["/usr/sbin/sshd", "-De", "-f", "/home/jobuser/.sshd_config"],
restart_policy=RestartPolicy.NEVER,
),
slots=2,
verbose=False,
log_level="INFO",
),
)
def my_horovod_task():
...
```




## Upgrade MPI Plugin from V0 to V1
MPI plugin is now updated from v0 to v1 to enable more configuration options.
To migrate from v0 to v1, change the following:
1. Update flytepropeller to v1.6.0
2. Update flytekit version to v1.6.2
3. Update your code from:
```
task_config=MPIJob(num_workers=10),
```
to
```
task_config=MPIJob(worker=Worker(replicas=10)),
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
MPIJob
"""

from .task import HorovodJob, MPIJob
from .task import CleanPodPolicy, HorovodJob, Launcher, MPIJob, RestartPolicy, RunPolicy, Worker
Loading