chore: don't use set_value_from_id in remove_if_else#8041
chore: don't use set_value_from_id in remove_if_else#8041asterite wants to merge 13 commits intoab/replace_values_in_as_slice_lengthfrom
set_value_from_id in remove_if_else#8041Conversation
a97794f to
e4dfe7d
Compare
Changes to circuit sizes
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'ACVM Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 9a1861e | Previous: a6e9d03 | Ratio |
|---|---|---|---|
purely_sequential_opcodes |
3277247 ns/iter (± 23165) |
265575 ns/iter (± 1628) |
12.34 |
perfectly_parallel_opcodes |
3249882 ns/iter (± 49406) |
232779 ns/iter (± 4725) |
13.96 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
|
Performance regression is a false-alarm and will go away with a merge. |
|
For this program: fn main(x: u32) {
let mut array1 = [0 as u32; 2];
let mut array2 = [0 as u32; 2];
array1[0] = array2[0];
if x == 0 {
array2[0] = 1;
}
array1[0] = array2[1];
if x == 0 {
array2[1] = 1;
}
}The SSA right before "Remove IfElse" is this: Then in master we get: and in this PR we get: It seems the difference is that in master there's this: while in this PR there's this: Because the |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 9a1861e | Previous: a6e9d03 | Ratio |
|---|---|---|---|
private-kernel-inner |
0.076 s |
0.029 s |
2.62 |
private-kernel-reset |
0.296 s |
0.163 s |
1.82 |
private-kernel-tail |
0.028 s |
0.017 s |
1.65 |
rollup-base-private |
0.822 s |
0.337 s |
2.44 |
rollup-base-public |
0.563 s |
0.212 s |
2.66 |
rollup-merge |
0.007 s |
0.004 s |
1.75 |
rollup-root |
0.026 s |
0.013 s |
2 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
…alues_in_remove_if_else
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Compilation Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 9a1861e | Previous: a6e9d03 | Ratio |
|---|---|---|---|
rollup-base-private |
22.32 s |
17.88 s |
1.25 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
|
This looks like the |
|
@jfecher Thanks, you are right! I just checked and in master the So, if I'm understanding things correctly, this PR/change is good despite the regressions? |
It sounded like from Tom that these may go away after a merge? Or was that just for the 13x performance alert? Let's merge master and re-evaluate. Edit: Ok, just the 13x then. Looks like it didn't go away after the merge in 9a1861e though |
|
Yeah, just the 13x performance regression. |
| actual_length, | ||
| ) { | ||
| return result; | ||
| if false { |
There was a problem hiding this comment.
Since the CI for this PR is a bit messed up, can you make sure to manually test this against a few aztec crates as well?
There was a problem hiding this comment.
Sure! When you say "manually test" is that in a different way than the external checks here? I guess it's to compare the sizes and so on. Is there a script I can run to perform the same checks/reports?
There was a problem hiding this comment.
I usually just run nargo on these crates manually. It shouldn't be different than the external checks - just noting down e.g. any brillig size or acir constraint count differences versus master. I do it sometimes when I don't trust the CI.
There was a problem hiding this comment.
I just checked and there's a regression for rollup_base_private ACIR opcodes:
- in master it's 272017
- this PR with the
try_merge_only_changed_indicesoptimization: 272125 - this PR without that optimization: 275025
So it seems that optimization is good but maybe for the programs in test_programs it makes things worse.
That said, I'm still not sure why it still regresses a bit in this PR.
Some other crates I checked stay the same.
…alues_in_remove_if_else
…alues_in_remove_if_else
…alues_in_remove_if_else
This reverts commit 76f54ab.
|
I'll close this PR and create a new one once the base PR is merged. |
Based on top of #8039
Description
Problem
Slowly trying to migrate away from
set_value_from_idSummary
Additional Context
The docs for
remove_if_elseseem to be wrong (copied from another place) but I'm not the best one to document it.Documentation
Check one:
PR Checklist
cargo fmton default settings.