File size: 3,761 Bytes
64bce2a | 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 140 141 142 143 144 | #!/bin/bash
#SBATCH --partition=scavenger-gpu
#SBATCH --exclude=dcc-youlab-gpu-28,dcc-gehmlab-gpu-56
#SBATCH --array=0-999 # 6 configurations to test
#SBATCH --ntasks=1
#SBATCH --nodes=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=8G
#SBATCH --gres=gpu:1
#SBATCH --time=8:00:00
#SBATCH --output=/work/jf381/code/code/ICL_LOG/data_generation/%A_%a_%j.out
#SBATCH --error=/work/jf381/code/code/ICL_LOG/data_generation/%A_%a_%j.err
#SBATCH --requeue
set -e
# load_pretrain_model 0
# rbf 1 2 4 971 067 971
# 30,31,32 softmax use_cf
# 18,19,20 softmax use_ff
# exp 9 10 11
# 678 softmax
# nvidia-smi | grep 'python' | awk '{ print $5 }' | xargs -n1 kill -9
# SLURM_ARRAY_TASK_ID=3
# conda activate /work/jf381/cache/conda_envs/paul3100
# source activate /work/jf381/cache/conda_envs/paul31
# use SLURM_ARRAY_TASK_ID to control
# cd /work/jf381/code/code/ICL_Jay
## pretrain useful for pe+lap
## add noise add performance
## test context size
## test model
# distribute 1000 tasks on
# python /work/jf381/code/code/ICL_Jay/train_end2end_new.py --test_mode $SLURM_ARRAY_TASK_ID --n_epochs 3001 --data_type sphere --data_generation --slurm_id --slurm_tasks
# n_epochs_stride
# SLURM_ARRAY_TASK_ID=0
#!/bin/bash
# 定义噪声水平列表
#!/bin/bash
# 获取SLURM任务ID
# SLURM_ARRAY_TASK_ID=34
# SLURM_ARRAY_TASK_ID=15
# SLURM_ID=${SLURM_ARRAY_TASK_ID:-0}
# SLURM_ARRAY_TASK_ID=15
SLURM_ID=15
# 设置数据类型
# 设置基础噪声水平(或从列表中选择)
add_noises=0 # 也可以从一个列表中基于SLURM_ID选择
# 使用SLURM_ID来确定模型配置
# 假设我们有以下变量组合:
# 1. n_layer_icl: 1, 2, 3, 4
# 2. kernel: 'linear', 'rbf', 'softmax', 'exp'
# 3. 使用选项: 无特殊选项, use_ff, use_ct
# /work/jf381/code/code/ICL_LOG/ICL_MODEL_TEST_TYPE2_Finetune_Pretrain_ENDEND
# NOW
# data_type="cylinder"
# test_data_type="cylinder"
# data_type="cylinder"
# test_data_type="cylinder"
# data_type="cylinder"
# test_data_type="cylinder"
# 计算层数 (1, 2, 4)
layer_options=(1 2 4)
layer_idx=$(( SLURM_ID % 3 ))
n_layer_icl=${layer_options[$layer_idx]}
# 计算kernel类型 (0-3)
kernel_idx=$(( (SLURM_ID / 3) % 4 ))
kernels=("linear" "rbf" "softmax" "exp")
kernel=${kernels[$kernel_idx]}
# 计算使用选项 (0-2)
option_idx=$(( (SLURM_ID / 12) % 3 ))
options=("" "--use_ff" "--use_cf")
option=${options[$option_idx]}
icl_type=2
echo "Running with configuration:"
echo "SLURM_ID = $SLURM_ID"
echo "n_layer_icl = $n_layer_icl"
echo "kernel = $kernel"
echo "option = $option"
echo "icl_type = $icl_type"
batch_size=200
data_type="combine-5"
test_data_type=$data_type
SLURM_ARRAY_TASK_ID=0
# echo $SLURM_ARRAY_TASK_ID/
load_pretrain_model=0
test_mode=$load_pretrain_model
seed=2
context_size=40
query_size=60
n_samples=$((context_size+query_size))
# SLURM_ARRAY_TASK_ID=0
python /work/jf381/code/code/ICL_Jay/train_end2end_new.py \
--test_mode $test_mode \
--n_epochs 30001 \
--data_type $data_type \
--n_layer_icl $n_layer_icl \
--test_data_type $test_data_type \
--add_noises $add_noises \
--kernel $kernel \
--load_pretrain_model -1 \
--fine_tune_n_epochs 31 \
--icl_type $icl_type \
--suffix n_samples_${n_samples}_context_size_${context_size} \
--train_context_size $context_size \
--test_context_size $context_size \
--n_samples $n_samples \
--seed $seed \
--batch_size $batch_size \
--data_generation \
--slurm_id $SLURM_ARRAY_TASK_ID \
--slurm_tasks 1 \
--batch_size $batch_size
# distribute 1000 tasks to generate
# python /work/jf381/code/code/ICL_Jay/train_end2end_new.py --n_epochs 3001 --data_type swiss_roll --data_generation --slurm_id $SLURM_ARRAY_TASK_ID --slurm_tasks 100 --batch_size 200 |