-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Experiment: Only track fingerprints for queries with reconstructible dep-nodes. #118667
Experiment: Only track fingerprints for queries with reconstructible dep-nodes. #118667
Conversation
This comment has been minimized.
This comment has been minimized.
57ca354
to
f2fd56c
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…ingerprints, r=<try> Experiment: Only track fingerprints for queries with reconstructible dep-nodes. This is an experiment to collect performance data about alternative ways to adapt rust-lang#109050. The PR makes the following change: All queries with keys that are not reconstructible from their corresponding DepNode are now treated similar to anonymous queries. That is we don't compute a DepNode or result fingerprint for them. This has some implications: - We save time because query keys and results don't have to be hashed. - We can save space storing less data for these nodes in the on-disk dep-graph. (not implemented in this PR as I ran out of time. Maybe this would be a quick fix for `@saethlin` though?) - We don't have to worry about hash collisions for DepNode in these cases (although we still have to worry about hash collisions for result fingerprints, which might include all the same HashStable impls) - Same as with anonymous queries, the graph can grow additional nodes and edges in some situations because existing graph parts might be promoted while new parts are allocated for the same query if it is re-executed. I don't know how much this happens in practice. - We cannot cache query results for queries with complex keys. Given that that last point affects some heavy queries, I have my doubts that this strategy is a win. But let's run it through perf at least once. cc `@cjgillot,` `@Zoxc` r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Does that also mean the CompileCodegenUnit and CompileMonoItem dep nodes are no longer tracked? Or does this not apply to dep nodes that don't have an explicit query, but are using the |
Finished benchmarking commit (139a4ac): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.083s -> 673.668s (-0.21%) |
I think the perf results show that this is indeed the case. |
Well, I actually wanted to say that these are not affected directly 🙂 Anything that explicitly uses DepGraph::with_task works the same as before. I still think that's true (modulo any bugs I introduced). What I suspect is happening is that we cannot mark some crucial queries green after re-evaluation anymore. The hypothesis is that, before, a query like symbol_name was "maybe changed" (because one of its inputs was red) but then re-evaluating it yielded the same result as in the previous session, so it would be marked green after all. But now, that query instance cannot be correlated to the previous instance anymore, so the system assumes that it has changed. This could be solved by making more query keys reconstructible, but that's complicated and I'm not sure it would be worth the trouble. |
This is an experiment to collect performance data about alternative ways to adapt #109050. The PR makes the following change:
All queries with keys that are not reconstructible from their corresponding DepNode are now treated similar to anonymous queries. That is we don't compute a DepNode or result fingerprint for them.
This has some implications:
Given that that last point affects some heavy queries, I have my doubts that this strategy is a win. But let's run it through perf at least once.
cc @cjgillot, @Zoxc
r? @ghost