Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Tier 2 cleanups and tweaks#115534
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
Tier 2 cleanups and tweaks #115534
Uh oh!
There was an error while loading. Please reload this page.
Conversation
gvanrossum commented Feb 15, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
mdboom commented Feb 15, 2024
Regarding for (inti=0; i<512; i++){if (i<256){names=_PyOpcode_OpName} else{names=_PyOpcode_uop_name} if (stats->opcode[i].execution_count){fprintf(out, "uops[%s].execution_count : %"PRIu64"\n", names[i], stats->opcode[i].execution_count)} if (stats->opcode[i].miss){fprintf(out, "uops[%s].specialization.miss : %"PRIu64"\n", names[i], stats->opcode[i].miss)} } |
gvanrossum commented Feb 15, 2024
I saw that, and didn't immediately know how to rewrite that. Looking again I now know what to do (I had misunderstood what that code does) and I will fix this. |
Reason: The header is in fact needed with --enable-pystats. This reverts commit 182c023.
gvanrossum commented Feb 15, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Fixed. There's one change: when an uop is also a Tier-1 op, the previous version would print the Tier-1 name (without a leading underscore). The new version always prints the Tier-2 name. E.g. I believe the latter is more correct. |
mdboom commented Feb 16, 2024
Yeah, it probably is. This will make the stats before and after this change no longer comparable. That's probably fine -- if we find ourselves needing to do that the update to |
gvanrossum commented Feb 16, 2024
Oh, that's unfortunate. Didn't we just recently have a big stir about unexplained stats changes? Regarding a possible fix, were you thinking of just changing |
gvanrossum commented Feb 16, 2024
I foresee some merge conflicts with gh-114142. I'd rather see that merged first. |
mdboom commented Feb 16, 2024
Yes, exactly. Just something to normalize all the uops to have a |
Fidget-Spinner commented Feb 16, 2024
Small merge conflict with #115550. |
gvanrossum commented Feb 19, 2024
@markshannon Could you review this? I intend to merge after your side exits PR lands. |
markshannon left a 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.
One suggestion, otherwise LGTM
Uh oh!
There was an error while loading. Please reload this page.
* Rename `_testinternalcapi.get_{uop,counter}_optimizer` to `new_*_optimizer` * Use `_PyUOpName()` instead of` _PyOpcode_uop_name[]` * Add `target` to executor iterator items -- `list(ex)` now returns `(opcode, oparg, target, operand)` quadruples * Add executor methods `get_opcode()` and `get_oparg()` to get `vmdata.opcode`, `vmdata.oparg` * Define a helper for printing uops, and unify various places where they are printed * Add a hack to summarize_stats.py to fix legacy uop names (e.g. `POP_TOP` -> `_POP_TOP`) * Define helpers in `test_opt.py` for accessing the set or list of opnames of an executor* Rename `_testinternalcapi.get_{uop,counter}_optimizer` to `new_*_optimizer` * Use `_PyUOpName()` instead of` _PyOpcode_uop_name[]` * Add `target` to executor iterator items -- `list(ex)` now returns `(opcode, oparg, target, operand)` quadruples * Add executor methods `get_opcode()` and `get_oparg()` to get `vmdata.opcode`, `vmdata.oparg` * Define a helper for printing uops, and unify various places where they are printed * Add a hack to summarize_stats.py to fix legacy uop names (e.g. `POP_TOP` -> `_POP_TOP`) * Define helpers in `test_opt.py` for accessing the set or list of opnames of an executor* Rename `_testinternalcapi.get_{uop,counter}_optimizer` to `new_*_optimizer` * Use `_PyUOpName()` instead of` _PyOpcode_uop_name[]` * Add `target` to executor iterator items -- `list(ex)` now returns `(opcode, oparg, target, operand)` quadruples * Add executor methods `get_opcode()` and `get_oparg()` to get `vmdata.opcode`, `vmdata.oparg` * Define a helper for printing uops, and unify various places where they are printed * Add a hack to summarize_stats.py to fix legacy uop names (e.g. `POP_TOP` -> `_POP_TOP`) * Define helpers in `test_opt.py` for accessing the set or list of opnames of an executor
_testinternalcapi.get_{uop,counter}_optimizertonew_*_optimizer_PyUOpName()instead of_PyOpcode_uop_name[]targetto executor iterator items --list(ex)now returns(opcode, oparg, target, operand)quadruplesget_opcode()andget_oparg()to getvmdata.opcode,vmdata.opargPOP_TOP->_POP_TOP)