Skip to content

Commit 9911eb2

Browse files
authored
Translation (#17)
* finalize prompts * translation scripts * gpt translate outputs * add translation outputs * translation results
1 parent 1a55b01 commit 9911eb2

File tree

76 files changed

+1822696
-37
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1822696
-37
lines changed

drivers/problem-sizes.json

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"omp": "(1<<10)",
55
"mpi": "(1<<10)",
66
"mpi+omp": "(1<<10)",
7-
"kokkos": "(1<<10)",
7+
"kokkos": "(1<<9)",
88
"cuda": "(1<<10)",
99
"hip": "(1<<10)"
1010
},
@@ -18,13 +18,13 @@
1818
"hip": "(1<<10)"
1919
},
2020
"02_dense_la_gemm": {
21-
"serial": "(1<<10)",
22-
"omp": "(1<<10)",
23-
"mpi": "(1<<10)",
24-
"mpi+omp": "(1<<10)",
25-
"kokkos": "(1<<10)",
26-
"cuda": "(1<<10)",
27-
"hip": "(1<<10)"
21+
"serial": "(1<<9)",
22+
"omp": "(1<<9)",
23+
"mpi": "(1<<9)",
24+
"mpi+omp": "(1<<9)",
25+
"kokkos": "(1<<9)",
26+
"cuda": "(1<<9)",
27+
"hip": "(1<<9)"
2828
},
2929
"03_dense_la_axpy": {
3030
"serial": "(1<<24)",
@@ -47,8 +47,8 @@
4747
"05_fft_inverse_fft": {
4848
"serial": "(1<<17)",
4949
"omp": "(1<<17)",
50-
"mpi": "(1<<18)",
51-
"mpi+omp": "(1<<18)",
50+
"mpi": "(1<<17)",
51+
"mpi+omp": "(1<<17)",
5252
"kokkos": "(1<<17)",
5353
"cuda": "(1<<17)",
5454
"hip": "(1<<17)"
@@ -72,22 +72,22 @@
7272
"hip": "(1<<18)"
7373
},
7474
"08_fft_split_fft": {
75-
"serial": "(1<<18)",
76-
"omp": "(1<<18)",
77-
"mpi": "(1<<19)",
78-
"mpi+omp": "(1<<19)",
79-
"kokkos": "(1<<18)",
80-
"cuda": "(1<<18)",
81-
"hip": "(1<<18)"
75+
"serial": "(1<<17)",
76+
"omp": "(1<<17)",
77+
"mpi": "(1<<17)",
78+
"mpi+omp": "(1<<17)",
79+
"kokkos": "(1<<17)",
80+
"cuda": "(1<<17)",
81+
"hip": "(1<<17)"
8282
},
8383
"09_fft_fft_out_of_place": {
84-
"serial": "(1<<18)",
85-
"omp": "(1<<18)",
86-
"mpi": "(1<<19)",
87-
"mpi+omp": "(1<<19)",
88-
"kokkos": "(1<<18)",
89-
"cuda": "(1<<18)",
90-
"hip": "(1<<18)"
84+
"serial": "(1<<17)",
85+
"omp": "(1<<17)",
86+
"mpi": "(1<<17)",
87+
"mpi+omp": "(1<<17)",
88+
"kokkos": "(1<<17)",
89+
"cuda": "(1<<17)",
90+
"hip": "(1<<17)"
9191
},
9292
"10_geometry_convex_hull": {
9393
"serial": "(1<<14)",
@@ -109,28 +109,28 @@
109109
},
110110
"12_geometry_smallest_triangle": {
111111
"serial": "(1<<8)",
112-
"omp": "(1<<8)",
112+
"omp": "(1<<7)",
113113
"mpi": "(1<<8)",
114114
"mpi+omp": "(1<<8)",
115-
"kokkos": "(1<<8)",
115+
"kokkos": "(1<<7)",
116116
"cuda": "(1<<10)",
117117
"hip": "(1<<10)"
118118
},
119119
"13_geometry_closest_pair_2d": {
120120
"serial": "(1<<14)",
121-
"omp": "(1<<14)",
121+
"omp": "(1<<13)",
122122
"mpi": "(1<<14)",
123123
"mpi+omp": "(1<<14)",
124-
"kokkos": "(1<<14)",
124+
"kokkos": "(1<<13)",
125125
"cuda": "(1<<14)",
126126
"hip": "(1<<14)"
127127
},
128128
"14_geometry_closest_pair_1d": {
129129
"serial": "(1<<14)",
130-
"omp": "(1<<14)",
130+
"omp": "(1<<13)",
131131
"mpi": "(1<<14)",
132132
"mpi+omp": "(1<<14)",
133-
"kokkos": "(1<<14)",
133+
"kokkos": "(1<<13)",
134134
"cuda": "(1<<14)",
135135
"hip": "(1<<14)"
136136
},
@@ -153,13 +153,13 @@
153153
"hip": "(1<<12)"
154154
},
155155
"17_graph_highest_degree": {
156-
"serial": "(1<<13)",
157-
"omp": "(1<<13)",
158-
"mpi": "(1<<13)",
159-
"mpi+omp": "(1<<13)",
156+
"serial": "(1<<12)",
157+
"omp": "(1<<12)",
158+
"mpi": "(1<<12)",
159+
"mpi+omp": "(1<<12)",
160160
"kokkos": "(1<<12)",
161-
"cuda": "(1<<13)",
162-
"hip": "(1<<13)"
161+
"cuda": "(1<<12)",
162+
"hip": "(1<<12)"
163163
},
164164
"18_graph_count_components": {
165165
"serial": "(1<<12)",

generate/generate-openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def get_max_requests_per_day(model: str) -> Optional[int]:
100100
def postprocess(prompt: str, output: str) -> str:
101101
""" Postprocess the output. """
102102
# remove leading ```, ```cpp, and trailing ```
103-
output = output.lstrip("```cpp").lstrip("```").rstrip("```")
103+
output = output.strip().lstrip("```cpp").lstrip("```").rstrip("```")
104104

105105
# remove prompt if it included it
106106
if output.startswith(prompt):
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
#SBATCH -n 1
3+
#SBATCH -c 8
4+
#SBATCH --ntasks-per-node=1
5+
#SBATCH --gpus-per-task=1
6+
#SBATCH --mem=128000
7+
#SBATCH -t 12:00:0
8+
#SBATCH -A m2404
9+
#SBATCH -C gpu&hbm80g
10+
#SBATCH -q regular
11+
#SBATCH -J translate-codellama-13b
12+
#SBATCH -o translation-job-logs/translate-codellama-13b-%A.out
13+
14+
# settings
15+
MODEL="codellama/CodeLlama-13b-hf"
16+
TEMP=0.2
17+
TOPP=0.95
18+
MAX_NEW_TKNS=1024
19+
SAMPLES_PER_PROMPT=20
20+
BATCH_SIZE=8
21+
hash=$(md5sum ../prompts/translation-prompts.json | cut -d' ' -f1)
22+
OUTPUT="../outputs/output_translate_${hash:0:8}_${MODEL//\//--}_temp${TEMP}.json"
23+
CACHE="../outputs/cache/cache_translate_${hash:0:8}_${MODEL//\//--}_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=8
32+
export SLURM_CPU_BIND="cores"
33+
34+
# generate
35+
srun python translate.py \
36+
--model $MODEL \
37+
--prompts ../prompts/translation-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
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
#SBATCH -n 1
3+
#SBATCH -c 8
4+
#SBATCH --ntasks-per-node=1
5+
#SBATCH --gpus-per-task=1
6+
#SBATCH --mem=128000
7+
#SBATCH -t 14:00:0
8+
#SBATCH -A m2404
9+
#SBATCH -C gpu&hbm80g
10+
#SBATCH -q regular
11+
#SBATCH -J translate-codellama-34b
12+
#SBATCH -o translation-job-logs/translate-codellama-34b-%A.out
13+
14+
# settings
15+
MODEL="codellama/CodeLlama-34b-hf"
16+
TEMP=0.2
17+
TOPP=0.95
18+
MAX_NEW_TKNS=1024
19+
SAMPLES_PER_PROMPT=20
20+
BATCH_SIZE=8
21+
hash=$(md5sum ../prompts/translation-prompts.json | cut -d' ' -f1)
22+
OUTPUT="../outputs/output_translate_${hash:0:8}_${MODEL//\//--}_temp${TEMP}.json"
23+
CACHE="../outputs/cache/cache_translate_${hash:0:8}_${MODEL//\//--}_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=8
32+
export SLURM_CPU_BIND="cores"
33+
34+
# generate
35+
srun python translate.py \
36+
--model $MODEL \
37+
--prompts ../prompts/translation-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
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
#SBATCH -n 1
3+
#SBATCH -c 8
4+
#SBATCH --ntasks-per-node=1
5+
#SBATCH --gpus-per-task=1
6+
#SBATCH --mem=128000
7+
#SBATCH -t 06:00:0
8+
#SBATCH -A m2404
9+
#SBATCH -C gpu&hbm80g
10+
#SBATCH -q regular
11+
#SBATCH -J translate-codellama-7b
12+
#SBATCH -o translation-job-logs/translate-codellama-7b-%A.out
13+
14+
# settings
15+
MODEL="codellama/CodeLlama-7b-hf"
16+
TEMP=0.2
17+
TOPP=0.95
18+
MAX_NEW_TKNS=1024
19+
SAMPLES_PER_PROMPT=20
20+
BATCH_SIZE=8
21+
hash=$(md5sum ../prompts/translation-prompts.json | cut -d' ' -f1)
22+
OUTPUT="../outputs/output_translate_${hash:0:8}_${MODEL//\//--}_temp${TEMP}.json"
23+
CACHE="../outputs/cache/cache_translate_${hash:0:8}_${MODEL//\//--}_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=8
32+
export SLURM_CPU_BIND="cores"
33+
34+
# generate
35+
srun python translate.py \
36+
--model $MODEL \
37+
--prompts ../prompts/translation-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

0 commit comments

Comments
 (0)