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.
48 lines
1.4 KiB
Bash
Executable File
48 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
source /usr/local/Ascend/ascend-toolkit/set_env.sh
|
|
set -euo pipefail
|
|
|
|
TASK_NAME="SST2" # can be changed to other tasks, e.g., BoolQ, RTE, SST2, Copa, CB, RTE.
|
|
SCRIPT_DIR="" # where the ZOLLM-npu repo is located
|
|
LOG_DIR="${SCRIPT_DIR}/log"
|
|
TIMESTAMP="$(date +%Y%m%d_%H%M%S)"
|
|
LOG_FILE="${LOG_DIR}/${TIMESTAMP}_agzo_${TASK_NAME}_pangu-1b.log"
|
|
export NPU_ID=0 # the NPU ID to use
|
|
export ASCEND_DEVICE_ID=${NPU_ID}
|
|
export ASCEND_VISIBLE_DEVICES=${NPU_ID}
|
|
export ASCEND_RT_VISIBLE_DEVICES=${NPU_ID}
|
|
export NPU_VISIBLE_DEVICES=${NPU_ID}
|
|
|
|
mkdir -p "${LOG_DIR}"
|
|
|
|
source /home/xxx/anaconda3/etc/profile.d/conda.sh # change to your anaconda path or miniconda path
|
|
conda activate zollm
|
|
|
|
cd "${SCRIPT_DIR}"
|
|
|
|
nohup python zo-bench/run.py \
|
|
--trainer=agzo \
|
|
--model_name=FreedomIntelligence/openPangu-Embedded-1B \
|
|
--task_name=${TASK_NAME} \
|
|
--train_as_classification \
|
|
--perturbation_mode=two_side \
|
|
--zo_eps=1e-7 \
|
|
--learning_rate=1e-7 \
|
|
--num_train_epochs=5 \
|
|
--per_device_train_batch_size=16 \
|
|
--eval_strategy=steps \
|
|
--eval_steps=500 \
|
|
--save_steps=500 \
|
|
--max_steps=20000 \
|
|
--logging_steps=10 \
|
|
--num_eval=1000 \
|
|
--num_train=1000 \
|
|
--num_dev=500 \
|
|
--train_set_seed=0 \
|
|
--lr_scheduler_type=constant \
|
|
--output_dir=result/${TASK_NAME}-agzo-pangu-1b \
|
|
> "${LOG_FILE}" 2>&1 &
|
|
|
|
echo "已启动agzo训练,日志存储于: ${LOG_FILE}"
|
|
|