[Cranelift] rule restore from #13081#13119
Open
myunbin wants to merge 1 commit intobytecodealliance:mainfrom
Open
[Cranelift] rule restore from #13081#13119myunbin wants to merge 1 commit intobytecodealliance:mainfrom
myunbin wants to merge 1 commit intobytecodealliance:mainfrom
Conversation
Member
|
Thanks! As mentioned in the revert, I think I'd like to see us understand fully what blew up before putting the rules back in -- in general we prefer affirmative understanding of bugs (to make sure we've fixed them) rather than no-longer-reproduces. (We can fall back on the latter eventually if needed, but in this case, since the blowup is deterministic at a certain commit, it should be possible to work out what rule interaction is happening). Once you've got that, I'm happy to put these back in! |
Subscribe to Label ActionDetailsThis issue or pull request has been labeled: "cranelift", "isle"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR restores the rules that were reverted in #13081.
Those rules were reverted because #13068 reported a significant compile-time slowdown. However, after commit
f2807a1(#13063), that severe slowdown no longer reproduces.On the current commit,
d5f1b973, the medianrealtime is0.17son plainmainand0.14son the restored version. For comparison, the historical slow configuration took about29.89smedianrealtime on the same input. Full benchmark results are included below.One likely factor is the vector-heavy section of
foo.clif, especially around lines 199-242. The original slowdown was observed before vector constant support landed in #13063, so vector self-subtraction patterns such asx - x -> 0, as well as related rewrite rules like(x - z) - (x - y) -> y - z, may have interacted poorly in the earlier configuration. This does not fully explain the entire e-graph blowup, and we're working on to figure it out.At least from the current measurements, restoring the rules on top of the current codebase does not bring back the compile-time regression. Based on that result, this PR proposes restoring the deleted rules.
Benchmark results
Environments
plain_current: commitd5f1b973restored_current:d5f1b973plus the rules / expected outputs removed by#13081historical_1578325: historical commit1578325, where the rules were originally presentrealTime Comparisond5f1b9730.18, 0.14, 0.17, 0.15, 0.17d5f1b973+restored-130810.14, 0.16, 0.14, 0.13, 0.13157832529.59, 29.89, 29.71, 30.65, 30.08userTime Comparisond5f1b9730.17, 0.14, 0.17, 0.13, 0.16d5f1b973+restored-130810.13, 0.15, 0.14, 0.13, 0.14157832528.87, 29.08, 29.00, 29.90, 29.33sysTime Comparisond5f1b9730.01, 0.00, 0.00, 0.02, 0.01d5f1b973+restored-130810.01, 0.01, 0.00, 0.00, 0.0015783250.72, 0.81, 0.71, 0.76, 0.76