|
| 1 | +# The CodeFlare Stack - Scenario 3 |
| 2 | + |
| 3 | +### Bring Your Own Code |
| 4 | + |
| 5 | +I have my own training code, and want to run it at scale. |
| 6 | + |
| 7 | +**Goals**: Productive Use<br> |
| 8 | +**You Provide**: Python source code **|** [S3](https://aws.amazon.com/s3/) data **|** Command-line options to tweak the run parameters <br> |
| 9 | +**CodeFlare Stack Provides**: [Ray](https://www.ray.io/) cluster **|** [Kubernetes](https://kubernetes.io/) management **|** Distributed training job **|** Link S3 credentials **|** Pop-up Dashboards |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +This example utilizes the "bring your own code" feature of the |
| 14 | +CodeFlare Stack. We will point the CLI to |
| 15 | +[this](https://torchtutorialstaging.z5.web.core.windows.net/beginner/hyperparameter_tuning_tutorial.html) |
| 16 | +simple example that uses Ray Tune. In this mode, you point the CLI |
| 17 | +tool to a working directory that contains a `main.py` and (optionally) |
| 18 | +a `requirements.txt`. Make a local directory and download those two |
| 19 | +files from |
| 20 | +[here](https://github.com/project-codeflare/codeflare-cli/tree/main/tests/kind/inputs/ray-tune-tutorial): |
| 21 | + |
| 22 | +This script mimics "bringing your own code". Normally, you would have |
| 23 | +the code already sitting in a directory on your laptop: |
| 24 | + |
| 25 | +```shell |
| 26 | +mkdir codeflare-scenario-1 && cd codeflare-scenario-1 |
| 27 | +curl -LO https://raw.githubusercontent.com/project-codeflare/codeflare-cli/main/tests/kind/inputs/ray-tune-tutorial/main.py |
| 28 | +curl -LO https://raw.githubusercontent.com/project-codeflare/codeflare-cli/main/tests/kind/inputs/ray-tune-tutorial/requirements.txt |
| 29 | +``` |
| 30 | + |
| 31 | +Then launch the `codeflare` CLI and point it to your directory: |
| 32 | + |
| 33 | +``` |
| 34 | +codeflare ml/codeflare/training/byoc |
| 35 | +``` |
| 36 | + |
| 37 | +### The CLI In Action |
| 38 | + |
| 39 | +<a href="https://asciinema.org/a/517989" target="_blank"><img src="https://asciinema.org/a/517989.svg" width="600" /></a> |
| 40 | + |
| 41 | +### Pop-up CodeFlare Dashboard In Action |
| 42 | + |
| 43 | +https://user-images.githubusercontent.com/4741620/187532373-556dd733-7eef-4b70-81e1-b841289535da.mp4 |
| 44 | + |
| 45 | +[Back to Top](README.md) |
0 commit comments