Skip to content

feat: add SkyPilot as a cloud execution backend for AutoModel - #1590

Merged
akoumpa merged 2 commits into
NVIDIA-NeMo:mainfrom
Anakintano:main
Mar 27, 2026
Merged

akoumpa merged 2 commits into
NVIDIA-NeMo:mainfrom
Anakintano:main

Conversation

@Anakintano

@Anakintano Anakintano commented Mar 21, 2026 •

Copy link
Copy Markdown
Contributor

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 same automodel 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

skypilot:
  cloud: gcp            # aws | gcp | azure | lambda | kubernetes
  accelerators: T4:1    # GPU type:count per node
  use_spot: true        # ~80% cost reduction vs on-demand
  num_nodes: 1
  hf_token: ${HF_TOKEN}

Then run: automodel finetune llm -c config.yaml

Implementation

New files:

  • nemo_automodel/components/launcher/skypilot/config.py — SkyPilotConfig dataclass with validation
  • nemo_automodel/components/launcher/skypilot/utils.py — submit_skypilot_job(): builds sky.Task, configures resources, calls sky.launch()

Modified files:

  • nemo_automodel/_cli/app.py — launch_with_skypilot() function and routing in main() (mirrors SLURM pattern)
  • .gitignore — adds slurm_jobs/ and skypilot_jobs/

Docs & Examples:

  • docs/launcher/skypilot.md — setup guide, config reference, cloud-specific examples
  • examples/llm_finetune/llama3_2/llama3_2_1b_squad_skypilot.yaml — ready-to-run GCP example

Testing

37 new unit tests, zero regressions:

Test File Count Status
test_skypilot_config.py 12 ✅ pass
test_skypilot_utils.py 15 ✅ pass
test_skypilot_app.py 10 ✅ pass

All sky calls are mocked — no cloud credentials needed for CI.

Design Notes

  • Soft dependency: sky is imported lazily (only when SkyPilot backend is used). Users without SkyPilot installed won't see import errors.
  • Backward compatible: No skypilot: key = existing behaviour unchanged.
  • Follows existing patterns: Implementation mirrors the SLURM launcher (modular, optional, clean routing).

Next Steps

Ready for review and the cloud validation on SkyPilot infrastructure.

@copy-pr-bot

copy-pr-bot Bot commented Mar 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@akoumpa

akoumpa commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

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!

@akoumpa
akoumpa requested review from a team and pthombre as code owners March 23, 2026 17:58
@akoumpa

akoumpa commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

/ok to test e407209

@jgerh jgerh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed a tech pubs review, provided copyedits, converted procedure headings into steps, revised one heading title, and flagged use of horizontal lines for removal

Comment thread docs/launcher/skypilot.md Outdated

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.

---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete horizontal line --- and close up blank lines

Comment thread docs/launcher/skypilot.md Outdated
export WANDB_API_KEY=... # Optional: Weights & Biases logging
```

---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete horizontal line --- and close up blank lines

Comment thread docs/launcher/skypilot.md Outdated

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.

---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete horizontal line --- and close up blank lines

Comment thread docs/launcher/skypilot.md Outdated
| `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` |

---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete horizontal line --- and close up blank lines

Comment thread docs/launcher/skypilot.md Outdated

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.

---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete horizontal line --- and close up blank lines

Comment thread docs/launcher/skypilot.md Outdated
Comment thread docs/launcher/skypilot.md Outdated
Comment thread docs/launcher/skypilot.md Outdated
Comment thread docs/launcher/skypilot.md Outdated
Comment thread docs/launcher/skypilot.md Outdated
@akoumpa

akoumpa commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

/ok to test 49af132

@romilbhardwaj

Copy link
Copy Markdown

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!

We (SkyPilot) would love to welcome a PR adding a automodel example! :)

@akoumpa

akoumpa commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

/ok to test 073a18d

@akoumpa

akoumpa commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

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.

@Anakintano

Copy link
Copy Markdown
Contributor Author

Thanks for the offer! 😀 @akoumpa & @romilbhardwaj I'm definitely interested in adding the AutoModel
example to SkyPilot. Feel free to go ahead if it's urgent on your end,
otherwise I can handle it soon. Happy either way!

@akoumpa

akoumpa commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

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!

@akoumpa

akoumpa commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

/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>
@akoumpa

akoumpa commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

/ok to test f099c42

@akoumpa

akoumpa commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

/ok to test b47ed50

This branch was previously deployed

2 inactive deployments
nemo-ci — b47ed501 Deployed Mar 26, 2026 by copy-pr-bot[bot] via L2_HF_PEFT #4786
test — b47ed501 Deployed Mar 25, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #4786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Skypilot

6 participants