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

try making bench numbers make sense #5526

Merged
merged 12 commits into from
Sep 4, 2024
Merged

Conversation

ordian
Copy link
Member

@ordian ordian commented Aug 29, 2024

Follow-up to #5270. The baseline numbers for Westend were too high to be representative of the reality as it seemed to do with how multi-variate linear regression is calculated.

@ordian ordian added the T12-benchmarks This PR/Issue is related to benchmarking and weights. label Aug 29, 2024
@ordian
Copy link
Member Author

ordian commented Aug 29, 2024

bot bench polkadot-pallet --pallet=polkadot_runtime_parachains::inclusion --runtime=westend
bot bench polkadot-pallet --pallet=polkadot_runtime_parachains::inclusion --runtime=rococo
bot clean

@ordian ordian added the R0-silent Changes should not be mentioned in any release notes label Aug 29, 2024
@mordamax
Copy link
Contributor

/cmd bench --help

@mordamax
Copy link
Contributor

/cmd bench --runtime westend rococo --pallet=polkadot_runtime_parachains::inclusion

command-bot and others added 3 commits August 29, 2024 16:42
…=westend --target_dir=polkadot --pallet=polkadot_runtime_parachains::inclusion
…=rococo --target_dir=polkadot --pallet=polkadot_runtime_parachains::inclusion
@ordian
Copy link
Member Author

ordian commented Aug 30, 2024

bot bench polkadot-pallet --pallet=polkadot_runtime_parachains::inclusion --runtime=westend

command-bot and others added 3 commits August 30, 2024 16:34
@ordian
Copy link
Member Author

ordian commented Aug 31, 2024

bot bench polkadot-pallet --pallet=polkadot_runtime_parachains::inclusion --runtime=westend
bot clean

@command-bot command-bot bot deleted a comment from github-actions bot Aug 31, 2024
@command-bot command-bot bot deleted a comment from github-actions bot Aug 31, 2024
@command-bot command-bot bot deleted a comment from github-actions bot Aug 31, 2024
@mordamax
Copy link
Contributor

/cmd bench --runtime westend rococo --pallet=polkadot_runtime_parachains::inclusion

Copy link
Contributor

Command "bench --runtime westend rococo --pallet=polkadot_runtime_parachains::inclusion" has started 🚀 See logs here

…=westend --target_dir=polkadot --pallet=polkadot_runtime_parachains::inclusion
@command-bot
Copy link

command-bot bot commented Aug 31, 2024

@ordian Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=westend --target_dir=polkadot --pallet=polkadot_runtime_parachains::inclusion has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7206900 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7206900/artifacts/download.

@ordian ordian marked this pull request as ready for review August 31, 2024 14:06
@ordian ordian requested a review from sandreim August 31, 2024 14:06
Copy link
Contributor

Command "bench --runtime westend rococo --pallet=polkadot_runtime_parachains::inclusion" has failed ❌! See logs here

doc:
- audience: Runtime Dev
description: |
This PR works around an issue in multivariate linear regression of weight generation.
Copy link
Member

Choose a reason for hiding this comment

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

Is there an issue for this and shall we reference it from the benchmarks, so the values can be changed back once fixed?

Copy link
Member Author

@ordian ordian Sep 2, 2024

Choose a reason for hiding this comment

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

I'll need to dig a bit deeper to provide meaningful feedback for the issue, but I don't think there's a need to change those values back once fixed. The purpose of linear regression is to find the right correlation and if it can be achieved with just a points, there is no need to add more.

@ordian ordian enabled auto-merge September 3, 2024 13:26
@ordian ordian added this pull request to the merge queue Sep 4, 2024
Merged via the queue into master with commit de0b6f2 Sep 4, 2024
183 of 187 checks passed
@ordian ordian deleted the ao-enact-candidate-weight-followup branch September 4, 2024 14:20
@bkontur bkontur added the A4-needs-backport Pull request must be backported to all maintained releases. label Jan 14, 2025
@paritytech-cmd-bot-polkadot-sdk

Created backport PR for stable2407:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-5526-to-stable2407
git worktree add --checkout .worktree/backport-5526-to-stable2407 backport-5526-to-stable2407
cd .worktree/backport-5526-to-stable2407
git reset --hard HEAD^
git cherry-pick -x de0b6f25725325db0e97379f2d49a41dc8a13c44
git push --force-with-lease

github-actions bot pushed a commit that referenced this pull request Jan 14, 2025
Follow-up to #5270. The baseline numbers for Westend were too high to be
representative of the reality as it seemed to do with how multi-variate
linear regression is calculated.

---------

Co-authored-by: command-bot <>
(cherry picked from commit de0b6f2)
@paritytech-cmd-bot-polkadot-sdk

Successfully created backport PR for stable2409:

github-actions bot pushed a commit that referenced this pull request Jan 14, 2025
Follow-up to #5270. The baseline numbers for Westend were too high to be
representative of the reality as it seemed to do with how multi-variate
linear regression is calculated.

---------

Co-authored-by: command-bot <>
(cherry picked from commit de0b6f2)
@paritytech-cmd-bot-polkadot-sdk

Successfully created backport PR for stable2412:

EgorPopelyaev pushed a commit that referenced this pull request Jan 14, 2025
Backport #5526 into `stable2409` from ordian.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Co-authored-by: ordian <write@reusable.software>
EgorPopelyaev pushed a commit that referenced this pull request Jan 14, 2025
Backport #5526 into `stable2412` from ordian.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Co-authored-by: ordian <write@reusable.software>
fellowship-merge-bot bot added a commit to polkadot-fellows/runtimes that referenced this pull request Jan 30, 2025
## Description

Addressing @ordian's
[comment](#522 (review)):
> Previously, the weight of `enact_candidate` was included in the weight
of availability bitfields, but this was a bug, because the number of
bitfields depends on number of validators, whereas number of enacted
candidates depends on the number of cores. This was later (accidentally)
fixed, but the `enact_candidate` weight was unaccounted for.
[paritytech/polkadot-sdk#5270](paritytech/polkadot-sdk#5270)
was supposed to fix that.
> 
> The base weight of `enact_candidate` still looks excessive and it was
fixed in
[paritytech/polkadot-sdk#5526](paritytech/polkadot-sdk#5526),
but looks like it didn't make into the same release.
> 
> That being said, even with 1.5ms of enactment weight per candidate,
this shouldn't be a blocker to scale to 200 parachains weight-wise. So
I'm fine with having these excessive weights for now.

Addressing @bkontur's
[comment](#522 (comment)):
> @ordian The next patch, **stable2409-4**, is planned for this week. I
have backported your fix here:
[paritytech/polkadot-sdk#7145](paritytech/polkadot-sdk#7145).
Once it is released, I will re-run the benchmarks for this within
another PR.


## Weights diff

### Kusama

`--method asymptotic` does not work:
```
subweight compare commits          --path-pattern "./relay/kusama/**/weights/**/*.rs"          --format markdown --no-color           --change added changed          --method asymptotic --ignore-errors --strip-path-prefix="relay/kusama/src/weights/"          remotes/polkadot-fellows/main          origin/bko-patch-parachains-inclusion
```
| File | Extrinsic | Old | New | Change [%] |

|---------------------------------|-----------------|-----|-----|------------|
| runtime_parachains_inclusion.rs | enact_candidate | - | - | ERROR |

but `--method base` works:
```
subweight compare commits          --path-pattern "./relay/kusama/**/weights/**/*.rs"          --format markdown --no-color           --change added changed          --method base --ignore-errors --strip-path-prefix="relay/kusama/src/weights/"          remotes/polkadot-fellows/main          origin/bko-patch-parachains-inclusion
```
| File | Extrinsic | Old | New | Change [%] |

|---------------------------------|-----------------|--------|----------|------------|
| runtime_parachains_inclusion.rs | enact_candidate | 2.97ms | 939.10us
| -68.35 |

### Polkadot

`--method asymptotic` does not work:
```
subweight compare commits          --path-pattern "./relay/polkadot/**/weights/**/*.rs"          --format markdown --no-color           --change added changed          --method asymptotic --ignore-errors --strip-path-prefix="relay/polkadot/src/weights/"          remotes/polkadot-fellows/main          origin/bko-patch-parachains-inclusion
```
| File | Extrinsic | Old | New | Change [%] |

|---------------------------------|-----------------|-----|-----|------------|
| runtime_parachains_inclusion.rs | enact_candidate | - | - | ERROR |

but `--method base` works:
```
subweight compare commits          --path-pattern "./relay/polkadot/**/weights/**/*.rs"          --format markdown --no-color           --change added changed          --method base --ignore-errors --strip-path-prefix="relay/polkadot/src/weights/"          remotes/polkadot-fellows/main          origin/bko-patch-parachains-inclusion
```
| File | Extrinsic | Old | New | Change [%] |

|---------------------------------|-----------------|--------|----------|------------|
| runtime_parachains_inclusion.rs | enact_candidate | 2.92ms | 974.24us
| -66.60 |


<!-- Remember that you can run `/merge` to enable auto-merge in the PR
-->

<!-- Remember to modify the changelog. If you don't need to modify it,
you can check the following box.
Instead, if you have already modified it, simply delete the following
line. -->

- [X] Does not require a CHANGELOG entry

---------

Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A4-needs-backport Pull request must be backported to all maintained releases. R0-silent Changes should not be mentioned in any release notes T12-benchmarks This PR/Issue is related to benchmarking and weights.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants