Skip to content

Commit f86800d

Browse files
committed
reorganize files
1 parent d662d78 commit f86800d

File tree

6 files changed

+41
-61
lines changed

6 files changed

+41
-61
lines changed
File renamed without changes.

run_scripts/1xA100-80GB.bash renamed to config_run/1xA100-80GB.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/bash
22
set -o xtrace
33

4-
FILE_ARGS='--config-file=./config/fixed_variance.yaml --dir-train=~/dataset/train --dir-val=~/dataset/val'
4+
FILE_ARGS='--config-file=./config_model/fixed_variance.yaml --dir-train=~/dataset/train --dir-val=~/dataset/val'
55
TIME_ARGS='--target-time=10hr --batch-rate=1'
66
# Original batch size in paper is 128
77
# Scale learning rate by sqrt to batch size

data_scripts/make_mosaicml.py

Lines changed: 0 additions & 60 deletions
This file was deleted.

scripts/make_release.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import typer
2+
3+
from typing import List
4+
from pathlib import Path
5+
import subprocess
6+
import shutil
7+
import os
8+
9+
10+
def main(checkpoint_file: Path, output_dir: Path, extra_files: List[Path] = typer.Option([])):
11+
assert checkpoint_file.is_file(), f"{checkpoint_file} is not a file"
12+
assert output_dir.is_dir(), f"{output_dir} is not a directory"
13+
14+
for extra_file in extra_files:
15+
assert extra_file.is_file(), f"{extra_file} is not a file"
16+
17+
folder_name = checkpoint_file.stem
18+
out_dir = output_dir / folder_name
19+
out_dir.mkdir()
20+
chunks_dir = out_dir / "chunks"
21+
chunks_dir.mkdir()
22+
23+
# Split checkpoint file into chunks so it can be uploaded to GH releases
24+
# (GH releases supports max 1GB file size)
25+
subprocess.run(["split", "--bytes", "500M", str(checkpoint_file), str(chunks_dir) + "/"])
26+
27+
for extra_file in extra_files:
28+
name = extra_file.name
29+
shutil.copy(extra_file, out_dir / name)
30+
31+
concat_script = out_dir / "concat.sh"
32+
with open(concat_script, "w+") as f:
33+
f.write("#!/bin/sh\n")
34+
f.write(f"cat {chunks_dir}/* > {out_dir}/{folder_name}.checkpoint\n")
35+
36+
subprocess.check_call(['chmod', '+x', concat_script])
37+
38+
39+
if __name__ == "__main__":
40+
typer.run(main)
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)