Files
gloamxun e0feabec8f 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.
2026-11-12 23:32:33 +08:00

47 lines
1.3 KiB
Bash

#!/usr/bin/env bash
source /usr/local/Ascend/ascend-toolkit/set_env.sh
set -euo pipefail
TASK_NAME="Copa" # 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}_zosgd_${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=zo_sgd \
--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 \
--max_steps=20000 \
--logging_steps=10 \
--eval_strategy=steps \
--eval_steps=500 \
--num_eval=1000 \
--num_train=300 \
--num_dev=100 \
--train_set_seed=0 \
--lr_scheduler_type=constant \
--output_dir=result/${TASK_NAME}-zo-sgd-pangu-1b \
> "${LOG_FILE}" 2>&1 &
echo "已启动zo_sgd训练,日志存储于: ${LOG_FILE}"