Skip to main content
Keep datasets and checkpoints in SF Compute (SFC) object storage, close to your compute. Buckets hold your files, and tools built for S3-compatible object stores, such as rclone and boto3, read and write to them. Upload data from your laptop or another storage provider, then use it on SFC instances. Uploaded data stays after an instance terminates.

Create a bucket and access key

Create a bucket for your data and an access key that your tools use to reach it. Creating and deleting buckets and access keys in a workspace requires a role that allows the bucket and access_key resources there. The built-in admin, operator, and workspace-admin roles allow both. Creating buckets and access keys requires your organization to set up billing. Have a team member with the admin or billing role complete the following under Billing in the console:
  • A billing profile
  • A primary billing contact
  • A card set as the default payment method
Billing page with the Payment Methods, Billing Profile, and Billing Contacts sections, and a card marked Default
The examples use the europe-north1 region and your active workspace. Replace acme-training-data throughout with your own bucket name.
Object storage isn’t available in every region. The console and CLI list supported regions when you create a bucket. If you need storage in a region we don’t support yet, contact us.
Install sf and log in, then create a bucket and key in the same region.
Save the returned access key ID and secret in your secrets manager. sf shows the secret only once.
You may reuse an existing access key if it’s in the same workspace and region as the bucket.
An access key can read and write every bucket in its workspace and region. Use separate workspaces when you need separate access boundaries.

Set your storage credentials

Set these variables on your laptop and on each instance that uses the bucket. Find the endpoint in the bucket’s Access bucket panel or with sf storage buckets get acme-training-data.
Access bucket panel showing the rclone snippet with the bucket endpoint
sf storage access-key create --format env and the console’s Access bucket snippets print AWS_* names instead. Rename them as shown so they don’t override your existing AWS credentials.

Bring your dataset to SFC

Copy your dataset into the bucket with rclone, then copy it onto each instance that trains on it. Run these commands on your laptop or the machine doing the transfer. Install rclone, then configure an SFC remote with your storage credentials.
Choose your source:
Copy your dataset into a versioned directory in the bucket.
Rerun copy to transfer new or changed files. Use a new directory such as datasets/v2 for a new dataset version. To mirror the source exactly, use rclone sync; it also deletes destination files absent from the source.

Use the dataset on an instance

Connect to your instance, set your storage credentials, and configure rclone as above. Copy the dataset onto its local disk before starting training.
Point your training data loader at ~/datasets/v1. Repeat on each instance that needs a local copy.

Save and resume training checkpoints

From an SFC instance, save checkpoints to object storage in the same region as your training job. Checkpoints in object storage stay available when you move to another instance or start another run. With PyTorch already installed, run python -m pip install boto3 in your training environment. Set your storage credentials there. Add this to your training loop, where model, optimizer, and step are your current training state:
Use a different run directory for each job. Upload only completed checkpoints; for distributed training, coordinate the writers so they don’t overwrite each other. Wait for the upload to succeed before terminating the instance. On a fresh instance, recreate the model and optimizer, configure the S3 client as above, and restore a completed checkpoint:
Include any other state your job needs to resume, such as its learning-rate scheduler. See PyTorch checkpointing. To retrieve a run on your own machine, use the same rclone remote:

Manage buckets and access keys

List buckets and keys with sf storage buckets list and sf storage access-key list, or open Storage in the console. Revoke a key with sf storage access-key delete training, or open Storage → Access keys and click Revoke Key.
Access keys tab with the actions menu open for the training key, showing Revoke Key
When you no longer need a bucket, run sf storage buckets delete acme-training-data or select Delete Bucket in Storage. Confirm the name when prompted. Deletion removes the bucket and all its objects.
Buckets tab with the actions menu open for acme-training-data, showing Delete Bucket
Deleting a bucket is permanent. Its name becomes available for anyone to claim.

Bucket and access key limits

SF Compute enforces these limits on buckets and access keys: During rollout, some buckets still have a 100 TiB limit. Existing bucket limits are unchanged.

Usage and billing

SF Compute measures the bytes stored in each bucket hourly. Storage costs $0.14 per GiB-month, prorated by amount stored and time kept. For example, 100 GiB for a full calendar month costs $14, and for half that month it costs $7. SF Compute invoices storage after each UTC calendar month and charges your default card when the invoice is due, 7 days after sending it. Storage charges are separate from prepaid compute credits. Track usage and month-to-date cost under Usage → Storage in the console.
Usage page on the Storage tab, with stored bytes per bucket by day and month-to-date cost per bucket
View invoices on the Billing page.
Invoices section of the Billing page, listing each billing month with its status, total, and due date

API reference

The SF Compute API doesn’t manage buckets or access keys yet. Use sf storage to script them, or contact us if you need programmatic access.