(message, force=False)
| 308 | |
| 309 | |
| 310 | def see_memory_usage(message, force=False): |
| 311 | if not force: |
| 312 | return |
| 313 | dist.barrier() |
| 314 | if dist.get_rank() == 0: |
| 315 | print(message) |
| 316 | print("Memory Allocated ", torch.cuda.memory_allocated() / (1024 * 1024 * 1024), "GigaBytes") |
| 317 | print("Max Memory Allocated ", torch.cuda.max_memory_allocated() / (1024 * 1024 * 1024), "GigaBytes") |
| 318 | print("Cache Allocated ", torch.cuda.memory_cached() / (1024 * 1024 * 1024), "GigaBytes") |
| 319 | print("Max cache Allocated ", torch.cuda.max_memory_cached() / (1024 * 1024 * 1024), "GigaBytes") |
| 320 | print(" ") |
| 321 | # input("Press Any Key To Continue ..") |
| 322 | |
| 323 | |
| 324 | def train_step(data_iterator, model, optimizer, lr_scheduler, args, timers, forward_step_func, mems=None, |
nothing calls this directly
no outgoing calls
no test coverage detected