Skip to content

Commit

Permalink
Fix pytorch example (#1668)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <pingsutw@apache.org>
  • Loading branch information
pingsutw committed Apr 26, 2024
1 parent 9bbf486 commit 7a11248
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 51 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
# TODO: Register and update the examples below. (onnx_plugin, feast_integration, etc)
echo "PACKAGES=$(find examples -maxdepth 1 -type d -exec basename '{}' \; \
| grep -v -e 'testing' -e 'examples' \
| grep -v -e 'airflow_plugin' -e 'forecasting_sales' -e 'onnx_plugin' -e 'feast_integration' -e 'modin_plugin' -e 'sagemaker_inference_agent' -e 'kfpytorch_plugin' \
| grep -v -e 'airflow_plugin' -e 'forecasting_sales' -e 'onnx_plugin' -e 'feast_integration' -e 'modin_plugin' -e 'sagemaker_inference_agent' \
| sort \
| jq --raw-input . \
| jq --slurp . \
Expand All @@ -72,8 +72,7 @@ jobs:
example: "${{ fromJson(needs.list_examples.outputs.packages) }}"
steps:
- uses: actions/checkout@v4
- name: 'Clear action cache'
uses: ./.github/actions/clear-action-cache
- uses: insightsengineering/disk-space-reclaimer@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
38 changes: 0 additions & 38 deletions examples/kfpytorch_plugin/Dockerfile

This file was deleted.

18 changes: 8 additions & 10 deletions examples/kfpytorch_plugin/kfpytorch_plugin/pytorch_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,15 @@
# :::
#
# The following imports are required to configure the PyTorch cluster in Flyte.
# You can load them on demand.
# %%
if custom_image.is_container():
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
from flytekitplugins.kfpytorch import PyTorch, Worker
from tensorboardX import SummaryWriter
from torch import distributed as dist
from torch import nn, optim
from torchvision import datasets, transforms
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
from flytekitplugins.kfpytorch import PyTorch, Worker
from tensorboardX import SummaryWriter
from torch import distributed as dist
from torch import nn, optim
from torchvision import datasets, transforms

# %% [markdown]
# You can activate GPU support by either using the base image that includes the necessary GPU dependencies
Expand Down

0 comments on commit 7a11248

Please sign in to comment.