-
Notifications
You must be signed in to change notification settings - Fork 473
Add SkyPilot to storage bucket integrations #2644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alex000kim
wants to merge
1
commit into
huggingface:main
Choose a base branch
from
alex000kim:add-skypilot-storage-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+43
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,48 @@ inspect view | |
|
|
||
| See [Inspect's eval logs guide](https://inspect.aisi.org.uk/eval-logs.html#sec-hugging-face-storage-buckets) for details. | ||
|
|
||
| ## SkyPilot | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might make sense to move this to its own page, but cc @davanstrien wdyt |
||
|
|
||
| [SkyPilot](https://docs.skypilot.co/) runs AI workloads across 20+ clouds, Kubernetes, and on-prem, and can use Hugging Face storage as a backend — so one bucket is readable from every cloud with no per-cloud copies. Set `store: hf` on a `file_mounts` entry to mount a bucket read-write or a repo read-only: | ||
|
|
||
| ```yaml | ||
| # qwen-sft.yaml — launch anywhere: sky launch qwen-sft.yaml --infra aws|gcp|... | ||
| resources: | ||
| accelerators: H100:1 | ||
|
|
||
| file_mounts: | ||
| /base-model: | ||
| source: hf://Qwen/Qwen2.5-3B # model repo, read-only | ||
| store: hf | ||
| mode: MOUNT | ||
| /data: | ||
| source: hf://datasets/username/my-data@v1.0 # dataset repo, pinned to a tag, read-only | ||
| store: hf | ||
| mode: MOUNT | ||
| /checkpoints: | ||
| source: hf://buckets/username/qwen-sft # bucket, read-write — checkpoints sync back | ||
| store: hf | ||
| mode: MOUNT | ||
|
|
||
| run: | | ||
| python train.py --model /base-model --output_dir /checkpoints | ||
| ``` | ||
|
|
||
| Authenticate once - `hf auth login` (or `export HF_TOKEN=<your-token>`) is all SkyPilot needs. It forwards your local Hugging Face token to every cloud, so the bucket and repo mounts authenticate automatically: | ||
|
|
||
| ```bash | ||
| pip install "skypilot[huggingface]" | ||
| hf auth login # or: export HF_TOKEN=<your-token> | ||
| sky launch qwen-sft.yaml | ||
| ``` | ||
|
|
||
| If your own `run` code pulls gated repos, add `--secret HF_TOKEN` to the launch command to also expose the token as an env var. | ||
|
|
||
| > [!TIP] | ||
| > `MOUNT` and `MOUNT_CACHED` behave identically for `hf` and use the [hf-mount](https://github.com/huggingface/hf-mount) FUSE backend, which needs a base image with glibc ≥ 2.34 and `/dev/fuse`. Bare-VM clouds provide both. SkyPilot's default Kubernetes image ships older glibc, so set a newer `image_id` (e.g. `docker:mirror.gcr.io/ubuntu:22.04`). See the [SkyPilot storage docs](https://docs.skypilot.co/en/latest/reference/storage.html) for the current environment requirements. | ||
|
|
||
| See the [SkyPilot + Hugging Face storage blog post](https://huggingface.co/blog/skypilot-hf-storage) for benchmarks and a full walkthrough. | ||
|
|
||
| ## Filesystem operations | ||
|
|
||
| For direct file operations, `huggingface_hub` exposes a pre-instantiated [filesystem object](/docs/huggingface_hub/guides/hf_file_system), `hffs`: | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more natural to move this at the end of the list imo