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 post-mono MIR passes to make mono-reachable analysis more accurate #131650

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

saethlin
Copy link
Member

@saethlin saethlin commented Oct 13, 2024

Debug full/incr-full builds regress, as far as I can tell this is just the expense of cloning, then monomorphizing, then caching the MIR.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 13, 2024
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label Oct 13, 2024
@rust-log-analyzer

This comment has been minimized.

@saethlin
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 13, 2024
@bors
Copy link
Contributor

bors commented Oct 13, 2024

⌛ Trying commit a211812 with merge b141564...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2024
Add post-mono MIR passes to make mono-reachable analysis more accurate

r? ghost
@bors
Copy link
Contributor

bors commented Oct 13, 2024

☀️ Try build successful - checks-actions
Build commit: b141564 (b1415647cdfcdd1b8dc5ed5f9a5aba87ade0b225)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b141564): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking 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 @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
12.2% [0.2%, 93.7%] 163
Regressions ❌
(secondary)
6.9% [0.2%, 266.3%] 119
Improvements ✅
(primary)
-0.7% [-3.0%, -0.2%] 6
Improvements ✅
(secondary)
-11.1% [-33.8%, -0.2%] 12
All ❌✅ (primary) 11.7% [-3.0%, 93.7%] 169

Max RSS (memory usage)

Results (primary 14.5%, secondary 1.7%)

This 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.

mean range count
Regressions ❌
(primary)
14.5% [0.7%, 56.9%] 108
Regressions ❌
(secondary)
4.5% [0.6%, 12.8%] 34
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-22.2% [-24.2%, -19.2%] 4
All ❌✅ (primary) 14.5% [0.7%, 56.9%] 108

Cycles

Results (primary 22.8%, secondary 13.8%)

This 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.

mean range count
Regressions ❌
(primary)
23.0% [0.8%, 108.5%] 111
Regressions ❌
(secondary)
19.4% [1.0%, 223.4%] 42
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-33.2% [-42.8%, -1.3%] 5
All ❌✅ (primary) 22.8% [-3.0%, 108.5%] 112

Binary size

Results (primary -0.3%, secondary -2.3%)

This 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.

mean range count
Regressions ❌
(primary)
0.8% [0.0%, 2.3%] 7
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-0.4% [-1.7%, -0.0%] 76
Improvements ✅
(secondary)
-2.4% [-25.8%, -0.0%] 65
All ❌✅ (primary) -0.3% [-1.7%, 2.3%] 83

Bootstrap: 781.427s -> 807.023s (3.28%)
Artifact size: 331.96 MiB -> 332.21 MiB (0.08%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 13, 2024
@saethlin
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 14, 2024
@bors
Copy link
Contributor

bors commented Oct 14, 2024

⌛ Trying commit 6f6737a with merge 9233d9f...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2024
Add post-mono MIR passes to make mono-reachable analysis more accurate

r? ghost
@bors
Copy link
Contributor

bors commented Oct 14, 2024

☀️ Try build successful - checks-actions
Build commit: 9233d9f (9233d9f83ca672be3b2cfa697806fdb7c8970490)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9233d9f): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking 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 @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
7.6% [0.1%, 59.9%] 151
Regressions ❌
(secondary)
2.9% [0.2%, 18.7%] 107
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-6.6% [-64.0%, -0.3%] 11
All ❌✅ (primary) 7.5% [-3.0%, 59.9%] 152

Max RSS (memory usage)

Results (primary 11.3%, secondary 2.4%)

This 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.

mean range count
Regressions ❌
(primary)
12.9% [1.3%, 52.1%] 93
Regressions ❌
(secondary)
3.6% [2.2%, 5.9%] 10
Improvements ✅
(primary)
-2.7% [-4.3%, -0.8%] 10
Improvements ✅
(secondary)
-3.4% [-3.5%, -3.4%] 2
All ❌✅ (primary) 11.3% [-4.3%, 52.1%] 103

Cycles

Results (primary 10.6%, secondary 3.2%)

This 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.

mean range count
Regressions ❌
(primary)
10.7% [1.0%, 50.1%] 94
Regressions ❌
(secondary)
5.4% [1.7%, 18.4%] 37
Improvements ✅
(primary)
-3.1% [-3.1%, -3.1%] 1
Improvements ✅
(secondary)
-17.2% [-62.3%, -1.6%] 4
All ❌✅ (primary) 10.6% [-3.1%, 50.1%] 95

Binary size

Results (primary -0.1%, secondary -0.3%)

This 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.

mean range count
Regressions ❌
(primary)
0.7% [0.0%, 2.4%] 9
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.8%, -0.0%] 69
Improvements ✅
(secondary)
-0.3% [-0.8%, -0.0%] 51
All ❌✅ (primary) -0.1% [-0.8%, 2.4%] 78

Bootstrap: 782.104s -> 806.252s (3.09%)
Artifact size: 332.57 MiB -> 332.81 MiB (0.07%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 14, 2024
@saethlin
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 24, 2024
Add post-mono MIR passes to make mono-reachable analysis more accurate

As of rust-lang#131650 (comment) I believe most of the incr overhead comes from re-computing, re-encoding, and loading a lot more MIR when all we're actually doing is traversing through it. I think that can be addressed by caching a query that looks up the mentioned/used items for an Instance.

I think the full-build regressions are pretty much just the expense of cloning, then monomorphizing, then caching the MIR.
@bors
Copy link
Contributor

bors commented Oct 24, 2024

⌛ Trying commit 4ae3542 with merge 174810c...

@saethlin
Copy link
Member Author

saethlin commented Nov 2, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 2, 2024
@bors
Copy link
Contributor

bors commented Nov 2, 2024

⌛ Trying commit 2035d35 with merge e0f825ec86746cdd39c760e342bbe1cade87b9dc...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 2, 2024
Add post-mono MIR passes to make mono-reachable analysis more accurate

Debug full/incr-full builds regress, as far as I can tell this is just the expense of cloning, then monomorphizing, then caching the MIR.
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 2, 2024

☀️ Try build successful - checks-actions
Build commit: e0f825e (e0f825ec86746cdd39c760e342bbe1cade87b9dc)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e0f825e): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking 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 @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
1.3% [0.2%, 6.3%] 78
Regressions ❌
(secondary)
1.9% [0.2%, 18.5%] 54
Improvements ✅
(primary)
-6.8% [-23.8%, -0.2%] 60
Improvements ✅
(secondary)
-18.8% [-67.1%, -1.2%] 18
All ❌✅ (primary) -2.2% [-23.8%, 6.3%] 138

Max RSS (memory usage)

Results (primary -0.0%, secondary -6.6%)

This 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.

mean range count
Regressions ❌
(primary)
12.2% [2.1%, 31.3%] 43
Regressions ❌
(secondary)
4.3% [2.7%, 5.5%] 5
Improvements ✅
(primary)
-8.1% [-22.2%, -1.6%] 65
Improvements ✅
(secondary)
-8.2% [-24.8%, -2.2%] 35
All ❌✅ (primary) -0.0% [-22.2%, 31.3%] 108

Cycles

Results (primary -5.9%, secondary -12.4%)

This 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.

mean range count
Regressions ❌
(primary)
2.8% [0.8%, 6.2%] 32
Regressions ❌
(secondary)
3.9% [1.7%, 17.3%] 14
Improvements ✅
(primary)
-10.6% [-31.4%, -0.9%] 59
Improvements ✅
(secondary)
-27.6% [-64.4%, -1.0%] 15
All ❌✅ (primary) -5.9% [-31.4%, 6.2%] 91

Binary size

Results (primary -0.3%, secondary -2.2%)

This 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.

mean range count
Regressions ❌
(primary)
0.5% [0.1%, 1.9%] 11
Regressions ❌
(secondary)
0.8% [0.1%, 1.5%] 2
Improvements ✅
(primary)
-0.4% [-1.0%, -0.1%] 69
Improvements ✅
(secondary)
-2.3% [-25.8%, -0.0%] 62
All ❌✅ (primary) -0.3% [-1.0%, 1.9%] 80

Bootstrap: 779.182s -> 791.751s (1.61%)
Artifact size: 335.34 MiB -> 335.34 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 2, 2024
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 3, 2024

☔ The latest upstream changes (presumably #132526) made this pull request unmergeable. Please resolve the merge conflicts.

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 3, 2024
Querify mir collection

Factored out of rust-lang#131650, these changes are required for post-mono MIR opts but I want to benchmark them on their own so that I can tune the implementation.

r? ghost
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 3, 2024
…try>

Querify mir collection

Factored out of rust-lang#131650, these changes are required for post-mono MIR opts but I want to benchmark them on their own so that I can tune the implementation.

r? ghost
@bors
Copy link
Contributor

bors commented Nov 4, 2024

☔ The latest upstream changes (presumably #132581) made this pull request unmergeable. Please resolve the merge conflicts.

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 4, 2024
…try>

Querify mir collection

Factored out of rust-lang#131650, these changes are required for post-mono MIR opts but I want to benchmark them on their own so that I can tune the implementation.

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants