Initialize optimizer research workspace with official baselines and history-free coverage
Vendor pinned MeZO, AGZO, LOZO and LoREN sources with independent environments. Add direct in-place fix/adjust/node training, derived history-free basis gradients, development-best checkpoints and experiment tooling. Keep models, datasets, caches and credentials outside Git. Validation: 93 project tests passed; 521 vendored author files verified.
This commit is contained in:
commit
e0feabec8f
596 files changed
+87356
No files matched your search
@@ -0,0 +1,84 @@
|
||||
MODEL=${MODEL:-facebook/opt-1.3b}
|
||||
MODEL_NAME=(${MODEL//\// })
|
||||
MODEL_NAME="${MODEL_NAME[-1]}"
|
||||
|
||||
BS=${BS:-16}
|
||||
EPS=${EPS:-1e-3}
|
||||
TRAIN=${TRAIN:-1000}
|
||||
DEV=${DEV:-500}
|
||||
EVAL=${EVAL:-1000}
|
||||
STEPS=${STEPS:-20000}
|
||||
EVAL_STEPS=${EVAL_STEPS:-4000}
|
||||
|
||||
MODE=${MODE:-ft}
|
||||
EXTRA_ARGS=""
|
||||
if [ "$MODE" == "prefix" ]; then
|
||||
EXTRA_ARGS="--prefix_tuning --num_prefix 5 --no_reparam --prefix_init_by_real_act"
|
||||
elif [ "$MODE" == "lora" ]; then
|
||||
EXTRA_ARGS="--lora"
|
||||
fi
|
||||
|
||||
LR=1e-7
|
||||
TASK=DROP
|
||||
SEED=0
|
||||
RANK=1
|
||||
STEP_INTERVAL=100
|
||||
Tainer=LOZO
|
||||
|
||||
case $TASK in
|
||||
CB) # It has <1000 training examples. Only use 100 for dev
|
||||
DEV=100
|
||||
;;
|
||||
Copa) # It has <1000 training examples. Only use 100 for dev
|
||||
DEV=100
|
||||
TASK_ARGS="--train_as_classification False"
|
||||
;;
|
||||
ReCoRD)
|
||||
TASK_ARGS="--train_as_classification False"
|
||||
;;
|
||||
DROP)
|
||||
TASK_ARGS="--train_as_classification False"
|
||||
;;
|
||||
SQuAD)
|
||||
TASK_ARGS="--train_as_classification False"
|
||||
;;
|
||||
*)
|
||||
TASK_ARGS=""
|
||||
;;
|
||||
esac
|
||||
|
||||
TAG=$Tainer-$MODE-$STEPS-$BS-$LR-$EPS-$SEED-$STEP_INTERVAL-$RANK
|
||||
|
||||
|
||||
echo $TAG
|
||||
echo "Task: $TASK"
|
||||
echo "BS: $BS"
|
||||
echo "LR: $LR"
|
||||
echo "EPS: $EPS"
|
||||
echo "SEED: $SEED"
|
||||
echo "TRAIN/EVAL STEPS: $STEPS/$EVAL_STEPS"
|
||||
echo "MODE: $MODE"
|
||||
echo "Extra args: $EXTRA_ARGS $TASK_ARGS"
|
||||
echo "RANK: $RANK"
|
||||
echo "STEP INTERVAL: $STEP_INTERVAL"
|
||||
|
||||
python run_lozo.py \
|
||||
--model_name $MODEL \
|
||||
--task_name $TASK \
|
||||
--output_dir result/$TASK-${MODEL_NAME}-$TAG --tag $TAG --train_set_seed $SEED --num_train $TRAIN --num_dev $DEV --num_eval $EVAL --logging_steps 10 \
|
||||
--max_steps $STEPS \
|
||||
--trainer $Tainer --load_float16 \
|
||||
--learning_rate $LR --zo_eps $EPS --per_device_train_batch_size $BS --lr_scheduler_type "constant" \
|
||||
--load_best_model_at_end --evaluation_strategy steps --save_strategy steps --save_total_limit 1 \
|
||||
--eval_steps $EVAL_STEPS --save_steps $EVAL_STEPS \
|
||||
--train_as_classification \
|
||||
--step_interval $STEP_INTERVAL \
|
||||
--rank_r $RANK \
|
||||
$EXTRA_ARGS \
|
||||
$TASK_ARGS \
|
||||
"$@"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user