Skip to content

bpo-37707: Exclude expensive unit tests from PGO task #15009

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

Merged
merged 3 commits into from
Jul 30, 2019

Conversation

nascheme
Copy link
Member

@nascheme nascheme commented Jul 29, 2019

Mark some individual tests to skip when --pgo is used. The tests
marked increase the PGO task time significantly and likely don't
help improve optimization of the final executable.

Marked tests:

pickletester
  check_frame_opcodes
  test_framing_many_objects

test_bz2
  testCompress4G
  testDecompress4G

test_itertools
  test_long_chain_of_empty_iterables

test_lzma
  test_compressor_bigmem
  test_decompressor_bigmem

test_statistics
  test_inv_cdf

https://bugs.python.org/issue37707

nascheme added 2 commits July 29, 2019 11:26
Mark some individual tests to skip when --pgo is used.  The tests
marked increase the PGO task time significantly and likely don't
help improve optimization of the final executable.
Copy link
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

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

Nice! Such a pgo skip decorator approach is exactly what I was thinking of recommending when you brought this up. :)

@zooba
Copy link
Member

zooba commented Jul 29, 2019

I haven't looked through exactly what these tests do, but I'd say it's worth evaluating ("guessing") whether they represent a common scenario or not. Even if they run for a long time, if it's something that's going to run a lot in user code then I'd rather keep it in.

99% of realistic Python runtime ("evaluated"/"guessed") is success cases, but a lot of the quick tests in the suite are going to exercise setup/teardown and failure paths. Let's not over-focus on those for the sake of a quick PGO run.

@nascheme
Copy link
Member Author

I intended that --pgo will give you an optimized build without too much extra build time. Before PR #14702, the PGO builds took so long that in practice it seems that many did not bother to use them. If you don't care at all about long build time, then --pgo-extended is the option for that. If we make expensive tests run in the --pgo case, I don't see the point of --pgo-extended.

Something I was thinking about previously, --pgo-extended should not not skip the tests marked with @skip_if_pgo_task. That way, people who want the most extensive code coverage can still use --pgo-extended to get the old behavior.

@nascheme
Copy link
Member Author

Here is a comparison of test run time before and after my skip decorator.

test before [s] after [s]
test_pickle 4.86 1.79
test_bz2 1.98 0.51
test_itertools 1.51 1.12
test_lzma 2.65 0.19
test_statistics 1.84 0.57

@pablogsal
Copy link
Member

pablogsal commented Jul 30, 2019

I haven't looked through exactly what these tests do, but I'd say it's worth evaluating ("guessing") whether they represent a common scenario or not.

I did two PGO builds with and without this PR and pyperformance shows no significant difference (all differences were <1%). I am using core isolation and affinity for them so I trust the stability of the result but I can repeat them if we need to double check.

Something I was thinking about previously, --pgo-extended should not not skip the tests marked with @skip_if_pgo_task. That way, people who want the most extensive code coverage can still use --pgo-extended to get the old behavior.

+1

@nascheme nascheme added type-feature A feature request or enhancement needs backport to 3.8 labels Jul 30, 2019
@nascheme nascheme merged commit 52a48e6 into python:master Jul 30, 2019
@miss-islington
Copy link
Contributor

Thanks @nascheme for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@nascheme nascheme deleted the pgo_skip_expensive_tests branch July 30, 2019 18:08
@bedevere-bot
Copy link

GH-15024 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 30, 2019
Mark some individual tests to skip when --pgo is used.  The tests
marked increase the PGO task time significantly and likely don't
help improve optimization of the final executable.
(cherry picked from commit 52a48e6)

Co-authored-by: Neil Schemenauer <[email protected]>
nascheme added a commit that referenced this pull request Jul 30, 2019
)

Mark some individual tests to skip when --pgo is used.  The tests
marked increase the PGO task time significantly and likely don't
help improve optimization of the final executable.
(cherry picked from commit 52a48e6)

Co-authored-by: Neil Schemenauer <[email protected]>
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
Mark some individual tests to skip when --pgo is used.  The tests
marked increase the PGO task time significantly and likely don't
help improve optimization of the final executable.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Mark some individual tests to skip when --pgo is used.  The tests
marked increase the PGO task time significantly and likely don't
help improve optimization of the final executable.
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
Mark some individual tests to skip when --pgo is used.  The tests
marked increase the PGO task time significantly and likely don't
help improve optimization of the final executable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants