The following four files showcase how to tune models using the @metaflow_ray
decorator with @kubernetes
with the PyTorch Lightning library.
-
gpu_profile.py
contains the@gpu_profile
decorator, and is available here. It is used in the fileflow.py
-
dataloader.py
contains utilities to load the MNIST dataset. It usesLightningDataModule
under the hood. -
model.py
contains a simple neural network for classifying MNIST images. It usesLightningModule
under the hood. -
flow.py
contains a flow that uses@metaflow_ray
with@kubernetes
to tune the PyTorch Lightning model. It also passes ingpu
requirement to@kubernetes
and theScalingConfig
when defining theTorchTrainer
.
- This can be run using:
python examples/ray_torch_lightning/flow.py --no-pylint --environment=pypi run
- If you are on the Outerbounds platform, you can leverage
fast-bakery
for blazingly fast docker image builds. This can be used bypython examples/ray_torch_lightning/flow.py --no-pylint --environment=fast-bakery run