Skip to content

Conversation

@JeffersGlass
Copy link
Contributor

@JeffersGlass JeffersGlass commented Jun 24, 2024

Currently, uop pairs are only counted in a PyStats build when it is build with just the Tier 2 interpreter without the JIT. This PR adds uop pair counting when running with the JIT, by adding an additional last_uop field to the _PyExecutorObject struct.

It also adds a new --pystats flag to Tools/jit/build.py. This enables/disables the lines which cause the executor to track its last uop, since there's no point in doing so if we're not tracking pystats. This flag is included in the hash that is used to determine whether the jit stencils need to be rebuilt, so that pystats stencils are not accidently used in a non-pystats build and vice-versa.

The performance of this could potentially be improved by using a local variable inside _PyJIT_Compile to track the last uop, and emit that into the stencils directly?

@JeffersGlass
Copy link
Contributor Author

This does seem to have the issue where the counts "wrap around" from the end of a trace back to the start of a trace, i.e. we see stats like uop[_EXIT_TRACE].pair_count[_START_EXECUTOR] : 983, which I assume aren't useful?

@JeffersGlass
Copy link
Contributor Author

Give that we're no longer pursueing superinstructions as a high-priority optimization, output UOp paircounts is no longer going to be particularly helpful. I'll close this, though it could be revived if it turns out to be useful later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant