diff --git a/csrc/aio/py_test/parse_aio_stats.py b/csrc/aio/py_test/parse_aio_stats.py index 82adf85ea8a2..60d289819b5b 100755 --- a/csrc/aio/py_test/parse_aio_stats.py +++ b/csrc/aio/py_test/parse_aio_stats.py @@ -9,34 +9,12 @@ import argparse import re -RAW_RATE = 'raw_rate' -E2E_RATE = 'e2e_rate' -SUBMIT_LATENCY = 'submit_latency' -COMPLETE_LATENCY = 'complete_latency' READ_SPEED = 'read_speed' WRITE_SPEED = 'write_speed' -TASK_READ_SPEED = 'task_read_speed' - -PERF_METRICS = [ - RAW_RATE, - E2E_RATE, - SUBMIT_LATENCY, - COMPLETE_LATENCY, - READ_SPEED, - WRITE_SPEED -] -METRIC_SEARCH = { - RAW_RATE: 'ds_raw_time', - E2E_RATE: 'ds_time', - SUBMIT_LATENCY: 'aggr: submit', - COMPLETE_LATENCY: 'aggr: complete', - READ_SPEED: 'E2E Read Speed', - WRITE_SPEED: 'E2E Write Speed' -} - -NUM_BYTES = (400 * 1024 * 1024) -NUM_GIGA_BYTES = (1024 * 1024 * 1024) +PERF_METRICS = [READ_SPEED, WRITE_SPEED] + +METRIC_SEARCH = {READ_SPEED: 'E2E Read Speed', WRITE_SPEED: 'E2E Write Speed'} def parse_arguments(): @@ -47,13 +25,10 @@ def parse_arguments(): required=True, help='Folder of statistics logs') - parser.add_argument( - '--metric', - type=str, - required=True, - help= - 'Performance metric to report: [raw_rate|e2e_rate|submit_latency|complete_latency]' - ) + parser.add_argument('--metric', + type=str, + required=True, + help='Performance metric to report: [read_speed|write_speed]') args = parser.parse_args() print(f'args = {args}') @@ -101,18 +76,24 @@ def get_thread_count(file): return 1 +""" +Extract performance metric from log file. +Sample file lines are: +Task Read Latency = 0.031647682189941406 sec +Task Read Speed = 12.342926020792527 GB/sec +E2E Read Latency = 0.031697988510131836 sec +E2E Read Speed = 12.323337169333062 GB/sec + +For the above sample, -metric = "read_speed" corresponds to "E2E Read Speed", and 12.32 will be returned +""" + + def get_metric(file, metric): thread_count = get_thread_count(file) - num_giga_bytes = NUM_BYTES / NUM_GIGA_BYTES with open(file) as f: for line in f.readlines(): if line.startswith(METRIC_SEARCH[metric]): - if metric == RAW_RATE: - fields = line.split() - raw_time_sec = float(fields[2]) / 1e06 - raw_rate = (thread_count * num_giga_bytes * 1.0) / raw_time_sec - return raw_rate - elif metric in [READ_SPEED, WRITE_SPEED]: + if metric in [READ_SPEED, WRITE_SPEED]: fields = line.split() return float(fields[-2]) else: diff --git a/csrc/aio/py_test/run_read_sweep.sh b/csrc/aio/py_test/run_read_sweep.sh index 8ef29d973d58..51d79f270dc3 100755 --- a/csrc/aio/py_test/run_read_sweep.sh +++ b/csrc/aio/py_test/run_read_sweep.sh @@ -10,7 +10,7 @@ if [[ ! -f ${INPUT_FILE} ]]; then exit 1 fi -LOG_DIR=$2 +LOG_DIR=$2/aio_perf_sweep RUN_SCRIPT=./test_ds_aio.py READ_OPT="--read_file ${INPUT_FILE}" diff --git a/csrc/aio/py_test/run_write_sweep.sh b/csrc/aio/py_test/run_write_sweep.sh index 0360934b469e..9cb4c169423b 100755 --- a/csrc/aio/py_test/run_write_sweep.sh +++ b/csrc/aio/py_test/run_write_sweep.sh @@ -16,7 +16,7 @@ fi SIZE="$1M" WRITE_DIR=$2 -LOG_DIR=$3 +LOG_DIR=$3/aio_perf_sweep OUTPUT_FILE=${WRITE_DIR}/ds_aio_write_${SIZE}B.pt WRITE_OPT="--write_file ${OUTPUT_FILE} --write_size ${SIZE}" @@ -43,7 +43,7 @@ for sub in single block; do for p in 1; do for d in 1 2 4 8 16 32; do for bs in 128K 256K 512K 1M; do - SCHED_OPTS="${sub_opt} ${ov_opt} --handle --threads 1" + SCHED_OPTS="${sub_opt} ${ov_opt} --handle --threads ${t}" OPTS="--io_parallel ${p} --queue_depth ${d} --block_size ${bs}" LOG="${LOG_DIR}/write_${SIZE}B_${sub}_${ov}_t${t}_p${p}_d${d}_bs${bs}.txt" cmd="python ${RUN_SCRIPT} ${WRITE_OPT} ${OPTS} ${SCHED_OPTS} &> ${LOG}" diff --git a/csrc/aio/py_test/test_ds_aio_utils.py b/csrc/aio/py_test/test_ds_aio_utils.py index 689a0a503247..df6a95fcfcea 100755 --- a/csrc/aio/py_test/test_ds_aio_utils.py +++ b/csrc/aio/py_test/test_ds_aio_utils.py @@ -7,7 +7,7 @@ import os -GIGABYTE = 1024**3 +BYTES_PER_GB = 1024**3 LOG_TIDS = [0] @@ -32,11 +32,11 @@ def report_results(args, read_op, pool_results): total_bytes = sum([num_bytes for _, _, num_bytes in pool_results]) task_latency_sec = max([sec for _, sec, _ in pool_results]) - task_speed_GB = total_bytes / task_latency_sec / GIGABYTE + task_speed_GB = total_bytes / task_latency_sec / BYTES_PER_GB print(f'Task {io_string} Latency = {task_latency_sec} sec') print(f'Task {io_string} Speed = {task_speed_GB} GB/sec') e2e_latency_sec = max([sec for sec, _, _ in pool_results]) - e2e_speed_GB = total_bytes / e2e_latency_sec / GIGABYTE + e2e_speed_GB = total_bytes / e2e_latency_sec / BYTES_PER_GB print(f'E2E {io_string} Latency = {e2e_latency_sec} sec') print(f'E2E {io_string} Speed = {e2e_speed_GB} GB/sec')