File size: 1,517 Bytes
fed1832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
#SBATCH --job-name=activation_single        # Job name
#SBATCH --output=activation_single.log  # Standard output log
#SBATCH --error=activation_single.log    # Standard error log
#SBATCH --ntasks=1               # Number of tasks (processes)
#SBATCH --cpus-per-task=32       # Number of CPU cores
#SBATCH --mem=256G               # Memory
#SBATCH --gres=gpu:1             # Number of GPUs
#SBATCH --partition=physical-gpu          # Partition/queue name

#!/usr/bin/env bash

BASE_PATH="/home/khanh/sla/sla_cpt"
ID_BASE_PATH="./oscar_ids"
ACTIVATION_BASE_PATH="./new_new_activations"

# --- Run Configs (clean style) ---
# run_l2_13b=(
#   name="l2-13b"
#   model="$BASE_PATH/uccix/checkpoint-4280"
#   type="llama"
#   ids=(
#     "$ID_BASE_PATH/l2-13b/id.ga.train.l2-13b:ga"
#     "$ID_BASE_PATH/l2-13b/id.en.train.l2-13b:en"
#   )
# )

run_q25_zh=(
  name="q2.5-zh"
  model="$BASE_PATH/qwen2.5-0.5b_english_wiki_750M_chinese_wikipedia_corpus_2e_240925/checkpoint-2944"
  type="qwen"
  ids=(
    "$ID_BASE_PATH/q2.5/id.zh.train.q2.5"
    "$ID_BASE_PATH/q2.5/id.en.train.q2.5"
  )
)

# --- Put them in a list ---
ALL_RUNS=(run_q25_zh)

# --- Loop ---
for run in "${ALL_RUNS[@]}"; do
  declare -n cfg="$run"
  
  echo "=== Running ${cfg[name]} ==="
  for id_path in "${cfg[ids][@]}"; do
    echo "  -> $id_path"
    python3 activation_single.py \
        -m "${cfg[model]}" \
        -t "${cfg[type]}" \
        -i "$id_path" \
        -n "${cfg[name]}" \
        -s "$ACTIVATION_BASE_PATH"
    done
done