davanstrien HF Staff commited on
Commit
6dbd514
·
1 Parent(s): 71d6f99
Files changed (2) hide show
  1. README.md +101 -0
  2. network-speed-test.py +1 -1
README.md ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ viewer: false
3
+ tags:
4
+ - uv-script
5
+ - huggingface-jobs
6
+ - utilities
7
+ - benchmarking
8
+ license: apache-2.0
9
+ ---
10
+
11
+ # HF Jobs Utilities
12
+
13
+ Utility scripts for testing and benchmarking Hugging Face Jobs environments. These scripts help you verify your Jobs setup and understand the performance characteristics of different GPU flavors.
14
+
15
+ ## Available Scripts
16
+
17
+ ### network-speed-test.py
18
+
19
+ Test network download speed from within an HF Jobs environment. Useful for:
20
+ - Verifying network connectivity
21
+ - Comparing download speeds across different GPU flavors
22
+ - Benchmarking before running large dataset downloads
23
+ - Troubleshooting slow data loading issues
24
+
25
+ **Features:**
26
+ - Pure Python (no dependencies required)
27
+ - Fast default test with small file
28
+ - Optional `--large` flag for realistic ~100MB test
29
+ - Clear metrics (MB/s and Mbps)
30
+ - Works locally or on HF Jobs
31
+
32
+ #### Usage
33
+
34
+ **Run locally:**
35
+ ```bash
36
+ # Quick test with small file
37
+ uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/network-speed-test.py
38
+
39
+ # More realistic test with ~100MB file
40
+ uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/network-speed-test.py --large
41
+
42
+ # Custom URL
43
+ uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/network-speed-test.py \
44
+ --url https://example.com/testfile.bin
45
+ ```
46
+
47
+ **Run on HF Jobs:**
48
+ ```bash
49
+ # Test network speed on L4 GPU
50
+ hfjobs run --flavor l4x1 \
51
+ -s HF_TOKEN \
52
+ uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/network-speed-test.py --large
53
+
54
+ # Compare across different flavors
55
+ hfjobs run --flavor a10 \
56
+ -s HF_TOKEN \
57
+ uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/network-speed-test.py --large
58
+
59
+ hfjobs run --flavor h100 \
60
+ -s HF_TOKEN \
61
+ uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/network-speed-test.py --large
62
+ ```
63
+
64
+ #### Example Output
65
+
66
+ ```
67
+ Using large file test (~100MB)
68
+ ============================================================
69
+ HF Jobs Network Speed Test
70
+ ============================================================
71
+
72
+ Testing download speed from: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/pytorch_model.bin
73
+ Downloading...
74
+
75
+ ============================================================
76
+ Results:
77
+ ============================================================
78
+ Downloaded: 86.68 MB
79
+ Time: 2.79 seconds
80
+ Speed: 31.03 MB/s (260.31 Mbps)
81
+ ============================================================
82
+ ```
83
+
84
+ ## Why These Utilities?
85
+
86
+ HF Jobs provides different GPU flavors with varying network configurations. These utilities help you:
87
+
88
+ 1. **Make informed decisions** - Compare network speeds before choosing a flavor
89
+ 2. **Debug issues** - Verify network connectivity when data loading is slow
90
+ 3. **Optimize workflows** - Understand if network speed is a bottleneck
91
+ 4. **Benchmark environments** - Document baseline performance for your use case
92
+
93
+ ## About UV Scripts
94
+
95
+ This is part of the [uv-scripts](https://huggingface.co/uv-scripts) collection - ready-to-run Python scripts that work with a single `uv run` command. No setup, no virtual environments, just instant execution.
96
+
97
+ Learn more about UV: https://docs.astral.sh/uv/
98
+
99
+ ## License
100
+
101
+ Apache 2.0
network-speed-test.py CHANGED
@@ -16,7 +16,7 @@ Usage:
16
 
17
  # Run on HF Jobs
18
  hfjobs run --flavor l4x1 \
19
- -e HF_TOKEN=$(python3 -c "from huggingface_hub import get_token; print(get_token())") \
20
  uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/network-speed-test.py
21
 
22
  Example output:
 
16
 
17
  # Run on HF Jobs
18
  hfjobs run --flavor l4x1 \
19
+ -s HF_TOKEN \
20
  uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/network-speed-test.py
21
 
22
  Example output: