Skip to content

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

Merged
nascheme merged 3 commits into
python:masterfrom
nascheme:pgo_skip_expensive_tests
Jul 30, 2019
Merged

bpo-37707: Exclude expensive unit tests from PGO task#15009
nascheme merged 3 commits into
python:masterfrom
nascheme:pgo_skip_expensive_tests

Conversation

@nascheme

@naschemenascheme commented Jul 29, 2019

Copy link
Copy Markdown
Member

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

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.

@gpsheadgpshead left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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

testbefore [s]after [s]
test_pickle4.861.79
test_bz21.980.51
test_itertools1.511.12
test_lzma2.650.19
test_statistics1.840.57

@pablogsal

pablogsal commented Jul 30, 2019

Copy link
Copy Markdown
Member

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

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

Copy link
Copy Markdown
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
Copy Markdown

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 <nas-github@arctrix.com>
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 <nas-github@arctrix.com>
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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-featureA feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@nascheme@zooba@pablogsal@miss-islington@bedevere-bot@gpshead@the-knights-who-say-ni