Skip to content
Snippets Groups Projects
Commit 035d694f authored by Christoph Alt's avatar Christoph Alt
Browse files

also uploading the profiling data

parent ebdb9fc2
No related branches found
No related tags found
1 merge request!7Add a new benchmark case
Pipeline #709234 passed
Pipeline: cx-test

#709235

    ......@@ -69,6 +69,8 @@
    "project_id_regex": "",
    "after_script": [
    "!reference [.export_variables, before_script]",
    "!reference [.upload, script]",
    "export DATAFILE=$(echo gpu_profile_*.sqlite3)",
    "!reference [.upload, script]"
    ]
    }
    ......
    ......@@ -15,7 +15,7 @@ dev_name=$(nvidia-smi --id=${VISABLE_DEVICE} --query-gpu=gpu_name --format=csv,n
    # first test case channelflow
    basename_exe=$(basename ${EXECUTABLE})
    profile_file="ncuprofile_channelflow_${basename_exe}_${dev_name}"
    profile_file="ncuprofile_channelflow_${dev_name}"
    # with profling
    cmdChannelFlow="${PROFILING} -o $profile_file $MPIRUN $FULL_EXECUTABLE $FULL_ARGUMENT -NumericalSetup.timeSteps=2 -NumericalSetup.useParticles=false"
    ......@@ -30,12 +30,12 @@ export DB_FILE="gpu_benchmark_percolation_${dev_name}.sqlite3"
    $cmdChannelFlow || echo "$cmdChannelFlow failed"
    # second test case percolation
    profile_file="ncuprofile_percolation_${basename_exe}_${dev_name}"
    profile_file="ncuprofile_percolation_${dev_name}"
    # with profling
    cmdPercolation="${PROFILING} -o $profile_file $MPIRUN $FULL_EXECUTABLE $FULL_ARGUMENT -NumericalSetup.timeSteps=2"
    export DB_FILE="gpu_profile_percolation_${dev_name}.sqlite3"
    echo "Runing $cmdPercolation"
    export DB_FILE="gpu_profile_percolation_${dev_name}.sqlite3"
    $cmdPercolation && ncu -i "${profile_file}.ncu-rep" --csv --page=raw > "$(basename -s ".ncu-rep" ${profile_file})".csv || echo "${cmdPercolation} failed"
    # without profiling
    ......
    ......@@ -49,7 +49,8 @@ def mesa_pd_sqlite(
    for timing in cb.build_iterate_query(
    connection, from_table="timingPool", where_args=["runId", runid]
    ):
    fields.update({timing["sweep"]: timing["average"] * timing["count"]})
    fields.update(
    {timing["sweep"]: timing["average"] * timing["count"]})
    yield cb.DataPoint(
    "MESA_PD_KernelBenchmark", time=time, fields=fields, tags=tags
    ......@@ -78,9 +79,10 @@ def add_likwid_fields(search_pattern: str, perf_group: str) -> dict:
    return {}
    def add_ncu_profile(search_pattern: str):
    def add_ncu_profile(search_pattern: str, path="."):
    try:
    ncu_file = find_profile_file(f"ncuprofile_*{search_pattern}*.csv")
    ncu_file = find_profile_file(
    f"ncuprofile_*{search_pattern}*.csv", path=path)
    except (FileNotFoundError,) as e:
    logger.info(e)
    return {}, {}
    ......@@ -128,7 +130,8 @@ def _iter_runs(runs, *, measurement_name, perf_group: str, gpu_name=None):
    dp.tags.update(
    {
    "mpi_num_processes": prod(
    [int(run[key]) for key in run.keys() if key.startswith("block")]
    [int(run[key])
    for key in run.keys() if key.startswith("block")]
    )
    }
    )
    ......@@ -263,6 +266,16 @@ def percolation_sqlite(
    *,
    perf_group: str,
    ):
    measurement_name = "PercolationGPU"
    basename = Path(db_file).stem
    basename_splitted = basename.split("_")
    gpu_name = basename_splitted[-1]
    benchmark_case = ""
    profile = False
    if basename.startswith("gpu_profile"):
    profile = True
    measurement_name += "_profile"
    with cb.sqlite_context(db_file) as connection:
    runs = cb.query_complete_table(connection, "runs")
    field_keys = [
    ......@@ -275,6 +288,7 @@ def percolation_sqlite(
    "time",
    "timeStepsPerSecond",
    ]
    for run in runs.fetchall():
    time = cb.util.get_time_stamp_from_env(
    fallback=lambda: cb.util.time_conversion(run["timestamp"])
    ......@@ -289,6 +303,17 @@ def percolation_sqlite(
    for col in ["average", "min", "max", "count", "variance", "percentage"]:
    fields.update({f'{timing["sweep"]}_{col}': timing[col]})
    yield cb.DataPoint(
    "PercolationGPU", time=time, fields=fields, tags=tags
    ).asdict()
    if profile:
    benchmark_case = (
    "percolation" if tags["useParticles"] else "channelflow"
    )
    ncu_fields, ncu_tags = add_ncu_profile(
    f"{benchmark_case}*_{gpu_name}", path=os.path.dirname(db_file)
    )
    fields.update(ncu_fields)
    tags.update(ncu_tags)
    dp = cb.DataPoint(measurement_name, time=time,
    fields=fields, tags=tags)
    yield dp.asdict()
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment