File size: 950 Bytes
10d04fd
 
 
 
 
 
faf2b11
939d4af
 
faf2b11
10d04fd
939d4af
 
10d04fd
 
 
 
 
 
 
 
 
faf2b11
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
license: mit
language:
- en
pretty_name: minimal-distribution
---

# Run distributed programs on the HF infra

This is a collection of scripts that showcase minimal examples of distributed programming. All the scripts are taken from [The Ultra-Scale Playbook](https://huggingface.co/spaces/nanotron/ultrascale-playbook)

## Run the scripts

To run an example on HF's infra use the following:
```
hf jobs run --detach --flavor l4x4 ghcr.io/astral-sh/uv:debian /bin/bash -c \
  "uv venv .venv --python 3.12 && \
  source .venv/bin/activate && \
  uv pip install --upgrade torch numpy && \
  wget https://huggingface.co/datasets/ariG23498/distributed/raw/main/<SCRIPT_NAME> && \
  torchrun --nproc-per-node=4 <SCRIPT_NAME>"
```
Rememeber to replace the `<SCRIPT_NAME>` with the script that you want to run.

You would need a Pro account to run the script on Hugging Face's Infra. To know more: https://huggingface.co/docs/huggingface_hub/guides/jobs