-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
regrtest.py improvement for Profile Guided Optimization builds #69375
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
Comments
This issue adds improved support for Profile Guided Optimization builds in the regression test suite. Mainly, we keep the visual progress status in this process and suppress errors or any other unnecessary output that can alarm users. |
I've added the patches for Python default and 2.7. To apply them please use the command "hg import --no-commit". PGO flag is implemented for both variants (single and multi process). Default in profile-opt will be single process. |
I left some comments on the Python 3.6 version of the patch. I don't know if we should apply such a change to Python 2.7 or 3.5, though, as it is a new feature of regrtest and thus runs the risk of breaking stuff. Then again, we have said that anything in the test package has not backwards-compatibility guarantees. |
The patch does not display dots, as they are not that intuitive and users cannot make an estimate of the time left or the position in the training phase. Instead, the regrtest.py, will display the progress as [X/Y], like the default version, but without any warnings, failed tests, skipped tests. Also the start and end report are suppressed. I don't understand what do you mean by "keyword-only parameter". I added a new flag (-P/--pgo) and propagated it along all the functions that need it. Another approach would have been to use a global variable, lets say "pgo" and use it directly. This is closer to what you had in mind? |
Ah, OK. As I said I had not run it so I wasn't sure of the actual outcome. =) As for keyword-only arguments/parameters, see https://www.python.org/dev/peps/pep-3102/ . They are a Python 3 feature. |
Thank you for the link. I modified regrtest.py for Python3 according to the specifications. |
Here is a tweaked 3.6 patch so that --pgo doesn't even emit the failure count so you really can't tell what is going on unless some error info from the test spews out on to the shell (which I can't seem to stop since 2>/dev/null causes a test failure). |
I should mention I would have committed my patch but test_einter is hanging for me, so if someone else wants to test the patch and verify it works then I can commit it. |
Thank you for the tweaks. I tested the patch and it is all working fine. Without failure count the PGO run is even more transparent to the user. I tested your final version of the patch on several Linux server and regular desktop distributions and software configurations and I saw that test_eintr does not block and the entire PGO build finishes in good conditions every time. |
I fixed my test_eintr problem, but now https://hg.python.org/cpython/rev/4a9418ed0d0c landed in 3.6/default and broke the patch. Since missing getting this in before the aforementioned change was my fault, I'll personally handle making the patch apply cleanly in default. |
Here is a patch for Python 3.6. I'll commit this after I eat before Victor changes something else. =) |
New changeset fb90425017e3 by Brett Cannon in branch '3.5': New changeset c1ecb258003b by Brett Cannon in branch 'default': |
New changeset 136ad559fa4f by Brett Cannon in branch '2.7': |
Thanks for the initial patch, Alecsandru! May I not have to touch regrtest until after Victor is done doing whatever he is doing to it in 3.6. =) |
Thank you Brett for your effort to merge all the changes made to regrtest despite the changes appeared on the way! |
This looks ugly. --- Lib/test/regrtest.py
+++ Lib/test/regrtest.py
@@ -508,7 +508,8 @@
for test in tests:
args_tuple = (
(test, verbose, quiet),
- dict(huntrleaks=huntrleaks, use_resources=use_resources)
+ dict(huntrleaks=huntrleaks, use_resources=use_resources,
+ pgo=pgo)
)
yield (test, args_tuple)
pending = tests_and_args()
@@ -526,9 +527,6 @@
except StopIteration:
output.put((None, None, None, None))
return
- # required to permit running tests with PGO flag on/off
- if pgo:
- args_tuple[1]['pgo']=pgo
# -E is needed by some tests, e.g. test_import
popen = Popen(base_cmd + ['--slaveargs', json.dumps(args_tuple)],
stdout=PIPE, stderr=PIPE, |
New changeset cc42700abb8e by Brett Cannon in branch '2.7': |
Thanks for the patch, Arfrever. Although next time you don't need to unset every field of the issue since the issue was still fixed, just in a suboptimal fashion that didn't impact performance. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: