Skip to content

Commit 073b467

Browse files
committed
Pytorch walkthrough update
1 parent 8f49283 commit 073b467

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

kernels/pytorch_kfp.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cd $REPO_ROOT_DIR/notebooks/$MODULE
2323

2424
# Setup virtual env and kernel
2525
echo creating $ENVNAME at $(pwd)
26-
python3 -m venv $ENVNAME
26+
python3 -m venv $ENVNAME --system-site-packages
2727

2828
# Registering the venv as an ipython kernel
2929
source $ENVNAME/bin/activate
@@ -32,7 +32,6 @@ pip install ipykernel
3232
python -m ipykernel install --user --name=$ENVNAME
3333

3434
# Install Pytorch and its dependencies
35-
pip install torch==1.11.0 torchtext==0.12.0 --extra-index-url https://download.pytorch.org/whl/cpu
3635
pip install -r pytorch_kfp_requirements.txt
3736

3837
deactivate
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
torch==1.11.0
2-
torch-model-archiver==0.7.0
3-
pandas==1.3.5
4-
google-cloud-aiplatform[prediction]==1.19.0
5-
google-cloud-bigquery-storage==2.13.2
6-
pyarrow==5.0.0
7-
fsspec==2022.11.0
8-
gcsfs==2022.11.0
1+
torch==1.13.1
2+
torchtext==0.14.1
3+
torch-model-archiver==0.8.1

notebooks/kubeflow_pipelines/walkthrough/solutions/kfp_walkthrough_vertex_pytorch.ipynb

+9-10
Original file line numberDiff line numberDiff line change
@@ -918,9 +918,8 @@
918918
"source": [
919919
"%%writefile {TRAINING_APP_FOLDER}/Dockerfile\n",
920920
"\n",
921-
"FROM us-docker.pkg.dev/vertex-ai/training/pytorch-xla.1-11:latest\n",
922-
"RUN pip install -U fire cloudml-hypertune pandas==0.25.3\n",
923-
"RUN pip install -U torchtext==0.12.0\n",
921+
"FROM us-docker.pkg.dev/vertex-ai/training/pytorch-xla.1-13.py310:latest\n",
922+
"RUN pip install -U torchtext==0.14.1\n",
924923
"WORKDIR /app\n",
925924
"COPY train.py .\n",
926925
"\n",
@@ -943,7 +942,7 @@
943942
"metadata": {},
944943
"outputs": [],
945944
"source": [
946-
"IMAGE_NAME = \"trainer_image\"\n",
945+
"IMAGE_NAME = \"pytorch_trainer_image\"\n",
947946
"IMAGE_TAG = \"latest\"\n",
948947
"IMAGE_URI = f\"gcr.io/{PROJECT_ID}/{IMAGE_NAME}:{IMAGE_TAG}\"\n",
949948
"\n",
@@ -1528,15 +1527,15 @@
15281527
],
15291528
"metadata": {
15301529
"environment": {
1531-
"kernel": "python3",
1532-
"name": "tf2-gpu.2-8.m102",
1530+
"kernel": "pytorch_kfp_kernel",
1531+
"name": "tf2-gpu.2-12.m109",
15331532
"type": "gcloud",
1534-
"uri": "gcr.io/deeplearning-platform-release/tf2-gpu.2-8:m102"
1533+
"uri": "gcr.io/deeplearning-platform-release/tf2-gpu.2-12:m109"
15351534
},
15361535
"kernelspec": {
1537-
"display_name": "Python 3 (ipykernel)",
1536+
"display_name": "pytorch_kfp_kernel",
15381537
"language": "python",
1539-
"name": "python3"
1538+
"name": "pytorch_kfp_kernel"
15401539
},
15411540
"language_info": {
15421541
"codemirror_mode": {
@@ -1548,7 +1547,7 @@
15481547
"name": "python",
15491548
"nbconvert_exporter": "python",
15501549
"pygments_lexer": "ipython3",
1551-
"version": "3.7.12"
1550+
"version": "3.10.11"
15521551
}
15531552
},
15541553
"nbformat": 4,

0 commit comments

Comments
 (0)