-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
GH-109369: Add machinery for deoptimizing tier2 executors, both individually and globally. #110384
Conversation
Skipping news, as this an implementation detail |
Okay, let me summarize what's here so we know I understand. Then I will start a code review.
All in all I think this is a fine plan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool, a rare excursion to classic data structures! I'm not sure, but I worry about a bug in the linked list code when unlinking the head node promotes another node to being the head; see comment in unlink_executor()
.
It looks like this PR introduced refleaks and assertion failures when running
I'm looking into it more now, but is there anything obvious to either of you that may be causing this? |
Possibly the refleaks might be cured by increasing the warmup count (changing the No idea about the assertion failure. |
void | ||
_Py_Executor_DependsOn(_PyExecutorObject *executor, void *obj) | ||
{ | ||
assert(executor->vm_data.valid = true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the issue, but something I noticed while combing over this:
assert(executor->vm_data.valid = true); | |
assert(executor->vm_data.valid == true); |
See #111339 for the test_embed crashes etc. |
… individually and globally. (pythonGH-110384)
… individually and globally. (pythonGH-110384)
This PR just provides the machinery; we still need to add support for exiting executors when their
valid
flag is falsified.The implementation uses a bloom filter.
The advantage of a bloom filter is that it requires no coupling between the executors and the objects they depend on, plus it is simpler to implement and uses less memory than a precise mapping.
I've chosen k = 6 and m = 256.
This should give a low enough false positive rate for most cases. We want to keep the false positive rate very low, as spurious de-optimizations could be expensive.