Skip to content

Commit a5cd8e7

Browse files
committed
add generation script
1 parent 326308e commit a5cd8e7

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
#SBATCH -n 1
3+
#SBATCH -c 16
4+
#SBATCH --ntasks-per-node=1
5+
#SBATCH --gpus-per-task=1
6+
#SBATCH --mem=164000
7+
#SBATCH -t 23:59:59
8+
#SBATCH -A m2404
9+
#SBATCH -C gpu&hbm80g
10+
#SBATCH -q regular
11+
#SBATCH -J generate-codellama-70b-prompted
12+
#SBATCH -o generate-codellama-70b-prompted-%A.out
13+
14+
# settings
15+
MODEL="codellama/CodeLlama-70b-hf"
16+
TEMP=0.2
17+
TOPP=0.95
18+
MAX_NEW_TKNS=1024
19+
SAMPLES_PER_PROMPT=20
20+
BATCH_SIZE=2
21+
hash=$(md5sum ../prompts/generation-prompts.json | cut -d' ' -f1)
22+
OUTPUT="../outputs/output_${hash:0:8}_${MODEL//\//--}_prompted_temp${TEMP}.json"
23+
CACHE="../outputs/cache/cache_${hash:0:8}_${MODEL//\//--}_prompted_temp${TEMP}.jsonl"
24+
echo "Writing to $OUTPUT"
25+
echo "model=$MODEL MAX_NEW_TKNS=$MAX_NEW_TKNS SAMPLES_PER_PROMPT=$SAMPLES_PER_PROMPT BATCH_SIZE=$BATCH_SIZE"
26+
27+
# setup
28+
#ml cuda/11.8.0
29+
source .env/bin/activate
30+
export HF_HOME=/pscratch/sd/d/dnicho/.cache/huggingface
31+
export OMP_NUM_THREADS=16
32+
export SLURM_CPU_BIND="cores"
33+
34+
# generate
35+
srun python generate.py \
36+
--model $MODEL \
37+
--prompts ../prompts/generation-prompts.json \
38+
--cache $CACHE \
39+
--output $OUTPUT \
40+
--temperature $TEMP \
41+
--top_p $TOPP \
42+
--do_sample \
43+
--max_new_tokens $MAX_NEW_TKNS \
44+
--num_samples_per_prompt $SAMPLES_PER_PROMPT \
45+
--batch_size $BATCH_SIZE \
46+
--prompted

0 commit comments

Comments
 (0)