Skip to content

Commit

Permalink
scripts: create scripts for all miniapps {strong, weak} x {gpu, mc} +…
Browse files Browse the repository at this point in the history
… include local benchmarks (#840)
  • Loading branch information
rasolca committed Apr 19, 2023
1 parent ed4193e commit 6a8a3d7
Show file tree
Hide file tree
Showing 5 changed files with 489 additions and 140 deletions.
143 changes: 143 additions & 0 deletions scripts/gen_dlaf_strong-gpu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#!/usr/bin/env python3

#
# Distributed Linear Algebra with Future (DLAF)
#
# Copyright (c) 2018-2023, ETH Zurich
# All rights reserved.
#
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause
#

# This file is an example on how to use the miniapp module.
# Please do not add gen scripts used for benchmarks into the source repository,
# they should be kept with the result produced.

import argparse
import miniapps as mp
import systems

system = systems.cscs["daint-gpu"]

dlafpath = "<path_to_dlaf_build_dir>"

run_dir = f"~/ws/runs/strong"

time = 400 # minutes
nruns = 5
nodes_arr = [1, 2, 4, 8, 16]

rpn = 1
m_szs = [10240, 20480, 30097, 40960]
mb_szs = 1024

extra_flags = "--dlaf:bt-band-to-tridiag-hh-apply-group-size=128"

parser = argparse.ArgumentParser(description="Run strong scaling benchmarks.")
parser.add_argument(
"--debug",
help="Don't submit jobs, only create job scripts instead.",
action="store_true",
)
args = parser.parse_args()

debug = args.debug


def createAndSubmitRun(run_dir, nodes_arr, **kwargs):
run = mp.StrongScaling(system, "DLAF_test_strong", "job_dlaf", nodes_arr, time)

run.add(
mp.chol,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs},
nruns,
**kwargs,
)
run.add(
mp.gen2std,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs},
nruns,
**kwargs,
)
run.add(
mp.red2band,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "band": 128},
nruns,
**kwargs,
)
run.add(
mp.band2trid,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "band": 128},
nruns,
**kwargs,
)
run.add(
mp.trid_evp,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs},
nruns,
**kwargs,
)
run.add(
mp.bt_band2trid,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "band": 128, "n_sz": None},
nruns,
**kwargs,
)
run.add(
mp.bt_red2band,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "band": 128, "n_sz": None},
nruns,
**kwargs,
)
run.add(
mp.trsm,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "n_sz": None},
nruns,
**kwargs,
)

fullsolver_args = kwargs
fullsolver_args["extra_flags"] = kwargs.get("extra_flags", "") + " --check=last"

run.add(
mp.evp,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "min_band": None},
nruns,
**fullsolver_args,
)
run.add(
mp.gevp,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "min_band": None},
nruns,
**fullsolver_args,
)

run.submit(run_dir, debug=debug)


# actual benchmark
createAndSubmitRun(run_dir, nodes_arr, extra_flags=extra_flags)

# additional benchmark collecting "local" implementation results in <run_dir>-local directory
createAndSubmitRun(run_dir + "-local", [1 / rpn], extra_flags=extra_flags + " --local")
143 changes: 143 additions & 0 deletions scripts/gen_dlaf_strong-mc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#!/usr/bin/env python3

#
# Distributed Linear Algebra with Future (DLAF)
#
# Copyright (c) 2018-2023, ETH Zurich
# All rights reserved.
#
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause
#

# This file is an example on how to use the miniapp module.
# Please do not add gen scripts used for benchmarks into the source repository,
# they should be kept with the result produced.

import argparse
import miniapps as mp
import systems

system = systems.cscs["daint-mc"]

dlafpath = "<path_to_dlaf_build_dir>"

run_dir = f"~/ws/runs/strong"

time = 400 # minutes
nruns = 5

nodes_arr = [0.5, 1, 2, 4, 8, 16]
rpn = 2
m_szs = [10240, 20480, 30097, 40960]
mb_szs = 512

extra_flags = "--dlaf:bt-band-to-tridiag-hh-apply-group-size=64"

parser = argparse.ArgumentParser(description="Run strong scaling benchmarks.")
parser.add_argument(
"--debug",
help="Don't submit jobs, only create job scripts instead.",
action="store_true",
)
args = parser.parse_args()

debug = args.debug


def createAndSubmitRun(run_dir, nodes_arr, **kwargs):
run = mp.StrongScaling(system, "DLAF_test_strong", "job_dlaf", nodes_arr, time)

run.add(
mp.chol,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs},
nruns,
**kwargs,
)
run.add(
mp.gen2std,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs},
nruns,
**kwargs,
)
run.add(
mp.red2band,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "band": 128},
nruns,
**kwargs,
)
run.add(
mp.band2trid,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "band": 128},
nruns,
**kwargs,
)
run.add(
mp.trid_evp,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs},
nruns,
**kwargs,
)
run.add(
mp.bt_band2trid,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "band": 128, "n_sz": None},
nruns,
**kwargs,
)
run.add(
mp.bt_red2band,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "band": 128, "n_sz": None},
nruns,
**kwargs,
)
run.add(
mp.trsm,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "n_sz": None},
nruns,
**kwargs,
)

fullsolver_args = kwargs
fullsolver_args["extra_flags"] = kwargs.get("extra_flags", "") + " --check=last"

run.add(
mp.evp,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "min_band": None},
nruns,
**fullsolver_args,
)
run.add(
mp.gevp,
"dlaf",
dlafpath,
{"rpn": rpn, "m_sz": m_szs, "mb_sz": mb_szs, "min_band": None},
nruns,
**fullsolver_args,
)

run.submit(run_dir, debug=debug)


# actual benchmark
createAndSubmitRun(run_dir, nodes_arr, extra_flags=extra_flags)

# additional benchmark collecting "local" implementation results in <run_dir>-local directory
createAndSubmitRun(run_dir + "-local", [1 / rpn], extra_flags=extra_flags + " --local")
Loading

0 comments on commit 6a8a3d7

Please sign in to comment.