Skip to content

[Perf] Enhance test.sh and perf_report.py to support multiple iterations.#85

Merged
gapisback merged 1 commit intomainfrom
gapisback/run-multi-iters-perf
Jun 17, 2024
Merged

[Perf] Enhance test.sh and perf_report.py to support multiple iterations.#85
gapisback merged 1 commit intomainfrom
gapisback/run-multi-iters-perf

Conversation

@gapisback
Copy link
Copy Markdown
Collaborator

In previous performance test-runs, we were able to only run one iteration of the client-server program for each run-type, test-parameter. We were seeing some fluctuations and unexpected results in the comparison report.

This commit enhances the testing framework to:
a) Run 1 or more iterations of the client/server program
b) Extend the Python perf-comparison report generator to work
with another source of input metrics-line(s).
c) Comparison report generated using median value of the
relevant metric across the n-iterations.

Note: (b) was needed as runs on AWS were aborted midway and had to be partially re-run. We add Python parsing logic to extract out and massage metrics from "Summary: " output lines, that the server program emits to stdout.

  • To run multiple iterations, use env-var L3_PERF_TEST_NUM_ITERS=

Workflow to run the enhanced perf_report.py:

  • Run test.sh with diff server-threads and #iterations.

Example:
L3_PERF_TEST_NUM_ITERS=5 L3_PERF_SERVER_NUM_THREADS="1 2 4 8" ./test.sh --clock-default $((1000 * 1000))

  • Redirect output to a /tmp/file: > /tmp/perf.out 2>&1

  • grep 'Summary:' /tmp/perf.out > /tmp/perf.summary.out

  • Feed the summary file to the Python tool using:

    ./scripts/perf_report.py --summary-file /tmp/perf.summary.out

  • tests/pytests/perf_report_test.py:

    • Add unit-test cases for new parsing methods added

Comment thread scripts/perf_report.py
FLD_AVG_ELAPSED_TIME_IDX = 5
FLD_SERVER_THROUGHPUT_IDX = 6
FLD_CLIENT_THROUGHPUT_IDX = 7
FLD_AVG_OPS_PER_THREAD_IDX = 8
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New parsing interfaces to pluck metrics fields from comma-separated Summary: line in stdout.

Comment thread scripts/perf_report.py
# Run through diff server-thread parameters, and generate report
# We make multiple passes extracing metrics for each combination
# of #-of-server-threads and run-types.
for threads in list_of_nthreads:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new approach simplifies the post-processing.

We make multiple passes on the output lines, looking for lines of interest to consolidate and to generate aggregate metrics from.

Comment thread test.sh
# using env-var as:
#
# SERVER_NUM_THREADS="1 2 4 8" ./test.sh run-all-client-server-perf-tests
# L3_PERF_SERVER_NUM_THREADS="1 2 4 8" ./test.sh run-all-client-server-perf-tests
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slight change in env-var: Use L3_PERF prefix, to namespace the env-vars used by this script.

@gapisback gapisback requested a review from gregthelaw June 16, 2024 03:32
@gapisback gapisback added enhancement New feature or request performance Performance / benchmarking related labels Jun 16, 2024
Copy link
Copy Markdown
Contributor

@gregthelaw gregthelaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclaimer: I've only skimmed over this, but it all looks pretty useful / non-controversial.

Comment thread scripts/perf_report.py Outdated

# Key: Run-type 'Baseline - No logging'; Value: [ <metrics> ]
metrics_by_run = OrderedDict()
# metrics_by_run = OrderedDict()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this deliberately committed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't recall. Cruft. Cleaned it up.

@gapisback gapisback force-pushed the gapisback/run-multi-iters-perf branch 2 times, most recently from 24847ed to 7e70955 Compare June 17, 2024 16:29
…ons.

In previous performance test-runs, we were able to only run one iteration
of the client-server program for each run-type, test-parameter. We were
seeing some fluctuations and unexpected results in the comparison report.

This commit enhances the testing framework to:

 a) Run 1 or more iterations of the client/server program

 b) Extend the Python perf-comparison report generator to work
    with another source of input metrics-line(s).

 c) Comparison report generated using the median value of the
    relevant metric across the n-iterations.

Note: (b) was needed as runs on AWS were aborted midway and had to
be partially re-run. We add Python parsing logic to extract out
and massage metrics from "Summary: " output lines, that the server
program emits to `stdout`. This expedited the report generation task
w/o having to re-run all perf-tests on AWS instances. This approach
re-casts the new summary data into an input format needed by the
existing report generation logic.

- To run multiple iterations, use env-var L3_PERF_TEST_NUM_ITERS=<n>

Workflow to run the enhanced perf_report.py:

  - Run test.sh with diff server-threads and #iterations.

Example:
 L3_PERF_TEST_NUM_ITERS=5 L3_PERF_SERVER_NUM_THREADS="1 2 4 8" ./test.sh --clock-default $((1000 * 1000))

  - Redirect output to a /tmp/file: > /tmp/perf.out 2>&1

  - grep 'Summary:' /tmp/perf.out > /tmp/perf.summary.out

  - Feed the summary file to the Python tool using:

    ./scripts/perf_report.py --summary-file /tmp/perf.summary.out

- tests/pytests/perf_report_test.py:

  - Add unit-test cases for new parsing methods added
@gapisback gapisback force-pushed the gapisback/run-multi-iters-perf branch from 7e70955 to 3460fd5 Compare June 17, 2024 16:34
@gapisback gapisback merged commit 2efc660 into main Jun 17, 2024
@gapisback gapisback deleted the gapisback/run-multi-iters-perf branch June 17, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request performance Performance / benchmarking related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants