Create a local directory to store outputs for this run, and return its path.
(exp_name: str, local_dirs: List[str])
| 53 | |
| 54 | |
| 55 | def get_local_run_dir(exp_name: str, local_dirs: List[str]) -> str: |
| 56 | """Create a local directory to store outputs for this run, and return its path.""" |
| 57 | now = datetime.now() |
| 58 | timestamp = now.strftime("%Y-%m-%d_%H-%M-%S_%f") |
| 59 | run_dir = f"{get_local_dir(local_dirs)}/{exp_name}_{timestamp}" |
| 60 | os.makedirs(run_dir, exist_ok=True) |
| 61 | return run_dir |
| 62 | |
| 63 | |
| 64 | def slice_and_move_batch_for_device(batch: Dict, rank: int, world_size: int, device: str) -> Dict: |