-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
118 lines (94 loc) · 3.2 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
# set shell := ["zsh", "-uc"]
# settings
# set dotenv-load
# Export all just variables as environment variables.
# set export
export CUDA_VISIBLE_DEVICES := "0"
export TOKENIZERS_PARALLELISM := "false"
[private]
default:
@just --list
# run pytest
test:
. ./.venv/bin/activate
pytest --pdb -x -s -v \
--jaxtyping-packages=reprpo,beartype.beartype --beartype-packages='reprpo'
test_notyping:
. ./.venv/bin/activate
pytest --pdb -x -s -v
# run one method, with args
run METHOD='reprpo_ortho' +EXTRA_ARGS='':
#!/usr/bin/zsh
export EXTRA_ARGS=${EXTRA_ARGS:-}
source ./.venv/bin/activate
python scripts/train.py {{METHOD}} $EXTRA_ARGS
run2 METHOD='reprpo_ortho' +EXTRA_ARGS='':
#!/usr/bin/zsh
export EXTRA_ARGS="{{EXTRA_ARGS}}"
export METHOD="{{METHOD}}"
echo "METHOD={{METHOD}} $METHOD EXTRA_ARGS=${EXTRA_ARGS}"
run_all +EXTRA_ARGS='':
#!/usr/bin/zsh
echo "REPR_CONFIG=$REPR_CONFIG"
export WANDB_GROUP=${WANDB_GROUP:-mdl-$(date +%Y%m%d_%H%M%S)}
echo "WANDB_GROUP=$WANDB_GROUP"
# export HF_DATASETS_OFFLINE=1
# export WANDB_MODE=offline
# export WANDB_SILENT"]=true
# export HF_DATASETS_DISABLE_PROGRESS_BARS=1
export EXTRA_ARGS=${EXTRA_ARGS:-}
echo "EXTRA_ARGS=$EXTRA_ARGS"
. ./.venv/bin/activate
for METHOD in sidein-ether dpo ether hra sideout-hra ortho sidein hra sidein-hra sideout hs svd sideout-ether hs-kl hs-dist side-dist; do
echo "METHOD=$METHOD"
python scripts/train.py $METHOD $EXTRA_ARGS
done
python scripts/train.py hra --no-rel-loss --verbose --lr 1e-5 $EXTRA_ARGS
python scripts/train.py sidein-ether --Htype oft $EXTRA_ARGS
python scripts/train.py sidein-ether --Htype ether $EXTRA_ARGS
python scripts/train.py svd --quantile 1.0 $EXTRA_ARGS
python scripts/train.py hra --no-apply_GS $EXTRA_ARGS
run_ds:
#!/usr/bin/zsh -x
export REPR_CONFIG=./configs/llama3_7b.yaml
source ./.venv/bin/activate
export WANDB_GROUP=${WANDB_GROUP:-ds-$(date +%Y%m%d_%H%M%S)}
export DS=(
alpaca_easy
alpaca_mmlu
alpaca_low_quality
alpaca_short
code_easy
alpaca_mmlu
math
raven_matrices
us_history_textbook
)
for ds in $DS; do
echo "DS=$ds"
. ./.venv/bin/activate
# python scripts/train.py sideout-ether --dataset $ds
python scripts/train.py ether --dataset $ds
python scripts/train.py sidein --dataset $ds
python scripts/train.py dpo --dataset $ds
python scripts/train.py hs-kl --dataset $ds
python scripts/train.py side-dist --dataset $ds
python scripts/train.py hs-dist --dataset $ds
done
run_llama:
#!/usr/bin/zsh
export REPR_CONFIG=./configs/llama3_7b.yaml
just run_all
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/ouputs/ ./ouputs/
run_temp:
#!/usr/bin/zsh
export REPR_CONFIG=./configs/llama3_7b.yaml
. ./.venv/bin/activate
python scripts/train.py hs-dist --verbose --n_samples=5000