Skip to content

Commit 7dc39c6

Browse files
committed
docs: add README for PyTorch examples with Kubeflow Trainer SDK
1 parent 0e036f6 commit 7dc39c6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

examples/pytorch/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# PyTorch Examples
2+
3+
This directory contains examples for training PyTorch models using the Kubeflow Trainer SDK.
4+
5+
### Examples
6+
7+
| Use Case | Script | Notebook |
8+
| :--- | :--- | :--- |
9+
| **Image Classification** | [train_mnist.py](image-classification/train_mnist.py) | [mnist.ipynb](image-classification/mnist.ipynb) |
10+
11+
### Prerequisites
12+
13+
To run these examples, install the Kubeflow SDK:
14+
```bash
15+
pip install -U kubeflow
16+
```
17+
18+
### How to Run
19+
20+
These standalone scripts are designed for automated workflows and production training. They automatically handle distributed setup and dependency installation on the cluster.
21+
22+
**Submit an MNIST training job:**
23+
```bash
24+
python image-classification/train_mnist.py --nodes 1
25+
```
26+
27+
**Verify locally (no Kubernetes needed):**
28+
You can verify the training logic on your local machine using the `--test` flag:
29+
```bash
30+
python image-classification/train_mnist.py --test
31+
```
32+
33+
For interactive experimentation, you can also use the corresponding Jupyter notebooks in each subdirectory.

0 commit comments

Comments
 (0)