Skip to content

add gemini #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions drivers/cpp/models/cuda-driver.cu
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ int main(int argc, char **argv) {
/* initialize */
Context *ctx = init();

/* validate */
const bool isValid = validate(ctx);
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
if (!isValid) {
destroy(ctx);
return 0;
}

/* benchmark */
double totalTime = 0.0;
CudaTimer timer;
Expand Down Expand Up @@ -110,10 +118,6 @@ int main(int argc, char **argv) {
}
printf("BestSequential: %.*f\n", DBL_DIG-1, totalTime / NITER);

/* validate */
const bool isValid = validate(ctx);
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");

/* cleanup */
destroy(ctx);

Expand Down
12 changes: 8 additions & 4 deletions drivers/cpp/models/hip-driver.cu
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ int main(int argc, char **argv) {
/* initialize */
Context *ctx = init();

/* validate */
const bool isValid = validate(ctx);
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
if (!isValid) {
destroy(ctx);
return 0;
}

/* benchmark */
double totalTime = 0.0;
HipTimer timer;
Expand Down Expand Up @@ -110,10 +118,6 @@ int main(int argc, char **argv) {
}
printf("BestSequential: %.*f\n", DBL_DIG-1, totalTime / NITER);

/* validate */
const bool isValid = validate(ctx);
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");

/* cleanup */
destroy(ctx);

Expand Down
13 changes: 9 additions & 4 deletions drivers/cpp/models/kokkos-driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ int main(int argc, char **argv) {
/* initialize */
Context *ctx = init();

/* validate */
const bool isValid = validate(ctx);
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
if (!isValid) {
destroy(ctx);
Kokkos::finalize();
return 0;
}

/* benchmark */
double totalTime = 0.0;
Kokkos::Timer timer;
Expand All @@ -67,10 +76,6 @@ int main(int argc, char **argv) {
}
printf("BestSequential: %.*f\n", DBL_DIG-1, totalTime / NITER);

/* validate */
const bool isValid = validate(ctx);
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");

/* cleanup */
destroy(ctx);

Expand Down
18 changes: 12 additions & 6 deletions drivers/cpp/models/mpi-driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ int main(int argc, char **argv) {
/* initialize */
Context *ctx = init();

/* validate */
const bool isValid = validate(ctx);
if (rank == 0) {
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");

if (!isValid) {
destroy(ctx);
MPI_Abort(MPI_COMM_WORLD, 0);
return 0;
}
}

/* benchmark */
double totalTime = 0.0;
for (int i = 0; i < NITER; i += 1) {
Expand Down Expand Up @@ -85,12 +97,6 @@ int main(int argc, char **argv) {
}
MPI_Barrier(MPI_COMM_WORLD);

/* validate */
const bool isValid = validate(ctx);
if (rank == 0) {
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
}

/* cleanup */
destroy(ctx);

Expand Down
18 changes: 12 additions & 6 deletions drivers/cpp/models/mpi-omp-driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ int main(int argc, char **argv) {
/* initialize */
Context *ctx = init();

/* validate */
const bool isValid = validate(ctx);
if (rank == 0) {
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");

if (!isValid) {
destroy(ctx);
MPI_Abort(MPI_COMM_WORLD, 0);
return 0;
}
}

/* benchmark */
double totalTime = 0.0;
for (int i = 0; i < NITER; i += 1) {
Expand Down Expand Up @@ -88,12 +100,6 @@ int main(int argc, char **argv) {
}
MPI_Barrier(MPI_COMM_WORLD);

/* validate */
const bool isValid = validate(ctx);
if (rank == 0) {
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
}

/* cleanup */
destroy(ctx);

Expand Down
12 changes: 8 additions & 4 deletions drivers/cpp/models/omp-driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ int main(int argc, char **argv) {
/* initialize */
Context *ctx = init();

/* validate */
const bool isValid = validate(ctx);
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
if (!isValid) {
destroy(ctx);
return 0;
}

/* benchmark */
double totalTime = 0.0;
for (int i = 0; i < NITER; i += 1) {
Expand All @@ -69,10 +77,6 @@ int main(int argc, char **argv) {
}
printf("BestSequential: %.*f\n", DBL_DIG-1, totalTime / NITER);

/* validate */
const bool isValid = validate(ctx);
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");

/* cleanup */
destroy(ctx);

Expand Down
12 changes: 8 additions & 4 deletions drivers/cpp/models/serial-driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ int main(int argc, char **argv) {
/* initialize */
Context *ctx = init();

/* validate */
const bool isValid = validate(ctx);
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");
if (!isValid) {
destroy(ctx);
return 0;
}

/* benchmark */
double totalTime = 0.0;
for (int i = 0; i < NITER; i += 1) {
Expand All @@ -68,10 +76,6 @@ int main(int argc, char **argv) {
}
printf("BestSequential: %.*f\n", DBL_DIG-1, totalTime / NITER);

/* validate */
const bool isValid = validate(ctx);
printf("Validation: %s\n", isValid ? "PASS" : "FAIL");

/* cleanup */
destroy(ctx);

Expand Down
2 changes: 1 addition & 1 deletion drivers/driver_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def are_all_valid(self) -> bool:
def best_sequential_runtime(self) -> Optional[float]:
""" Return the min value for sequential runtime. """
if self.did_build() and self.did_any_run():
return min(r.best_sequential_runtime for r in self.run_outputs if r.best_sequential_runtime is not None)
return min((r.best_sequential_runtime for r in self.run_outputs if r.best_sequential_runtime is not None), default=None)
else:
return None

Expand Down
12 changes: 5 additions & 7 deletions drivers/run-cuda.sbatch
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#SBATCH --gpus=a100:1
#SBATCH -t 05:00:00
#SBATCH -A bhatele-lab-cmsc
#SBATCH -J cuda-codellama-34b-hf_prompted
#SBATCH -o run-outputs/codellama-34b-hf_prompted-cuda-%A.out
#SBATCH -J cuda-gemini-pro
#SBATCH -o run-outputs/gemini-pro-cuda-%A.out

# settings
HASH="a8724ee8"
MODEL="codellama-34b-hf_prompted"
HASH="015cff6f"
MODEL="gemini-pro"
TEMP="0.2"

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

python run-all.py \
$OUTPUT \
$GENERATED_PROMPTS \
--output $OUTPUT \
--scratch-dir $SCRATCH_DIR \
--launch-configs launch-configs.json \
--problem-sizes problem-sizes.json \
--yes-to-all \
--include-models cuda \
--early-exit-runs \
--problem-type geometry \
--overwrite \
--log info
14 changes: 6 additions & 8 deletions drivers/run-hip.sbatch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
#SBATCH -N 1
#SBATCH -t 05:00:00
#SBATCH -J hip-codellama-34b-hf_prompted
#SBATCH -o run-outputs/codellama-34b-hf_prompted-hip-{{id}}.out
#SBATCH -t 08:00:00
#SBATCH -J hip-gemini-pro
#SBATCH -o run-outputs/gemini-pro-hip-{{id}}.out

# settings
HASH="a8724ee8"
MODEL="codellama-34b-hf_prompted"
HASH="015cff6f"
MODEL="gemini-pro"
TEMP="0.2"

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

python run-all.py \
$OUTPUT \
$GENERATED_PROMPTS \
--output $OUTPUT \
--scratch-dir $SCRATCH_DIR \
--launch-configs launch-configs.json \
--problem-sizes problem-sizes.json \
--yes-to-all \
--include-models hip \
--early-exit-runs \
--problem-type geometry \
--overwrite \
--log info
14 changes: 6 additions & 8 deletions drivers/run-kokkos.sbatch
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#SBATCH -N 1
#SBATCH --exclusive
#SBATCH -p serial
#SBATCH -t 08:00:00
#SBATCH -t 05:00:00
#SBATCH -A bhatele-lab-cmsc
#SBATCH -J kokkos-codellama-34b-hf_prompted
#SBATCH -o run-outputs/codellama-34b-hf_prompted-kokkos-%A.out
#SBATCH -J kokkos-gemini-pro
#SBATCH -o run-outputs/gemini-pro-kokkos-%A.out

# settings
HASH="a8724ee8"
MODEL="codellama-34b-hf_prompted"
HASH="015cff6f"
MODEL="gemini-pro"
TEMP="0.2"

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

python run-all.py \
$OUTPUT \
$GENERATED_PROMPTS \
--output $OUTPUT \
--scratch-dir $SCRATCH_DIR \
--launch-configs launch-configs.json \
--problem-sizes problem-sizes.json \
--yes-to-all \
--include-models kokkos \
--early-exit-runs \
--problem-type geometry \
--overwrite \
--log info
14 changes: 6 additions & 8 deletions drivers/run-mpi+omp.sbatch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
#SBATCH -N 4
#SBATCH --exclusive
#SBATCH -t 06:00:00
#SBATCH -t 05:00:00
#SBATCH -A bhatele-lab-cmsc
#SBATCH -J mpi+omp-codellama-34b-hf_prompted
#SBATCH -o run-outputs/codellama-34b-hf_prompted-mpi+omp-%A.out
#SBATCH -J mpi+omp-gemini-pro
#SBATCH -o run-outputs/gemini-pro-mpi+omp-%A.out

# settings
HASH="a8724ee8"
MODEL="codellama-34b-hf_prompted"
HASH="015cff6f"
MODEL="gemini-pro"
TEMP="0.2"

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

python run-all.py \
$OUTPUT \
$GENERATED_PROMPTS \
--output $OUTPUT \
--scratch-dir $SCRATCH_DIR \
--launch-configs launch-configs.json \
--problem-sizes problem-sizes.json \
--yes-to-all \
--include-models mpi+omp \
--early-exit-runs \
--problem-type geometry \
--overwrite \
--run-timeout 60 \
--log info
12 changes: 5 additions & 7 deletions drivers/run-mpi.sbatch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
#SBATCH -n 512
#SBATCH -t 08:00:00
#SBATCH -t 04:00:00
#SBATCH -A bhatele-lab-cmsc
#SBATCH -J mpi-codellama-34b-hf_prompted
#SBATCH -o run-outputs/codellama-34b-hf_prompted-mpi-%A.out
#SBATCH -J mpi-gemini-pro
#SBATCH -o run-outputs/gemini-pro-mpi-%A.out

# settings
HASH="a8724ee8"
MODEL="codellama-34b-hf_prompted"
HASH="015cff6f"
MODEL="gemini-pro"
TEMP="0.2"

GENERATED_PROMPTS="../results/${HASH}/${MODEL}_temp${TEMP}/all.json"
Expand All @@ -27,7 +27,5 @@ python run-all.py \
--yes-to-all \
--include-models mpi \
--early-exit-runs \
--problem-type geometry \
--overwrite \
--run-timeout 60 \
--log info
Loading