Skip to content
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

Add tool to identify candidates for super-instructions #192

Merged
merged 12 commits into from
Dec 23, 2017

Conversation

smarr
Copy link
Owner

@smarr smarr commented Oct 16, 2017

This PR adds a new Truffle tool to instrument all nodes, track their execution, and determine node configurations that are frequently used together.
These node configurations might benefit from being converted into a single node that reduces the interpretation overhead.

This is work by @fredreichbier.

@fredreichbier, could you please review the PR, and check whether everything looks ok for you?

This is a first version, I might still do some more cosmetic changes.

@smarr smarr added the enhancement Improves the implementation with something noteworthy label Oct 16, 2017
@smarr smarr added this to the v0.6.0 - Black Diamonds milestone Oct 16, 2017
Repository owner deleted a comment Oct 17, 2017
Repository owner deleted a comment Oct 17, 2017
Repository owner deleted a comment Oct 17, 2017
Repository owner deleted a comment Oct 17, 2017
Repository owner deleted a comment Oct 17, 2017
Repository owner deleted a comment Oct 17, 2017
Repository owner deleted a comment Oct 17, 2017
// fetch the top CONSIDER_TOP_CONTEXTS activation contexts
// and construct a candidate for each of them.
List<ActivationContext> sorted =
contexts.keySet().stream().filter(context -> context.getNumberOfClasses() == 3)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fredreichbier here I was wondering why that's a three. The comment above talks about 2, I believe.

Repository owner deleted a comment Oct 18, 2017
Repository owner deleted a comment Oct 18, 2017
Repository owner deleted a comment Oct 18, 2017
Repository owner deleted a comment Oct 18, 2017
Repository owner deleted a comment Oct 19, 2017
Repository owner deleted a comment Oct 19, 2017
Repository owner deleted a comment Oct 19, 2017
Repository owner deleted a comment Oct 19, 2017
fredreichbier and others added 2 commits December 22, 2017 12:22
- add TypeCountingNode/TypeCounter that records types

- write activation patterns to a file

- exclude eager nodes, and SequenceNode
- try to find children type combinations.

- write superinstruction report to metrics/

- update dym tests to account for AnyTag
Having it in DynamicMetrics is problematic, because DM disables a number of optimized nodes to get metrics relative to the source text.
For super-instructions, we want knowledge about the actual execution behavior, and possibly even already enabled super-instructions. Thus, it’s better to have to separate tools.

Signed-off-by: Stefan Marr <[email protected]>
Repository owner deleted a comment Dec 22, 2017
Repository owner deleted a comment Dec 22, 2017
Repository owner deleted a comment Dec 22, 2017
Repository owner deleted a comment Dec 22, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 79.924% when pulling 5586bf9 on super-instruction-detector into 01f5172 on dev.

This can happen, when there are fewer context levels than requested.

Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
- make some fields final

Signed-off-by: Stefan Marr <[email protected]>
@smarr
Copy link
Owner Author

smarr commented Dec 23, 2017

This PR was blocked by failing tests on Linux.
Turns out that the final step to create the report was contain some non-deterministic bits.
The number of results was limited to 100 before sorting them in a fully deterministic way. Sorting relied only on the score, which means order for same score is not defined.

Cutting off at that point could result in slightly different reports being generated.
Now, we make sure all candidates are unique, sort them by score as well as their other attributes, and then limit the result set to 100 elements as the last step. This leads the tests being sufficiently robust.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 79.924% when pulling 14aa09a on super-instruction-detector into 01f5172 on dev.

@smarr smarr merged commit d25999e into dev Dec 23, 2017
@smarr smarr deleted the super-instruction-detector branch December 23, 2017 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves the implementation with something noteworthy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants