KyleBae1017 commited on
Commit
d39d850
·
verified ·
1 Parent(s): 2113cc1

Upload run_id3.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. run_id3.sh +85 -0
run_id3.sh ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -e
3
+
4
+ ########################################
5
+ # 기본 설정 (환경에 맞게 수정)
6
+ ########################################
7
+ CMD="python train.py"
8
+ CFG_STAGE1="/workspace/stormer/configs/pretrain_one_step.yaml"
9
+ CFG_STAGE2="/workspace/stormer/configs/finetune_multi_step_stage2.yaml"
10
+ CFG_STAGE3="/workspace/stormer/configs/finetune_multi_step_stage3.yaml"
11
+
12
+ DATA_ROOT="/workspace/stormer/wb2_processed"
13
+
14
+ ########################################
15
+ # (hidden_size, depth, num_heads) 세트 정의
16
+ ########################################
17
+ SETTINGS=(
18
+ "384-18-6"
19
+ )
20
+
21
+ ########################################
22
+ # sweep loop
23
+ ########################################
24
+ for setting in "${SETTINGS[@]}"; do
25
+ # "hidden-depth-head" 파싱
26
+ IFS="-" read -r h d nh <<< "${setting}"
27
+
28
+ RUN_ID="h${h}_d${d}_n${nh}"
29
+ echo "============================================================"
30
+ echo "RUN: ${RUN_ID} (hidden=${h}, depth=${d}, num_heads=${nh})"
31
+ echo "============================================================"
32
+
33
+ ######################################
34
+ # STAGE 1 : PRETRAIN (one step)
35
+ ######################################
36
+ # ${CMD} \
37
+ # --config "${CFG_STAGE1}" \
38
+ # --trainer.default_root_dir "/workspace/stormer/results/pretrain/${RUN_ID}" \
39
+ # --trainer.logger.init_args.name "pretrain_one_step_${RUN_ID}" \
40
+ # --model.net.init_args.hidden_size "${h}" \
41
+ # --model.net.init_args.depth "${d}" \
42
+ # --model.net.init_args.num_heads "${nh}" \
43
+ # --model.net.patch_size 4 \
44
+ # --data.root_dir "${DATA_ROOT}" \
45
+ # --data.steps 1 \
46
+ # --data.batch_size 1
47
+
48
+ # yaml에서 dirpath: "${trainer.default_root_dir}/pretrain_one_step/checkpoints"
49
+ PRETRAIN_CKPT="/workspace/stormer/results/pretrain/${RUN_ID}/pretrain_one_step_${RUN_ID}/checkpoints/last.ckpt"
50
+
51
+ ######################################
52
+ # STAGE 2 : FINETUNE (4 steps)
53
+ ######################################
54
+ ${CMD} \
55
+ --config "${CFG_STAGE2}" \
56
+ --trainer.default_root_dir "/workspace/stormer/results/finetune/4steps_${RUN_ID}" \
57
+ --trainer.logger.init_args.name "finetune_4_steps_${RUN_ID}" \
58
+ --model.net.init_args.hidden_size "${h}" \
59
+ --model.net.init_args.depth "${d}" \
60
+ --model.net.init_args.num_heads "${nh}" \
61
+ --model.net.patch_size 4 \
62
+ --model.pretrained_path "${PRETRAIN_CKPT}" \
63
+ --data.root_dir "${DATA_ROOT}" \
64
+ --data.steps 4 \
65
+ --data.batch_size 1
66
+
67
+ FINETUNE4_CKPT="/workspace/stormer/results/finetune/4steps_${RUN_ID}/finetune_4_steps_${RUN_ID}/checkpoints/last.ckpt"
68
+
69
+ ######################################
70
+ # STAGE 3 : FINETUNE (8 steps)
71
+ ######################################
72
+ ${CMD} \
73
+ --config "${CFG_STAGE3}" \
74
+ --trainer.default_root_dir "/workspace/stormer/results/finetune/8steps_${RUN_ID}" \
75
+ --trainer.logger.init_args.name "finetune_8_steps_${RUN_ID}" \
76
+ --model.net.init_args.hidden_size "${h}" \
77
+ --model.net.init_args.depth "${d}" \
78
+ --model.net.init_args.num_heads "${nh}" \
79
+ --model.net.patch_size 4 \
80
+ --model.pretrained_path "${FINETUNE4_CKPT}" \
81
+ --data.root_dir "${DATA_ROOT}" \
82
+ --data.steps 8 \
83
+ --data.batch_size 1
84
+
85
+ done