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

Update pallet weights every week #6196

Closed
ggwpez opened this issue Oct 23, 2024 · 7 comments · Fixed by #6789
Closed

Update pallet weights every week #6196

ggwpez opened this issue Oct 23, 2024 · 7 comments · Fixed by #6789
Assignees

Comments

@ggwpez
Copy link
Member

ggwpez commented Oct 23, 2024

With changes to FRAME, the Rust compiler version, pallets and the benchmarker itself, we should try to update the pallet weights on a weekly basis to see regressions early and not just before a release.

Task: Update the weights of all pallets from all runtimes every week. It should re-use the already open MR and force-push there, to avoid spamming up new MRs if reviews are slow.

@mordamax mordamax self-assigned this Oct 23, 2024
@bkchr
Copy link
Member

bkchr commented Oct 23, 2024

Task: Update the weights of all pallets from all runtimes every week. It should re-use the already open MR and force-push there, to avoid spamming up new MRs if reviews are slow.

No no. These prs should be merged automatically if the weight changes are not a regression. Generally I would also expect if these kind of prs exist they should also get merged. No need to bring this stuff up and then it lays around.

@mordamax
Copy link
Contributor

First iteration anyway is not going to go automatically, but through a review, at least to establish the baseline, as many of the weights either do not exist or very outdated

https://github.com/paritytech/polkadot-sdk/pull/6789/files
This workflow allows us to start (or restart) this as we want through workflow dispatch, and will create a PR with all runtimes recalculated diff + subweights report so it's easier to scan visually the outsiders.

The next step would be finding out how could we further automate it so it will require minimum of the developer intervention, ideally.

for now - My pov is that it should always go through at least 1 person, may be CI/RelEng or any core-dev. As i'd be very hesitant to trust any kind of tooling a weights pushed directly to master without human checking. Imagine CI/tooling bug which ends up with too low or crazy high numbers weights in master 🤯

May be adding some enhancements like bot pre-checking if it's all good or something is bad, or highlights the pallet outsiders, which would help developer to spot the degradation, and/or enable auto-merge in PR, but still a human to approve

@bkchr
Copy link
Member

bkchr commented Jan 17, 2025

Imagine CI/tooling bug which ends up with too low or crazy high numbers weights in master 🤯

No one should use the weights in production...

@mordamax
Copy link
Contributor

I guess I was wrong with adding subweights, as output for the whole monorepo is very large
Here's a PR it created #7280 but the CI is broken, as far as i see it's because of outdated hbs template?
@kianenigma @bkchr @ggwpez will you please check?

@ggwpez
Copy link
Member Author

ggwpez commented Jan 23, 2025

@iulianbarbu maybe? Just saw you do some testing with the omni bencher, so maybe you are interested.

@iulianbarbu
Copy link
Contributor

Seems like #6789 attempts at fixing the hbs issue too. TBH not very familiar of what fix needs to be done, so leaving it with @mordamax .

github-merge-queue bot pushed a commit that referenced this issue Jan 24, 2025
Closes #6196 
Closes #7204

Example of PR: #6816

Every sunday 01:00 AM it's going to start to benchmark (with /cmd bench)
all runtimes and all pallets
Then diff total will be pushed to a branch and PR open,. I assume
review-bot is going assign required reviewers per changed files

I afraid each weeks will be too much to review & merge, but we can
adjust later

Bonus: fix for pallet_multisig lib and
substrate/.maintain/frame-weight-template.hbs , which didn't let to
compile new weights

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: command-bot <>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
@mordamax
Copy link
Contributor

mordamax commented Jan 24, 2025

@iulianbarbu the hbs issue is related to #7204, however this also blocks the weekly benchmarks as they are not compiling either if we recalcualte all of them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants