verification that we have at least 2 gpus to run dist examples
(min_gpus: int = 2)
| 8 | from utils import inspect_mixed_precision, inspect_model |
| 9 | |
| 10 | def verify_min_gpu_count(min_gpus: int = 2) -> bool: |
| 11 | """ verification that we have at least 2 gpus to run dist examples """ |
| 12 | has_gpu = torch.accelerator.is_available() |
| 13 | gpu_count = torch.accelerator.device_count() |
| 14 | return has_gpu and gpu_count >= min_gpus |
| 15 | |
| 16 | def set_modules_to_forward_prefetch(model, num_to_forward_prefetch): |
| 17 | for i, layer in enumerate(model.layers): |