Download toolkits/70b_dynamic_budget_data2000_v5/gpu_probe.py from koreallmdev/dgx-harness-engineering: direct link, hf CLI and curl.
- Browser
- Download file 534 Bytes
-
https://huggingface.co/koreallmdev/dgx-harness-engineering/resolve/main/toolkits/70b_dynamic_budget_data2000_v5/gpu_probe.py
- Command line
-
hf download hf://koreallmdev/dgx-harness-engineering/toolkits/70b_dynamic_budget_data2000_v5/gpu_probe.py
-
curl -L -o gpu_probe.py https://huggingface.co/koreallmdev/dgx-harness-engineering/resolve/main/toolkits/70b_dynamic_budget_data2000_v5/gpu_probe.py
534 Bytes
| #!/usr/bin/env python3 | |
| import json, torch | |
| o={"ok":bool(torch.cuda.is_available())} | |
| if torch.cuda.is_available(): | |
| f,t=torch.cuda.mem_get_info() | |
| G=1024**3 | |
| o.update({ | |
| "free_gib":f/G, | |
| "total_gib":t/G, | |
| "used_gib":(t-f)/G, | |
| "free_ratio":f/t, | |
| "device_name":torch.cuda.get_device_name(0), | |
| "torch_allocated_gib":torch.cuda.memory_allocated()/G, | |
| "torch_reserved_gib":torch.cuda.memory_reserved()/G, | |
| }) | |
| print(json.dumps(o,indent=2)) | |
| node-7.example.invalid SystemExit(0 if o["ok"] else 2) | |