-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #300 from wyouhei/kfp_walkthrough_vertex_pytorch
ADD: kfp_walkthrough_vertex using pytorch
- Loading branch information
Showing
4 changed files
with
1,608 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
# | ||
# To build the kernel: ./kernels/pytorch_kfp.sh | ||
# To remove the kernel: ./kernels/pytorch_kfp.sh remove | ||
# | ||
# This scripts will create a ipython kernel named $MODULE | ||
# populated with the reqs in ./notebooks/$MODULE/requirements.txt | ||
|
||
|
||
MODULE=kubeflow_pipelines\/walkthrough | ||
ENVNAME=pytorch_kfp_kernel | ||
REPO_ROOT_DIR="$(dirname $(cd $(dirname $BASH_SOURCE) && pwd))" | ||
|
||
# Cleaning up the kernel and exiting if first arg is 'remove' | ||
if [ "$1" == "remove" ]; then | ||
echo Removing kernel $ENVNAME | ||
jupyter kernelspec remove $ENVNAME | ||
rm -r "$REPO_ROOT_DIR/notebooks/$MODULE/$ENVNAME" | ||
exit 0 | ||
fi | ||
|
||
cd $REPO_ROOT_DIR/notebooks/$MODULE | ||
|
||
# Setup virtual env and kernel | ||
echo creating $ENVNAME at $(pwd) | ||
python3 -m venv $ENVNAME | ||
|
||
# Registering the venv as an ipython kernel | ||
source $ENVNAME/bin/activate | ||
pip install -U pip | ||
pip install ipykernel | ||
python -m ipykernel install --user --name=$ENVNAME | ||
|
||
# Install Pytorch and its dependencies | ||
pip install torch==1.11.0 torchtext==0.12.0 --extra-index-url https://download.pytorch.org/whl/cpu | ||
pip install -r pytorch_kfp_requirements.txt | ||
|
||
deactivate |
8 changes: 8 additions & 0 deletions
8
notebooks/kubeflow_pipelines/walkthrough/pytorch_kfp_requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
torch==1.11.0 | ||
torch-model-archiver==0.7.0 | ||
pandas==1.3.5 | ||
google-cloud-aiplatform[prediction]==1.19.0 | ||
google-cloud-bigquery-storage==2.13.2 | ||
pyarrow==5.0.0 | ||
fsspec==2022.11.0 | ||
gcsfs==2022.11.0 |
1,556 changes: 1,556 additions & 0 deletions
1,556
notebooks/kubeflow_pipelines/walkthrough/solutions/kfp_walkthrough_vertex_pytorch.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.