()
| 156 | print_all(f"state: {name}, min: {s.min()}, max: {s.max()}, mean: {s.mean()}, std: {s.std()}, scale: {s.abs().mean()}, first5: {s.flatten()[:5]}") |
| 157 | |
| 158 | def get_free_port(): |
| 159 | import socket |
| 160 | with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: |
| 161 | s.bind(('localhost', 0)) |
| 162 | port = s.getsockname()[1] |
| 163 | # At this point, the socket is closed, and the port is released |
| 164 | return port |
| 165 | |
| 166 | def check_if_zero3(args): |
| 167 | return hasattr(args, 'deepspeed_config') and (args.deepspeed_config is not None) and (args.deepspeed_config.get('zero_optimization',{}).get('stage', 0) >= 3) |
no outgoing calls
no test coverage detected