-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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-119786: Add jit.md. Move adaptive.md to a section of interpreter.md. #127175
Conversation
iritkatriel
commented
Nov 22, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: create an internals documentation folder in the cpython repo #119786
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.
A lot of the terminology here is confusing, as we haven't put a lot of effort into choosing good names.
I'd suggest using "interpreter" for tier 1 including the specializations and "jit" for tier 2.
This leads to some odd terminology like "jit interpreter" for the tier 2 interpreter, but I think it is clearer overall.
I think a lot of core devs and the wider community think that what we currently call the "jit", i.e. the machine code generation pass, is where the performance gains will come from, but they will come from all of tier 2. The earlier passes will be vital for good performance.
Also, maybe add a diagram like this: faster-cpython/ideas#557 (comment)
InternalDocs/tier2.md
Outdated
@@ -0,0 +1,124 @@ | |||
# The Tier 2 Interpreter |
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 potentially confusing. The tier 2 interpreter is, in my mind, only used to debug tier 2 code. It is the jit-compiled machine code that executes tier 2 normally.
Also, I think we want to move away from "tier 2" and use "JIT". See faster-cpython/ideas#614 (comment)
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.
I'm making this change, but the code does refer to tier 2 in various places so I think it needs to be mentioned, otherwise future devs will be confused.
When you're done making the requested changes, leave the comment: |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @markshannon, @mdboom: please review the changes made to this pull request. |
|
||
### Maintaining stats | ||
|
||
Finally, take care that stats are gathered correctly. |
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.
If we currently have docs about pystats, we may want to link to that here. (If we don't, don't worry about that now...)
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.
I don't know of any.
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 excellent, thanks.
I have a few (minor) suggestions, otherwise it looks very good.
and a `_PyUOpExecutor_Type` is created to contain it. | ||
|
||
## Debugging a uop executor in the JIT interpreter | ||
|
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.
Can you add a sentence or two saying why we have this strange looking interpreter?
Being able to debug and analyze the optimizations prior independent of machine code generation is vey valuable.
Co-authored-by: Mark Shannon <[email protected]>
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.
One typo to fix, otherwise looks good.
Co-authored-by: Mark Shannon <[email protected]>