-
Notifications
You must be signed in to change notification settings - Fork 689
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
frame-omni-bencher
fix for --repeat
> 1
#5083
base: master
Are you sure you want to change the base?
Conversation
cc: @ggwpez I will investigate later, but do you have any hints or thoughts? |
Could be that somewhere a line like this is missing where it should reset the state:
One way to check this would be to print the storage root hashes in every benchmark and assert that they are the same. |
It reproduces locally, i will take a look. |
cc826f3
to
00403dc
Compare
@ggwpez looks like your fix works, e.g. this passed: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6758635 or https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6758774 |
@ggwpez testing with fellows:
|
…pec-builder` stuff to `get_preset` (#379) This PR introduces a new CI pipeline for checking and running runtime benchmarks as part of the test pipelines. This means we will now know if any changes break the benchmarks. The pipeline is based on downloading `frame-omni-bencher` (building it in-place is too expensive for every matrix run) and running it with a minimal setup: `--steps 2 --repeat 1`. Another part of this PR splits the default genesis setups from `chain-spec-generator` and moves them to the `sp_genesis_builder::GenesisBuilder::get_preset` runtime API implementation for every runtime, which is required by `frame-omni-bencher`. Closes: #197 Relates to: #298 Relates to: #324 <!-- 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 ## Future works When [this issue](paritytech/polkadot-sdk#5083) is fixed, I will rewrite [weight-generation.md](https://github.com/polkadot-fellows/runtimes/blob/main/docs/weight-generation.md). The new version will be significantly simplified, with instructions to simply download `frame-omni-bencher`, build the runtime WASM, and run it—no other steps will be necessary. ``` 2024-07-18 14:45:51 Using the chain spec instead of the runtime to generate the genesis state is deprecated. Please remove the `--chain`/`--dev`/`--local` argument, point `--runtime` to your runtime blob and set `--genesis-builder=runtime`. This warning may become a hard error any time after December 2024. ``` --------- Co-authored-by: Bastian Köcher <git@kchr.de>
- Part of paritytech/ci_cd#1006 - Closes: paritytech/ci_cd#1010 - Related: #4405 - Possibly affecting how frame-omni-bencher works on different runtimes: #5083 Currently works in parallel with gitlab short benchmarks. Triggered only by adding `GHA-migration` label to assure smooth transition (kind of feature-flag). Later when tested on random PRs we'll remove the gitlab and turn on by default these tests --------- Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
fea3954
to
e0dc270
Compare
The CI pipeline was cancelled due to failure one of the required jobs. |
- Part of paritytech/ci_cd#1006 - Closes: paritytech/ci_cd#1010 - Related: paritytech#4405 - Possibly affecting how frame-omni-bencher works on different runtimes: paritytech#5083 Currently works in parallel with gitlab short benchmarks. Triggered only by adding `GHA-migration` label to assure smooth transition (kind of feature-flag). Later when tested on random PRs we'll remove the gitlab and turn on by default these tests --------- Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Fix changes_to_storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Better error messages Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> genesis-preset flag Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Bench runner fix genesis storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> clippy
@ggwpez I ran into a different issue and I think everything leads to the benchmarking code path that uses Originally, I found the issue when doing But now, I have a different issue, when it looks like the storage is at some point flushed or something is removed.
Based on what I tried and see, I assume that there is some "bug" somewhere when using I don't have time to investigate it further now, but when I come back from vacation in two weeks, I will continue. |
- Part of https://github.com/paritytech/ci_cd/issues/1006 - Closes: https://github.com/paritytech/ci_cd/issues/1010 - Related: paritytech#4405 - Possibly affecting how frame-omni-bencher works on different runtimes: paritytech#5083 Currently works in parallel with gitlab short benchmarks. Triggered only by adding `GHA-migration` label to assure smooth transition (kind of feature-flag). Later when tested on random PRs we'll remove the gitlab and turn on by default these tests --------- Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Fix changes_to_storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Better error messages Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> genesis-preset flag Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Bench runner fix genesis storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Fix changes_to_storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Better error messages Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> genesis-preset flag Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Bench runner fix genesis storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Fix changes_to_storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Better error messages Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> genesis-preset flag Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Bench runner fix genesis storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Fix changes_to_storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Better error messages Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> genesis-preset flag Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Bench runner fix genesis storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Fix changes_to_storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Better error messages Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> genesis-preset flag Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Bench runner fix genesis storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Fix changes_to_storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Better error messages Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> genesis-preset flag Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Bench runner fix genesis storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Fix changes_to_storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Better error messages Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> genesis-preset flag Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Bench runner fix genesis storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Fix changes_to_storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Better error messages Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> genesis-preset flag Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Bench runner fix genesis storage Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> clippy
Summary
I encountered a problem with the fellows' repository when I tried to regenerate weights for runtime using
--steps 50 --repeat 20
andframe-omni-bencher
here. I faced a strange issue with several benchmarks, and after some debugging, I discovered that e.g.pallet_xcm::SafeXcmVersion
was removed during the second run. To address this, I had to apply a hotfix which sets the version every time, because theSafeXcmVersion
from genesis was ignored in subsequent runs, works only for the first run.Testing
I added several temporary CI pipelines with
--repeat=2
setup for frame-omni-bencher.Locally, see
quick-benchmarks-omni-repeat-2-leave-intent
andquick-benchmarks-omni-repeat-2-leave-intent
how to run and simulate.From local debugging, I see this strange behavior:
pallet_collator_selection::leave_intent
and--steps=2 --repeat=1
works OK:pallet_collator_selection::leave_intent
and--steps=2 --repeat=2
fails:Solution?
I suspect that genesis state is not re-initialized correctly after for second repeat - see suddenly
eligible_collators: 0
, but I will continue with debugging.I think it could be related to the:
and