-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgsm8k_experiment.sh
45 lines (37 loc) · 1.47 KB
/
gsm8k_experiment.sh
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
#!/bin/bash -l
#SBATCH -J NEURON_ANALYSIS
#SBATCH -o run_7.txt
#SBATCH -p gpu-short
#SBATCH --gres=gpu:T4_16GB
#SBATCH -c 4
#SBATCH --mem=32G
#SBATCH -t 01:00:00
# 1) Load modules
module load gcc11/11.3.0
module load cuda11.8/toolkit/11.8.0
module load cudnn8.9-cuda11.8/8.9.1.23
# 2) Activate conda environment
source ~/.bashrc
conda activate myexp
# 3) Move to the repository
cd ~/neuron-analysis-cot-arithmetic-reasoning
# 4) (Optional) If you need data in data/test.jsonl or gsm8k data, ensure it's in place
# 5) Run the GSM8K Inference
torchrun --nproc_per_node 1 gsm8k_inference.py --ckpt_dir ~/models/qwen2.5-math-1.5B-instruct --tokenizer_path ~/models/qwen2.5-math-1.5B-instruct/tokenizer.json --prompt "Give a direct answer" --few_shot False --results_dir results
# 6) Run Algorithm One
# torchrun --nproc_per_node=1 main.py \
# --ckpt_dir /home/username/path_to_model \
# --tokenizer_path /home/username/path_to_model \
# --experiment algorithm_one \
# --prompt data/prompts/equation_only.txt \
# --data_dir results/gsm8k_inference/equation_only/final.json \
# --results_dir results/algorithm_one/
# 7) Run Algorithm Two
# torchrun --nproc_per_node=1 main.py \
# --ckpt_dir /home/username/path_to_model \
# --tokenizer_path /home/username/path_to_model \
# --experiment algorithm_two \
# --prompt data/prompts/equation_only.txt \
# --data_dir results/gsm8k_inference/equation_only/final.json \
# --results_dir results/algorithm_two/
echo "GSM8K inference completed"