Skip to content

Commit a7e38b1

Browse files
authored
add gemini (#18)
* add gemini script * add gemini generation outputs * add results
1 parent 9911eb2 commit a7e38b1

25 files changed

+319088
-85
lines changed

drivers/cpp/models/cuda-driver.cu

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ int main(int argc, char **argv) {
8383
/* initialize */
8484
Context *ctx = init();
8585

86+
/* validate */
87+
const bool isValid = validate(ctx);
88+
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
89+
if (!isValid) {
90+
destroy(ctx);
91+
return 0;
92+
}
93+
8694
/* benchmark */
8795
double totalTime = 0.0;
8896
CudaTimer timer;
@@ -110,10 +118,6 @@ int main(int argc, char **argv) {
110118
}
111119
printf("BestSequential: %.*f\n", DBL_DIG-1, totalTime / NITER);
112120

113-
/* validate */
114-
const bool isValid = validate(ctx);
115-
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
116-
117121
/* cleanup */
118122
destroy(ctx);
119123

drivers/cpp/models/hip-driver.cu

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ int main(int argc, char **argv) {
8383
/* initialize */
8484
Context *ctx = init();
8585

86+
/* validate */
87+
const bool isValid = validate(ctx);
88+
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
89+
if (!isValid) {
90+
destroy(ctx);
91+
return 0;
92+
}
93+
8694
/* benchmark */
8795
double totalTime = 0.0;
8896
HipTimer timer;
@@ -110,10 +118,6 @@ int main(int argc, char **argv) {
110118
}
111119
printf("BestSequential: %.*f\n", DBL_DIG-1, totalTime / NITER);
112120

113-
/* validate */
114-
const bool isValid = validate(ctx);
115-
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
116-
117121
/* cleanup */
118122
destroy(ctx);
119123

drivers/cpp/models/kokkos-driver.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ int main(int argc, char **argv) {
4444
/* initialize */
4545
Context *ctx = init();
4646

47+
/* validate */
48+
const bool isValid = validate(ctx);
49+
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
50+
if (!isValid) {
51+
destroy(ctx);
52+
Kokkos::finalize();
53+
return 0;
54+
}
55+
4756
/* benchmark */
4857
double totalTime = 0.0;
4958
Kokkos::Timer timer;
@@ -67,10 +76,6 @@ int main(int argc, char **argv) {
6776
}
6877
printf("BestSequential: %.*f\n", DBL_DIG-1, totalTime / NITER);
6978

70-
/* validate */
71-
const bool isValid = validate(ctx);
72-
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
73-
7479
/* cleanup */
7580
destroy(ctx);
7681

drivers/cpp/models/mpi-driver.cc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ int main(int argc, char **argv) {
5252
/* initialize */
5353
Context *ctx = init();
5454

55+
/* validate */
56+
const bool isValid = validate(ctx);
57+
if (rank == 0) {
58+
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
59+
60+
if (!isValid) {
61+
destroy(ctx);
62+
MPI_Abort(MPI_COMM_WORLD, 0);
63+
return 0;
64+
}
65+
}
66+
5567
/* benchmark */
5668
double totalTime = 0.0;
5769
for (int i = 0; i < NITER; i += 1) {
@@ -85,12 +97,6 @@ int main(int argc, char **argv) {
8597
}
8698
MPI_Barrier(MPI_COMM_WORLD);
8799

88-
/* validate */
89-
const bool isValid = validate(ctx);
90-
if (rank == 0) {
91-
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
92-
}
93-
94100
/* cleanup */
95101
destroy(ctx);
96102

drivers/cpp/models/mpi-omp-driver.cc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ int main(int argc, char **argv) {
5555
/* initialize */
5656
Context *ctx = init();
5757

58+
/* validate */
59+
const bool isValid = validate(ctx);
60+
if (rank == 0) {
61+
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
62+
63+
if (!isValid) {
64+
destroy(ctx);
65+
MPI_Abort(MPI_COMM_WORLD, 0);
66+
return 0;
67+
}
68+
}
69+
5870
/* benchmark */
5971
double totalTime = 0.0;
6072
for (int i = 0; i < NITER; i += 1) {
@@ -88,12 +100,6 @@ int main(int argc, char **argv) {
88100
}
89101
MPI_Barrier(MPI_COMM_WORLD);
90102

91-
/* validate */
92-
const bool isValid = validate(ctx);
93-
if (rank == 0) {
94-
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
95-
}
96-
97103
/* cleanup */
98104
destroy(ctx);
99105

drivers/cpp/models/omp-driver.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ int main(int argc, char **argv) {
4747
/* initialize */
4848
Context *ctx = init();
4949

50+
/* validate */
51+
const bool isValid = validate(ctx);
52+
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
53+
if (!isValid) {
54+
destroy(ctx);
55+
return 0;
56+
}
57+
5058
/* benchmark */
5159
double totalTime = 0.0;
5260
for (int i = 0; i < NITER; i += 1) {
@@ -69,10 +77,6 @@ int main(int argc, char **argv) {
6977
}
7078
printf("BestSequential: %.*f\n", DBL_DIG-1, totalTime / NITER);
7179

72-
/* validate */
73-
const bool isValid = validate(ctx);
74-
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
75-
7680
/* cleanup */
7781
destroy(ctx);
7882

drivers/cpp/models/serial-driver.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ int main(int argc, char **argv) {
4444
/* initialize */
4545
Context *ctx = init();
4646

47+
/* validate */
48+
const bool isValid = validate(ctx);
49+
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
50+
if (!isValid) {
51+
destroy(ctx);
52+
return 0;
53+
}
54+
4755
/* benchmark */
4856
double totalTime = 0.0;
4957
for (int i = 0; i < NITER; i += 1) {
@@ -68,10 +76,6 @@ int main(int argc, char **argv) {
6876
}
6977
printf("BestSequential: %.*f\n", DBL_DIG-1, totalTime / NITER);
7078

71-
/* validate */
72-
const bool isValid = validate(ctx);
73-
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
74-
7579
/* cleanup */
7680
destroy(ctx);
7781

drivers/driver_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def are_all_valid(self) -> bool:
113113
def best_sequential_runtime(self) -> Optional[float]:
114114
""" Return the min value for sequential runtime. """
115115
if self.did_build() and self.did_any_run():
116-
return min(r.best_sequential_runtime for r in self.run_outputs if r.best_sequential_runtime is not None)
116+
return min((r.best_sequential_runtime for r in self.run_outputs if r.best_sequential_runtime is not None), default=None)
117117
else:
118118
return None
119119

drivers/run-cuda.sbatch

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
#SBATCH --gpus=a100:1
55
#SBATCH -t 05:00:00
66
#SBATCH -A bhatele-lab-cmsc
7-
#SBATCH -J cuda-codellama-34b-hf_prompted
8-
#SBATCH -o run-outputs/codellama-34b-hf_prompted-cuda-%A.out
7+
#SBATCH -J cuda-gemini-pro
8+
#SBATCH -o run-outputs/gemini-pro-cuda-%A.out
99

1010
# settings
11-
HASH="a8724ee8"
12-
MODEL="codellama-34b-hf_prompted"
11+
HASH="015cff6f"
12+
MODEL="gemini-pro"
1313
TEMP="0.2"
1414

1515
GENERATED_PROMPTS="../results/${HASH}/${MODEL}_temp${TEMP}/all.json"
@@ -20,14 +20,12 @@ module purge
2020
ml python gcc/11.3.0 cuda/12.1.1/gcc/11.3.0/
2121

2222
python run-all.py \
23-
$OUTPUT \
23+
$GENERATED_PROMPTS \
2424
--output $OUTPUT \
2525
--scratch-dir $SCRATCH_DIR \
2626
--launch-configs launch-configs.json \
2727
--problem-sizes problem-sizes.json \
2828
--yes-to-all \
2929
--include-models cuda \
3030
--early-exit-runs \
31-
--problem-type geometry \
32-
--overwrite \
3331
--log info

drivers/run-hip.sbatch

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22
#SBATCH -N 1
3-
#SBATCH -t 05:00:00
4-
#SBATCH -J hip-codellama-34b-hf_prompted
5-
#SBATCH -o run-outputs/codellama-34b-hf_prompted-hip-{{id}}.out
3+
#SBATCH -t 08:00:00
4+
#SBATCH -J hip-gemini-pro
5+
#SBATCH -o run-outputs/gemini-pro-hip-{{id}}.out
66

77
# settings
8-
HASH="a8724ee8"
9-
MODEL="codellama-34b-hf_prompted"
8+
HASH="015cff6f"
9+
MODEL="gemini-pro"
1010
TEMP="0.2"
1111

1212
GENERATED_PROMPTS="../results/${HASH}/${MODEL}_temp${TEMP}/all.json"
@@ -17,14 +17,12 @@ module purge
1717
ml python rocm/5.7.0 flux_wrappers/0.1
1818

1919
python run-all.py \
20-
$OUTPUT \
20+
$GENERATED_PROMPTS \
2121
--output $OUTPUT \
2222
--scratch-dir $SCRATCH_DIR \
2323
--launch-configs launch-configs.json \
2424
--problem-sizes problem-sizes.json \
2525
--yes-to-all \
2626
--include-models hip \
2727
--early-exit-runs \
28-
--problem-type geometry \
29-
--overwrite \
3028
--log info

drivers/run-kokkos.sbatch

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
#SBATCH -N 1
33
#SBATCH --exclusive
44
#SBATCH -p serial
5-
#SBATCH -t 08:00:00
5+
#SBATCH -t 05:00:00
66
#SBATCH -A bhatele-lab-cmsc
7-
#SBATCH -J kokkos-codellama-34b-hf_prompted
8-
#SBATCH -o run-outputs/codellama-34b-hf_prompted-kokkos-%A.out
7+
#SBATCH -J kokkos-gemini-pro
8+
#SBATCH -o run-outputs/gemini-pro-kokkos-%A.out
99

1010
# settings
11-
HASH="a8724ee8"
12-
MODEL="codellama-34b-hf_prompted"
11+
HASH="015cff6f"
12+
MODEL="gemini-pro"
1313
TEMP="0.2"
1414

1515
GENERATED_PROMPTS="../results/${HASH}/${MODEL}_temp${TEMP}/all.json"
@@ -22,14 +22,12 @@ export OMP_PROC_BIND=spread
2222
export OMP_PLACES=cores
2323

2424
python run-all.py \
25-
$OUTPUT \
25+
$GENERATED_PROMPTS \
2626
--output $OUTPUT \
2727
--scratch-dir $SCRATCH_DIR \
2828
--launch-configs launch-configs.json \
2929
--problem-sizes problem-sizes.json \
3030
--yes-to-all \
3131
--include-models kokkos \
3232
--early-exit-runs \
33-
--problem-type geometry \
34-
--overwrite \
3533
--log info

drivers/run-mpi+omp.sbatch

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/bash
22
#SBATCH -N 4
33
#SBATCH --exclusive
4-
#SBATCH -t 06:00:00
4+
#SBATCH -t 05:00:00
55
#SBATCH -A bhatele-lab-cmsc
6-
#SBATCH -J mpi+omp-codellama-34b-hf_prompted
7-
#SBATCH -o run-outputs/codellama-34b-hf_prompted-mpi+omp-%A.out
6+
#SBATCH -J mpi+omp-gemini-pro
7+
#SBATCH -o run-outputs/gemini-pro-mpi+omp-%A.out
88

99
# settings
10-
HASH="a8724ee8"
11-
MODEL="codellama-34b-hf_prompted"
10+
HASH="015cff6f"
11+
MODEL="gemini-pro"
1212
TEMP="0.2"
1313

1414
GENERATED_PROMPTS="../results/${HASH}/${MODEL}_temp${TEMP}/all.json"
@@ -22,15 +22,13 @@ export OMP_PLACES=cores
2222
export OMPI_MCA_opal_warn_on_missing_libcuda=0
2323

2424
python run-all.py \
25-
$OUTPUT \
25+
$GENERATED_PROMPTS \
2626
--output $OUTPUT \
2727
--scratch-dir $SCRATCH_DIR \
2828
--launch-configs launch-configs.json \
2929
--problem-sizes problem-sizes.json \
3030
--yes-to-all \
3131
--include-models mpi+omp \
3232
--early-exit-runs \
33-
--problem-type geometry \
34-
--overwrite \
3533
--run-timeout 60 \
3634
--log info

drivers/run-mpi.sbatch

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash
22
#SBATCH -n 512
3-
#SBATCH -t 08:00:00
3+
#SBATCH -t 04:00:00
44
#SBATCH -A bhatele-lab-cmsc
5-
#SBATCH -J mpi-codellama-34b-hf_prompted
6-
#SBATCH -o run-outputs/codellama-34b-hf_prompted-mpi-%A.out
5+
#SBATCH -J mpi-gemini-pro
6+
#SBATCH -o run-outputs/gemini-pro-mpi-%A.out
77

88
# settings
9-
HASH="a8724ee8"
10-
MODEL="codellama-34b-hf_prompted"
9+
HASH="015cff6f"
10+
MODEL="gemini-pro"
1111
TEMP="0.2"
1212

1313
GENERATED_PROMPTS="../results/${HASH}/${MODEL}_temp${TEMP}/all.json"
@@ -27,7 +27,5 @@ python run-all.py \
2727
--yes-to-all \
2828
--include-models mpi \
2929
--early-exit-runs \
30-
--problem-type geometry \
31-
--overwrite \
3230
--run-timeout 60 \
3331
--log info

0 commit comments

Comments
 (0)