Skip to content
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

Minor usability tweaks/fixes #1001

Merged
merged 9 commits into from
Apr 23, 2021
43 changes: 8 additions & 35 deletions csrc/aio/py_test/parse_aio_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +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'
}
PERF_METRICS = [READ_SPEED, WRITE_SPEED]

METRIC_SEARCH = {READ_SPEED: 'E2E Read Speed', WRITE_SPEED: 'E2E Write Speed'}

NUM_BYTES = (400 * 1024 * 1024)
NUM_GIGA_BYTES = (1024 * 1024 * 1024)
tjruwase marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -47,13 +28,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]')
tjruwase marked this conversation as resolved.
Show resolved Hide resolved

args = parser.parse_args()
print(f'args = {args}')
Expand Down Expand Up @@ -107,12 +85,7 @@ def get_metric(file, metric):
with open(file) as f:
tjruwase marked this conversation as resolved.
Show resolved Hide resolved
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]:
tjruwase marked this conversation as resolved.
Show resolved Hide resolved
fields = line.split()
return float(fields[-2])
else:
Expand Down
2 changes: 1 addition & 1 deletion csrc/aio/py_test/run_read_sweep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
4 changes: 2 additions & 2 deletions csrc/aio/py_test/run_write_sweep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}"
Expand Down