computefence 0.3.2__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {computefence-0.3.2 → computefence-0.3.4}/PKG-INFO +76 -69
  2. {computefence-0.3.2 → computefence-0.3.4}/README.md +75 -68
  3. computefence-0.3.4/computefence/__init__.py +1 -0
  4. computefence-0.3.4/computefence/checks/environment.py +147 -0
  5. {computefence-0.3.2 → computefence-0.3.4}/computefence/cli.py +17 -3
  6. {computefence-0.3.2 → computefence-0.3.4}/computefence.egg-info/PKG-INFO +76 -69
  7. {computefence-0.3.2 → computefence-0.3.4}/computefence.egg-info/SOURCES.txt +2 -1
  8. computefence-0.3.4/tests/test_arch_compat.py +80 -0
  9. computefence-0.3.2/computefence/__init__.py +0 -1
  10. computefence-0.3.2/computefence/checks/environment.py +0 -307
  11. {computefence-0.3.2 → computefence-0.3.4}/LICENSE +0 -0
  12. {computefence-0.3.2 → computefence-0.3.4}/computefence/checks/__init__.py +0 -0
  13. {computefence-0.3.2 → computefence-0.3.4}/computefence/checks/dataset.py +0 -0
  14. {computefence-0.3.2 → computefence-0.3.4}/computefence/checks/storage.py +0 -0
  15. {computefence-0.3.2 → computefence-0.3.4}/computefence/drift.py +0 -0
  16. {computefence-0.3.2 → computefence-0.3.4}/computefence/telemetry.py +0 -0
  17. {computefence-0.3.2 → computefence-0.3.4}/computefence.egg-info/dependency_links.txt +0 -0
  18. {computefence-0.3.2 → computefence-0.3.4}/computefence.egg-info/entry_points.txt +0 -0
  19. {computefence-0.3.2 → computefence-0.3.4}/computefence.egg-info/requires.txt +0 -0
  20. {computefence-0.3.2 → computefence-0.3.4}/computefence.egg-info/top_level.txt +0 -0
  21. {computefence-0.3.2 → computefence-0.3.4}/pyproject.toml +0 -0
  22. {computefence-0.3.2 → computefence-0.3.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: computefence
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Don't lose another RunPod checkpoint to ephemeral disk before your job bills.
5
5
  License-Expression: MIT
6
6
  Keywords: runpod,vast.ai,gpu training,hf_home,cuda,preflight,machine learning,mlops,checkpoint
@@ -16,6 +16,12 @@ Dynamic: license-file
16
16
 
17
17
  [![ComputeFence Action](https://img.shields.io/badge/GitHub%20Action-computefence--action-blue)](https://github.com/Francisco-Booth/computefence-action)
18
18
 
19
+ ## Sponsor
20
+
21
+ If ComputeFence saves you a failed run, consider sponsoring: [github.com/sponsors/Francisco-Booth](https://github.com/sponsors/Francisco-Booth)
22
+
23
+ **$99 design partner spot** — priority fixes, monthly call, refunded if it finds nothing on your first job. [Apply via Stripe](https://buy.stripe.com/7sY00ib6IcTc1PD6PdaEE05)
24
+
19
25
  # ComputeFence
20
26
 
21
27
  **Stop paying for silent failures.**
@@ -40,18 +46,17 @@ uvx computefence doctor
40
46
 
41
47
  ---
42
48
 
43
-
44
49
  ## ☁️ RunPod One-Click Template
45
50
 
46
- If you train on RunPod, use the pre-built community template — ComputeFence is pre-installed and runs automatically on pod start.
51
+ If you train on RunPod, use the pre-built community template — ComputeFence runs automatically on pod start.
47
52
 
48
53
  **[→ Launch ComputeFence Pre-Flight Template](https://runpod.io/console/deploy?template=cq5psqzck6)**
49
54
 
50
55
  - Runs `computefence doctor` on every pod start
51
- - Logs preflight output to `/workspace/computefence-preflight.log`
52
56
  - `HF_HOME` set to `/workspace/.cache/huggingface` by default
53
57
  - Persistent `/workspace` volume included
54
58
 
59
+ ---
55
60
 
56
61
  ## Usage
57
62
 
@@ -71,14 +76,52 @@ With checkpoint directory validation:
71
76
  computefence doctor --output-dir ./checkpoints
72
77
  ```
73
78
 
79
+ Skip specific checks by ID:
80
+
81
+ ```bash
82
+ computefence doctor --skip accelerate_config,persistent_volume
83
+ ```
84
+
85
+ JSON output for scripting:
86
+
87
+ ```bash
88
+ computefence doctor --json
89
+ ```
90
+
74
91
  Add to your pod startup script so it runs automatically before every job:
75
92
 
76
93
  ```bash
77
- pip install computefence && computefence doctor && python train.py
94
+ pip install computefence==0.3.3 && computefence doctor && python train.py
78
95
  ```
79
96
 
80
97
  ---
81
98
 
99
+ ## Exit codes
100
+
101
+ | Code | Meaning |
102
+ |---|---|
103
+ | 0 | All checks passed |
104
+ | 1 | Warnings — review before launching |
105
+ | 2 | Blockers — fix before launching |
106
+ | 64 | Usage error (unknown command) |
107
+
108
+ ---
109
+
110
+ ## What It Checks / What It Doesn't
111
+
112
+ | Checks | Does not check |
113
+ |---|---|
114
+ | PyTorch can see the GPU (silent CPU fallback) | Training script correctness |
115
+ | GPU architecture compatible with PyTorch build | Model architecture compatibility |
116
+ | HuggingFace cache on persistent storage | Learning rate or hyperparameters |
117
+ | Accelerate GPU count matches instance | Runtime behaviour during the job |
118
+ | Disk space headroom (warn <20 GB, block <5 GB) | GPU utilisation or dataloader throughput |
119
+ | Checkpoint output dir on persistent storage | Mid-run pod failures |
120
+ | Dataset duplicates, missing values, label conflicts | Export-stage OOM |
121
+ | Environment drift between pods | Merge integrity |
122
+
123
+ ---
124
+
82
125
  ## Drift Detection
83
126
 
84
127
  Save a fingerprint of your working environment after a clean run:
@@ -93,7 +136,7 @@ On your next pod, check whether anything has changed:
93
136
  computefence doctor --check-drift
94
137
  ```
95
138
 
96
- Example output when the pod environment has drifted:
139
+ Example drift output:
97
140
 
98
141
  Drift
99
142
  ⚠ [Drift] PyTorch version changed: 2.4.0+cu121 → 2.8.0+cu128
@@ -104,19 +147,19 @@ Fix: Ensure your pod template uses the same CUDA base image.
104
147
  Fix: Check your pod configuration matches the saved environment.
105
148
 
106
149
 
107
- Drift findings are warnings only — they never block a launch. The fingerprint is written to `.computefence-lock.json` on your persistent volume (`/workspace` or `--path` to override). It survives pod stop and restart.
150
+ Drift findings are warnings only — they never block a launch. The fingerprint is written to `.computefence-lock.json` on your persistent volume (`/workspace` or `--path` to override).
108
151
 
109
152
  ---
110
153
 
111
154
  ## Example Output
112
155
 
113
- ComputeFence v0.2.14 — Pre-flight diagnostic
156
+ ComputeFence v0.3.3 — Pre-flight diagnostic
114
157
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
115
158
  2 WARNINGS · 0 BLOCKERS · 6 PASSED
116
159
 
117
160
  Environment
118
- ✓ Python 3.12.3
119
- ✓ PyTorch 2.8.0+cu128 detected (CUDA available — NVIDIA RTX PRO 4500)
161
+ ✓ Python 3.11.0
162
+ ✓ PyTorch 2.4.1+cu124 detected (CUDA available — NVIDIA A40)
120
163
  ⚠ No Accelerate config found — skipping GPU count check
121
164
  Fix: Run ‘accelerate config’ to create a configuration file
122
165
 
@@ -132,57 +175,28 @@ Fix: Run with --dataset path/to/your/dataset.csv to enable dataset checks
132
175
 
133
176
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
134
177
  2 warning(s) found. Review before launching.
178
+ Pseudonymous run stats are not collected by default. To opt in: touch ~/.computefence_telemetry
135
179
 
136
- Anonymous run stats are collected to improve ComputeFence.
137
- To opt out: touch ~/.computefence_no_telemetry
138
-
139
-
140
- ---
141
-
142
- ## What It Checks
143
-
144
- **CUDA and GPU visibility**
145
- Confirms PyTorch can see the GPU. Catches silent CPU fallback before it runs for eight hours at 24 seconds per iteration instead of 0.4.
146
-
147
- **HuggingFace cache path**
148
- Confirms model weights are writing to persistent storage. If HF_HOME points to ephemeral disk your weights disappear when the pod stops.
149
-
150
- **Accelerate GPU count**
151
- Confirms your distributed training config matches the GPUs actually on the instance. A mismatch leaves GPUs idle for the entire run with no error message.
152
-
153
- **Disk space headroom**
154
- Checks free space on workspace volumes and root disk. Warns below 20 GB. Blocks below 5 GB. Catches the failure where checkpoints stop saving at 90 percent completion because the disk filled.
155
-
156
- **Checkpoint output directory**
157
- Confirms your training script's output path is on persistent storage not ephemeral disk. HF_HOME and your checkpoint directory are separate paths — fixing one does not fix the other.
158
-
159
- **Dataset integrity**
160
- Optional scan for duplicates, missing values, and conflicting labels. Pass --dataset to enable.
161
-
162
- **Environment drift detection**
163
- Saves a 4-vector fingerprint (PyTorch/CUDA version, storage paths, GPU count and compute capability, critical library versions) and diffs it on the next pod. Catches silent environment changes between runs.
164
180
 
165
181
  ---
166
182
 
167
- ## What It Does Not Check
183
+ ## Telemetry
168
184
 
169
- - Training script correctness
170
- - Model architecture compatibility
171
- - Learning rate or hyperparameter safety
172
- - Runtime behaviour during the job
173
- - GPU utilisation or dataloader throughput during training
185
+ Opt-in pseudonymous run statistics. Nothing is sent by default.
174
186
 
175
- ComputeFence addresses the job configuration layer before launch. It does not monitor the run.
187
+ To opt in:
176
188
 
177
- ---
189
+ ```bash
190
+ touch ~/.computefence_telemetry
191
+ ```
178
192
 
179
- ## Why This Exists
193
+ To opt out if previously opted in, or to honour `DO_NOT_TRACK`:
180
194
 
181
- I burned approximately £1,000 on GPU training runs that failed silently.
195
+ ```bash
196
+ DO_NOT_TRACK=1 computefence doctor
197
+ ```
182
198
 
183
- CUDA fell back to CPU with no error message. 24 seconds per iteration instead of 0.4. Class weights caused loss to collapse to 0.693 immediately. My dataset had 28,432 duplicate rows and 312 conflicting labels I only found after the run finished.
184
-
185
- Nothing existed that caught these before the job started. So I built it.
199
+ No personal data, no file paths, no model weights. Fields sent: version, Python version, platform, GPU count, check results.
186
200
 
187
201
  ---
188
202
 
@@ -192,31 +206,19 @@ Nothing existed that caught these before the job started. So I built it.
192
206
 
193
207
  **Shahzeb Ali**, a computer vision engineer running client training jobs on RunPod, confirmed the storage warning matches real pod behaviour. He would not have caught the HF_HOME issue without the tool.
194
208
 
195
- **An independent Vast.ai operator** ran computefence doctor six times overnight before a real training job without being prompted or paid to do so.
209
+ **An independent Vast.ai operator** ran `computefence doctor` six times overnight before a real training job without being prompted or paid to do so.
196
210
 
197
211
  Thirteen independent ML engineers confirmed this problem across RunPod, Vast.ai, and AWS. Nine had lost checkpoints to ephemeral disk. Five confirmed Docker does not solve job-specific configuration mistakes.
198
212
 
199
213
  ---
200
214
 
201
- ## The Problem It Solves
202
-
203
- A healthy GPU does not mean you are running the right job.
204
-
205
- Docker makes environments reproducible. It does not check whether your HuggingFace cache is writing to ephemeral storage that disappears on pod stop, whether your Accelerate config matches the GPUs on the instance, or whether your checkpoint output directory is on persistent storage.
206
-
207
- ComputeFence addresses the job configuration layer — not the environment layer.
208
-
209
- HF_HOME and your checkpoint output directory are separate paths. Fixing one does not fix the other. Both disappear on pod restart if they point to ephemeral disk.
210
-
211
- ---
215
+ ## Why This Exists
212
216
 
213
- ## Telemetry
217
+ I burned approximately £1,000 on GPU training runs that failed silently.
214
218
 
215
- Anonymous run statistics are collected on every run to help improve ComputeFence. No personal data, no code, no model weights. To opt out:
219
+ CUDA fell back to CPU with no error message. 24 seconds per iteration instead of 0.4. Class weights caused loss to collapse to 0.693 immediately. My dataset had 28,432 duplicate rows and 312 conflicting labels I only found after the run finished.
216
220
 
217
- ```bash
218
- touch ~/.computefence_no_telemetry
219
- ```
221
+ Nothing existed that caught these before the job started. So I built it.
220
222
 
221
223
  ---
222
224
 
@@ -228,7 +230,6 @@ Three founding design partner spots at $99 for three months:
228
230
 
229
231
  - Personal audit of your launch templates and persistent storage configuration
230
232
  - ComputeFence installed into your pod startup scripts — pre-flight runs automatically before every job
231
- - Slack or Discord webhook alert when a check fails or blocks a launch
232
233
  - Monthly 30-minute call where you shape what gets built next
233
234
  - Money back if it does not catch one actionable issue in three months
234
235
 
@@ -236,6 +237,12 @@ Email francisco@booth.ws to apply.
236
237
 
237
238
  ---
238
239
 
240
+ ## Acknowledgements
241
+
242
+ Thanks to **Steve Simo** for a thorough independent security and code review of v0.3.1.
243
+
244
+ ---
245
+
239
246
  ## Links
240
247
 
241
248
  - GitHub: https://github.com/Francisco-Booth/ComputeFence
@@ -1,5 +1,11 @@
1
1
  [![ComputeFence Action](https://img.shields.io/badge/GitHub%20Action-computefence--action-blue)](https://github.com/Francisco-Booth/computefence-action)
2
2
 
3
+ ## Sponsor
4
+
5
+ If ComputeFence saves you a failed run, consider sponsoring: [github.com/sponsors/Francisco-Booth](https://github.com/sponsors/Francisco-Booth)
6
+
7
+ **$99 design partner spot** — priority fixes, monthly call, refunded if it finds nothing on your first job. [Apply via Stripe](https://buy.stripe.com/7sY00ib6IcTc1PD6PdaEE05)
8
+
3
9
  # ComputeFence
4
10
 
5
11
  **Stop paying for silent failures.**
@@ -24,18 +30,17 @@ uvx computefence doctor
24
30
 
25
31
  ---
26
32
 
27
-
28
33
  ## ☁️ RunPod One-Click Template
29
34
 
30
- If you train on RunPod, use the pre-built community template — ComputeFence is pre-installed and runs automatically on pod start.
35
+ If you train on RunPod, use the pre-built community template — ComputeFence runs automatically on pod start.
31
36
 
32
37
  **[→ Launch ComputeFence Pre-Flight Template](https://runpod.io/console/deploy?template=cq5psqzck6)**
33
38
 
34
39
  - Runs `computefence doctor` on every pod start
35
- - Logs preflight output to `/workspace/computefence-preflight.log`
36
40
  - `HF_HOME` set to `/workspace/.cache/huggingface` by default
37
41
  - Persistent `/workspace` volume included
38
42
 
43
+ ---
39
44
 
40
45
  ## Usage
41
46
 
@@ -55,14 +60,52 @@ With checkpoint directory validation:
55
60
  computefence doctor --output-dir ./checkpoints
56
61
  ```
57
62
 
63
+ Skip specific checks by ID:
64
+
65
+ ```bash
66
+ computefence doctor --skip accelerate_config,persistent_volume
67
+ ```
68
+
69
+ JSON output for scripting:
70
+
71
+ ```bash
72
+ computefence doctor --json
73
+ ```
74
+
58
75
  Add to your pod startup script so it runs automatically before every job:
59
76
 
60
77
  ```bash
61
- pip install computefence && computefence doctor && python train.py
78
+ pip install computefence==0.3.3 && computefence doctor && python train.py
62
79
  ```
63
80
 
64
81
  ---
65
82
 
83
+ ## Exit codes
84
+
85
+ | Code | Meaning |
86
+ |---|---|
87
+ | 0 | All checks passed |
88
+ | 1 | Warnings — review before launching |
89
+ | 2 | Blockers — fix before launching |
90
+ | 64 | Usage error (unknown command) |
91
+
92
+ ---
93
+
94
+ ## What It Checks / What It Doesn't
95
+
96
+ | Checks | Does not check |
97
+ |---|---|
98
+ | PyTorch can see the GPU (silent CPU fallback) | Training script correctness |
99
+ | GPU architecture compatible with PyTorch build | Model architecture compatibility |
100
+ | HuggingFace cache on persistent storage | Learning rate or hyperparameters |
101
+ | Accelerate GPU count matches instance | Runtime behaviour during the job |
102
+ | Disk space headroom (warn <20 GB, block <5 GB) | GPU utilisation or dataloader throughput |
103
+ | Checkpoint output dir on persistent storage | Mid-run pod failures |
104
+ | Dataset duplicates, missing values, label conflicts | Export-stage OOM |
105
+ | Environment drift between pods | Merge integrity |
106
+
107
+ ---
108
+
66
109
  ## Drift Detection
67
110
 
68
111
  Save a fingerprint of your working environment after a clean run:
@@ -77,7 +120,7 @@ On your next pod, check whether anything has changed:
77
120
  computefence doctor --check-drift
78
121
  ```
79
122
 
80
- Example output when the pod environment has drifted:
123
+ Example drift output:
81
124
 
82
125
  Drift
83
126
  ⚠ [Drift] PyTorch version changed: 2.4.0+cu121 → 2.8.0+cu128
@@ -88,19 +131,19 @@ Fix: Ensure your pod template uses the same CUDA base image.
88
131
  Fix: Check your pod configuration matches the saved environment.
89
132
 
90
133
 
91
- Drift findings are warnings only — they never block a launch. The fingerprint is written to `.computefence-lock.json` on your persistent volume (`/workspace` or `--path` to override). It survives pod stop and restart.
134
+ Drift findings are warnings only — they never block a launch. The fingerprint is written to `.computefence-lock.json` on your persistent volume (`/workspace` or `--path` to override).
92
135
 
93
136
  ---
94
137
 
95
138
  ## Example Output
96
139
 
97
- ComputeFence v0.2.14 — Pre-flight diagnostic
140
+ ComputeFence v0.3.3 — Pre-flight diagnostic
98
141
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
99
142
  2 WARNINGS · 0 BLOCKERS · 6 PASSED
100
143
 
101
144
  Environment
102
- ✓ Python 3.12.3
103
- ✓ PyTorch 2.8.0+cu128 detected (CUDA available — NVIDIA RTX PRO 4500)
145
+ ✓ Python 3.11.0
146
+ ✓ PyTorch 2.4.1+cu124 detected (CUDA available — NVIDIA A40)
104
147
  ⚠ No Accelerate config found — skipping GPU count check
105
148
  Fix: Run ‘accelerate config’ to create a configuration file
106
149
 
@@ -116,57 +159,28 @@ Fix: Run with --dataset path/to/your/dataset.csv to enable dataset checks
116
159
 
117
160
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
118
161
  2 warning(s) found. Review before launching.
162
+ Pseudonymous run stats are not collected by default. To opt in: touch ~/.computefence_telemetry
119
163
 
120
- Anonymous run stats are collected to improve ComputeFence.
121
- To opt out: touch ~/.computefence_no_telemetry
122
-
123
-
124
- ---
125
-
126
- ## What It Checks
127
-
128
- **CUDA and GPU visibility**
129
- Confirms PyTorch can see the GPU. Catches silent CPU fallback before it runs for eight hours at 24 seconds per iteration instead of 0.4.
130
-
131
- **HuggingFace cache path**
132
- Confirms model weights are writing to persistent storage. If HF_HOME points to ephemeral disk your weights disappear when the pod stops.
133
-
134
- **Accelerate GPU count**
135
- Confirms your distributed training config matches the GPUs actually on the instance. A mismatch leaves GPUs idle for the entire run with no error message.
136
-
137
- **Disk space headroom**
138
- Checks free space on workspace volumes and root disk. Warns below 20 GB. Blocks below 5 GB. Catches the failure where checkpoints stop saving at 90 percent completion because the disk filled.
139
-
140
- **Checkpoint output directory**
141
- Confirms your training script's output path is on persistent storage not ephemeral disk. HF_HOME and your checkpoint directory are separate paths — fixing one does not fix the other.
142
-
143
- **Dataset integrity**
144
- Optional scan for duplicates, missing values, and conflicting labels. Pass --dataset to enable.
145
-
146
- **Environment drift detection**
147
- Saves a 4-vector fingerprint (PyTorch/CUDA version, storage paths, GPU count and compute capability, critical library versions) and diffs it on the next pod. Catches silent environment changes between runs.
148
164
 
149
165
  ---
150
166
 
151
- ## What It Does Not Check
167
+ ## Telemetry
152
168
 
153
- - Training script correctness
154
- - Model architecture compatibility
155
- - Learning rate or hyperparameter safety
156
- - Runtime behaviour during the job
157
- - GPU utilisation or dataloader throughput during training
169
+ Opt-in pseudonymous run statistics. Nothing is sent by default.
158
170
 
159
- ComputeFence addresses the job configuration layer before launch. It does not monitor the run.
171
+ To opt in:
160
172
 
161
- ---
173
+ ```bash
174
+ touch ~/.computefence_telemetry
175
+ ```
162
176
 
163
- ## Why This Exists
177
+ To opt out if previously opted in, or to honour `DO_NOT_TRACK`:
164
178
 
165
- I burned approximately £1,000 on GPU training runs that failed silently.
179
+ ```bash
180
+ DO_NOT_TRACK=1 computefence doctor
181
+ ```
166
182
 
167
- CUDA fell back to CPU with no error message. 24 seconds per iteration instead of 0.4. Class weights caused loss to collapse to 0.693 immediately. My dataset had 28,432 duplicate rows and 312 conflicting labels I only found after the run finished.
168
-
169
- Nothing existed that caught these before the job started. So I built it.
183
+ No personal data, no file paths, no model weights. Fields sent: version, Python version, platform, GPU count, check results.
170
184
 
171
185
  ---
172
186
 
@@ -176,31 +190,19 @@ Nothing existed that caught these before the job started. So I built it.
176
190
 
177
191
  **Shahzeb Ali**, a computer vision engineer running client training jobs on RunPod, confirmed the storage warning matches real pod behaviour. He would not have caught the HF_HOME issue without the tool.
178
192
 
179
- **An independent Vast.ai operator** ran computefence doctor six times overnight before a real training job without being prompted or paid to do so.
193
+ **An independent Vast.ai operator** ran `computefence doctor` six times overnight before a real training job without being prompted or paid to do so.
180
194
 
181
195
  Thirteen independent ML engineers confirmed this problem across RunPod, Vast.ai, and AWS. Nine had lost checkpoints to ephemeral disk. Five confirmed Docker does not solve job-specific configuration mistakes.
182
196
 
183
197
  ---
184
198
 
185
- ## The Problem It Solves
186
-
187
- A healthy GPU does not mean you are running the right job.
188
-
189
- Docker makes environments reproducible. It does not check whether your HuggingFace cache is writing to ephemeral storage that disappears on pod stop, whether your Accelerate config matches the GPUs on the instance, or whether your checkpoint output directory is on persistent storage.
190
-
191
- ComputeFence addresses the job configuration layer — not the environment layer.
192
-
193
- HF_HOME and your checkpoint output directory are separate paths. Fixing one does not fix the other. Both disappear on pod restart if they point to ephemeral disk.
194
-
195
- ---
199
+ ## Why This Exists
196
200
 
197
- ## Telemetry
201
+ I burned approximately £1,000 on GPU training runs that failed silently.
198
202
 
199
- Anonymous run statistics are collected on every run to help improve ComputeFence. No personal data, no code, no model weights. To opt out:
203
+ CUDA fell back to CPU with no error message. 24 seconds per iteration instead of 0.4. Class weights caused loss to collapse to 0.693 immediately. My dataset had 28,432 duplicate rows and 312 conflicting labels I only found after the run finished.
200
204
 
201
- ```bash
202
- touch ~/.computefence_no_telemetry
203
- ```
205
+ Nothing existed that caught these before the job started. So I built it.
204
206
 
205
207
  ---
206
208
 
@@ -212,7 +214,6 @@ Three founding design partner spots at $99 for three months:
212
214
 
213
215
  - Personal audit of your launch templates and persistent storage configuration
214
216
  - ComputeFence installed into your pod startup scripts — pre-flight runs automatically before every job
215
- - Slack or Discord webhook alert when a check fails or blocks a launch
216
217
  - Monthly 30-minute call where you shape what gets built next
217
218
  - Money back if it does not catch one actionable issue in three months
218
219
 
@@ -220,6 +221,12 @@ Email francisco@booth.ws to apply.
220
221
 
221
222
  ---
222
223
 
224
+ ## Acknowledgements
225
+
226
+ Thanks to **Steve Simo** for a thorough independent security and code review of v0.3.1.
227
+
228
+ ---
229
+
223
230
  ## Links
224
231
 
225
232
  - GitHub: https://github.com/Francisco-Booth/ComputeFence
@@ -0,0 +1 @@
1
+ __version__ = "0.3.4"
@@ -0,0 +1,147 @@
1
+ import os
2
+ import platform
3
+ import sys
4
+ from pathlib import Path
5
+
6
+
7
+ def describe_interpreter():
8
+ return {
9
+ "version": platform.python_version(),
10
+ "executable": sys.executable,
11
+ "prefix": sys.prefix,
12
+ "virtual_env": os.environ.get("VIRTUAL_ENV"),
13
+ }
14
+
15
+
16
+ def in_active_virtualenv(interpreter):
17
+ virtual_env = interpreter["virtual_env"]
18
+ if not virtual_env:
19
+ return None
20
+ try:
21
+ return Path(interpreter["prefix"]).resolve() == Path(virtual_env).resolve()
22
+ except OSError:
23
+ return interpreter["prefix"] == virtual_env
24
+
25
+
26
+ def detect_torch():
27
+ result = {
28
+ "available": False,
29
+ "version": None,
30
+ "location": None,
31
+ "cuda_available": False,
32
+ "device_count": 0,
33
+ "device_name": None,
34
+ "device_names": [],
35
+ "error": None,
36
+ }
37
+
38
+ try:
39
+ import torch
40
+ except ImportError:
41
+ return result
42
+ except Exception as exc:
43
+ result["error"] = exc
44
+ return result
45
+
46
+ result["available"] = True
47
+ result["version"] = getattr(torch, "__version__", "unknown")
48
+ result["location"] = getattr(torch, "__file__", None)
49
+
50
+ try:
51
+ result["cuda_available"] = torch.cuda.is_available()
52
+ except Exception as exc:
53
+ result["error"] = exc
54
+ return result
55
+
56
+ if result["cuda_available"]:
57
+ result["device_count"] = torch.cuda.device_count()
58
+ result["device_names"] = [
59
+ torch.cuda.get_device_name(i) for i in range(result["device_count"])
60
+ ]
61
+ if result["device_names"]:
62
+ result["device_name"] = result["device_names"][0]
63
+
64
+ return result
65
+
66
+
67
+ def check_gpu_arch_compat(torch_info):
68
+ """Check that each visible GPU's compute capability is supported by this PyTorch build."""
69
+ results = []
70
+ try:
71
+ import torch
72
+ if not torch_info["cuda_available"]:
73
+ return results
74
+
75
+ try:
76
+ arch_list = torch.cuda.get_arch_list()
77
+ except Exception:
78
+ return results
79
+
80
+ if not arch_list:
81
+ return results
82
+
83
+ # Parse arch_list into a set of (major, minor) tuples for membership checks.
84
+ # sm_90a and similar suffixed entries are skipped — they represent PTX variants,
85
+ # not distinct compute capabilities.
86
+ supported_caps = set()
87
+ for arch in arch_list:
88
+ if arch.startswith("sm_") and len(arch) > 3:
89
+ digits = arch[3:]
90
+ if len(digits) >= 2 and digits.isdigit():
91
+ try:
92
+ major = int(digits[:-1])
93
+ minor = int(digits[-1])
94
+ supported_caps.add((major, minor))
95
+ except ValueError:
96
+ pass
97
+
98
+ if not supported_caps:
99
+ return results
100
+
101
+ # Build the human-readable list from the original strings (not the parsed set)
102
+ # so the error message matches exactly what PyTorch reports.
103
+ supported_str = ", ".join(
104
+ arch for arch in arch_list if arch.startswith("sm_")
105
+ )
106
+
107
+ for i in range(torch_info["device_count"]):
108
+ name = torch_info["device_names"][i] if i < len(torch_info["device_names"]) else f"GPU {i}"
109
+ try:
110
+ cap = torch.cuda.get_device_capability(i)
111
+ except Exception:
112
+ continue
113
+
114
+ # Membership check: the GPU is compatible if and only if its exact
115
+ # compute capability appears in get_arch_list(). No ceiling comparison —
116
+ # the old ceiling logic incorrectly blocked Ada (sm_89) on cu124 builds
117
+ # whose list ends at sm_90.
118
+ compatible = cap in supported_caps
119
+
120
+ if not compatible:
121
+ results.append({
122
+ "id": f"gpu_arch_compat_{i}",
123
+ "status": "fail",
124
+ "message": (
125
+ f"{name} has compute capability sm_{cap[0]}{cap[1]}, "
126
+ f"which is not supported by this PyTorch build "
127
+ f"(supported by this build: {supported_str})"
128
+ ),
129
+ "fix": (
130
+ f"Install a PyTorch build that supports sm_{cap[0]}{cap[1]}: "
131
+ f"see https://pytorch.org/get-started/locally/"
132
+ ),
133
+ })
134
+ else:
135
+ results.append({
136
+ "id": f"gpu_arch_compat_{i}",
137
+ "status": "pass",
138
+ "message": (
139
+ f"{name} compute capability sm_{cap[0]}{cap[1]} "
140
+ f"is supported by this PyTorch build"
141
+ ),
142
+ })
143
+
144
+ except Exception:
145
+ pass
146
+
147
+ return results