-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
139 lines (117 loc) · 3.53 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# set shell := ["zsh", "-uc"]
export CUDA_VISIBLE_DEVICES := "0"
export TOKENIZERS_PARALLELISM := "false"
[private]
default:
@just --list
# run one method, with args
run +args='':
#!/usr/bin/zsh
source ./.venv/bin/activate
python scripts/train.py {{ args }}
run_all +args='':
#!/usr/bin/bash
. ./.venv/bin/activate
export WANDB_GROUP=${WANDB_GROUP:-mdl-$(date +%y%m%d_%H%M)}
echo "REPR_CONFIG=$REPR_CONFIG"
echo "WANDB_GROUP=$WANDB_GROUP"
echo "EXTRA_ARGS={{args}}"
readarray -t EXPERIMENTS <<< "$(python ./scripts/export_experiments.py)"
set -x
# echo EXPERIMENTS $EXPERIMENTS $S
for METHOD in $EXPERIMENTS; do
echo "python scripts/train.py $METHOD {{args}}"
python scripts/train.py $METHOD {{args}}
done
run_ds +args='':
#!/usr/bin/zsh
# export REPR_CONFIG=./configs/llama-3-7b_a100.yaml
export WANDB_GROUP=${WANDB_GROUP:-ds-$(date +%y%m%d_%H%M)}
source ./.venv/bin/activate
export DS=(
alpaca_easy
alpaca_mmlu
alpaca_low_quality
alpaca_short
code_easy
alpaca_mmlu
math
raven_matrices
us_history_textbook
# extreme
arc_easy
math_easy
ranking_logic_easy
raven_easy
code
cooking
pursue_goals
creative_writing
code_low_quality
shp_low_quality
math_make_questions
math_textbook
math_fiction
us_history_make_questions
change_my_view
)
export METHODS=(
dpo
hs-ether-prefvec
side-none-prefvec
projgrad
)
set -x
echo $DS
for ds in $DS; do
echo "DS=$ds"
for METHOD in $METHODS; do
echo python scripts/train.py $METHOD --dataset $ds {{ args }}
python scripts/train.py $METHOD --dataset $ds {{ args }}
done
done
run_sizes +args='':
#!/usr/bin/zsh
export METHODS=(
dpo
hs-ether-prefvec
side-none-prefvec
projgrad
)
export WANDB_GROUP=${WANDB_GROUP:-sz-$(date +%y%m%d_%H%M)}
for METHOD in $EXPERIMENTS; do
REPR_CONFIG=./configs/llama-3-7b_a100.yaml python scripts/train.py $METHOD {{ args }}
REPR_CONFIG=./configs/llama-3-2-3b_a100.yaml python scripts/train.py $METHOD {{ args }}
REPR_CONFIG=./configs/llama-3-2-1b_a100.yaml python scripts/train.py $METHOD {{ args }}
done
run_llama +args='':
#!/usr/bin/zsh
export REPR_CONFIG=./configs/llama-3-7b_a100.yaml
just run_all {{ args }}
just run_ds {{ args }}
just run_sizes {{ args }}
# run pytest
test:
. ./.venv/bin/activate
pytest --pdb -x -s -v \
--jaxtyping-packages=reprpo,beartype.beartype --beartype-packages='reprpo'
# run in dev mode with pdb
dev:
#!/usr/bin/zsh
export REPR_CONFIG=./configs/dev.yaml
. ./.venv/bin/activate
python scripts/train.py -m pdb sidein-hra
# copy trained models from runpod
cp:
rsync -avz --ignore-existing runpod:/workspace/repr-preference-optimization/outputs/ ./ouputs/
scratch2:
#!/usr/bin/zsh
export WANDB_GROUP=${WANDB_GROUP:-prefvecexp-$(date +%y%m%d_%H%M)}
# baseline
python scripts/train.py --verbose 1 prefvec
# what if we use the pref vec on pi model?
python scripts/train.py --verbose 1 prefvec --no-use-pref-ref
# what if we make the rejected string less prefered
python scripts/train.py --verbose 1 prefvec --no-use-proj-rel
# what if both?
python scripts/train.py --verbose 1 prefvec --no-use-proj-rel --no-use-pref-ref