Repository navigation
feat: add SkyPilot as a cloud execution backend for AutoModel - #1590
Conversation
|
Thanks a lot @Anakintano for knocking this one out so quickly. I'll trigger the CI today. I also wanted to ask you if you know how to make something like https://github.com/skypilot-org/skypilot/blob/fa2fb208199465bd126e81466599fc2cfd0f4cb9/llm/nemorl/nemorl.sky.yaml#L27 to include automodel in the skypilot repo as well? Please let me know if you already know, otherwise I'll add it to my queue 😅 Thanks a lot again, this looks great! |
|
/ok to test e407209 |
jgerh
left a comment
There was a problem hiding this comment.
Completed a tech pubs review, provided copyedits, converted procedure headings into steps, revised one heading title, and flagged use of horizontal lines for removal
|
|
||
| SkyPilot is an open-source framework that abstracts cloud infrastructure so you can train on whichever cloud is cheapest or most available at launch time — including automatic spot-instance handling for significant cost savings. | ||
|
|
||
| --- |
There was a problem hiding this comment.
Delete horizontal line --- and close up blank lines
| export WANDB_API_KEY=... # Optional: Weights & Biases logging | ||
| ``` | ||
|
|
||
| --- |
There was a problem hiding this comment.
Delete horizontal line --- and close up blank lines
|
|
||
| The CLI detects the `skypilot:` key, strips it from the training config, uploads the code and config to a cloud VM, and launches training — all in one command. | ||
|
|
||
| --- |
There was a problem hiding this comment.
Delete horizontal line --- and close up blank lines
| | `job_dir` | `./skypilot_jobs` | Local directory for job artifacts (config snapshot, logs) | | ||
| | `gpus_per_node` | *(parsed from `accelerators`)* | Override GPU count per node passed to `torchrun` | | ||
|
|
||
| --- |
There was a problem hiding this comment.
Delete horizontal line --- and close up blank lines
|
|
||
| For multi-node jobs the launcher automatically adds the SkyPilot rendezvous environment variables (`$SKYPILOT_NODE_RANK`, `$SKYPILOT_NUM_NODES`, `$SKYPILOT_NODE_IPS`) to the `torchrun` command. | ||
|
|
||
| --- |
There was a problem hiding this comment.
Delete horizontal line --- and close up blank lines
|
/ok to test 49af132 |
We (SkyPilot) would love to welcome a PR adding a automodel example! :) |
|
/ok to test 073a18d |
|
Hi @romilbhardwaj, thank you for being open to contributions and for building Skypilot 🙇 I'll wait for @Anakintano 's response and proceed from there. Best to all. |
|
Thanks for the offer! 😀 @akoumpa & @romilbhardwaj I'm definitely interested in adding the AutoModel |
|
Awesome @Anakintano , please go ahead when you get the chance 🙇 thanks a lot for landing this and offering to add it to the Skypilot repo as well! |
|
/ok to test bcc7dc4 |
Adds SkyPilot as a supported execution backend alongside the existing SLURM launcher. Users add a skypilot: section to their YAML and run the same automodel finetune llm -c ... command with no workflow changes or new launcher to learn. Supports AWS, GCP, Azure, Lambda, and Kubernetes. Automatic spot instance management (~80% cost savings). Multi-node distributed training handled transparently. New files: - nemo_automodel/components/launcher/skypilot/config.py: SkyPilotConfig dataclass with validation - nemo_automodel/components/launcher/skypilot/utils.py: submit_skypilot_job() executor - tests/unit_tests/launcher/test_skypilot_config.py: config validation tests - tests/unit_tests/launcher/test_skypilot_utils.py: launcher utils tests - tests/unit_tests/_cli/test_skypilot_app.py: CLI integration tests - docs/launcher/skypilot.md: quickstart guide and config reference - examples/llm_finetune/llama3_2/llama3_2_1b_squad_skypilot.yaml: ready-to-run example Modified files: - nemo_automodel/_cli/app.py: launch_with_skypilot() function and main() routing - .gitignore: add slurm_jobs/ and skypilot_jobs/ Tests: - 37 new unit tests with sky fully mocked, zero regressions - All tests pass locally Implementation notes: - sky is imported lazily (only when SkyPilot backend is used) - Backward compatible: default backend is local - Follows existing SLURM launcher patterns (modular, optional, clean routing) Signed-off-by: anakintano <madityasaxena@gmail.com>
|
/ok to test f099c42 |
|
/ok to test b47ed50 |
Issue
Closes #1581
Summary
Adds SkyPilot as a supported execution backend alongside the existing SLURM launcher.
Users add
skypilot:to their YAML and run the sameautomodel finetune llm -c ...command— no workflow changes, no new launcher to learn.
Supports all major clouds: AWS, GCP, Azure, Lambda, Kubernetes.
Automatic spot instance management (~80% cost savings).
Multi-node distributed training handled transparently.
User-Facing Change
Then run:
automodel finetune llm -c config.yamlImplementation
New files:
nemo_automodel/components/launcher/skypilot/config.py—SkyPilotConfigdataclass with validationnemo_automodel/components/launcher/skypilot/utils.py—submit_skypilot_job(): buildssky.Task, configures resources, callssky.launch()Modified files:
nemo_automodel/_cli/app.py—launch_with_skypilot()function and routing inmain()(mirrors SLURM pattern).gitignore— addsslurm_jobs/andskypilot_jobs/Docs & Examples:
docs/launcher/skypilot.md— setup guide, config reference, cloud-specific examplesexamples/llm_finetune/llama3_2/llama3_2_1b_squad_skypilot.yaml— ready-to-run GCP exampleTesting
37 new unit tests, zero regressions:
test_skypilot_config.pytest_skypilot_utils.pytest_skypilot_app.pyAll
skycalls are mocked — no cloud credentials needed for CI.Design Notes
skyis imported lazily (only when SkyPilot backend is used). Users without SkyPilot installed won't see import errors.skypilot:key = existing behaviour unchanged.Next Steps
Ready for review and the cloud validation on SkyPilot infrastructure.