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

Benchmark fixes #1971

Merged
merged 9 commits into from
May 22, 2024
Merged

Benchmark fixes #1971

merged 9 commits into from
May 22, 2024

Conversation

wilwade
Copy link
Collaborator

@wilwade wilwade commented May 15, 2024

Goal

The goal of this PR is to fix an issue with running benchmarks and update our benchmarks with some tests.

Part of #1853

Issues

  • When I added the Proxy pallet, the copied weight file worked, but the generated version didn't.
  • Then when fixing that, the benchmark runners had issues. So updated the benchmark workflow by removing it from the commit commenting system to a manual run. Using that will also automatically trigger verify CI actions. (GitHub actions only run on Manually triggered actions to prevent loops)

Discussion

  • The additional changes to the templates is from Polkadot-SDK
  • Actual change is small, as most of this are the generated weights code
  • Fix issue with the proxy_pallet weights reference
  • Update the benchmark running system to not use special Github tokens

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

@wilwade wilwade force-pushed the chore/fix-benchmarks branch 19 times, most recently from 3cafc3c to 0ec27a3 Compare May 20, 2024 19:16
github-actions bot pushed a commit that referenced this pull request May 20, 2024
github-actions bot pushed a commit that referenced this pull request May 20, 2024
@wilwade wilwade mentioned this pull request May 21, 2024
wilwade added a commit that referenced this pull request May 21, 2024
# Goal
The goal of this PR is to create a new flow for benchmarks so that they
are easier to run and do not require a separate github token.

To test this must be in main as `workflow_dispatch` doesn't work without
being in `main`, but here is a run that was triggered using defaults
with a few other tweaks:
https://github.com/frequency-chain/frequency/actions/runs/9174859575

# Discussion
- The PR #1971 will remove the old system from the
`.github/workflows/verify-pr-commit.yml` file so that only this one is
used
- Once PR #1971 is merged, I will also update the wiki with the new
instructions
@@ -750,114 +754,3 @@ jobs:
echo "Actual genesis state: $actual_genesis_state"
[ $actual_genesis_state = $expected_genesis_state ] || \
(echo "ERROR: The actual genesis state does not match the expected" && exit 1)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also removed this from the required list for PRs.

{{#each benchmarks as |benchmark|}}
{{#if (ne benchmark.base_calculated_proof_size "0")}}
#[test]
fn test_{{benchmark.name~}} () {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Make sure the benchmarks actually work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Minor updates from the polkadot-sdk patterns

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding common-runtime under dev-dependencies to these so the weights tests work

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am going ahead and merging the run with the tests.

@@ -224,3 +224,8 @@ then
echo " "
${BENCHMARK} overhead --wasm-execution=compiled --weight-path=runtime/common/src/weights --chain=dev --warmup=10 --repeat=100 --header="./HEADER-APACHE2" || exit_err
fi

echo "Running tests..."
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Run the tests after the benchmarks to make sure the benchmark generated code works.

@wilwade wilwade marked this pull request as ready for review May 21, 2024 17:47
@wilwade wilwade requested a review from demisx as a code owner May 21, 2024 17:47
@wilwade wilwade requested review from a team, shannonwells, mattheworris, enddynayn, aramikm, claireolmstead and JoeCap08055 and removed request for a team May 21, 2024 17:47
@@ -1,6 +1,6 @@
// This file is part of Substrate.
// This file is part of Frequency.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice, always bugged me that it said Substrate. 🤓

@enddynayn
Copy link
Collaborator

enddynayn commented May 22, 2024

@wilwade Could you please update the commit message to include a description of the issue? It seems to be missing from the ticket as well. Including this information would make it easier to review the PR.

Additionally, as a friendly reminder, please keep PRs scoped to the issue at hand. It looks like there are some additional changes that might be out of scope for this particular fix.

Copy link
Collaborator

@enddynayn enddynayn left a comment

Choose a reason for hiding this comment

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

great! 👍

@wilwade wilwade mentioned this pull request May 22, 2024
4 tasks
@@ -1068,7 +1068,7 @@ impl pallet_proxy::Config for Runtime {
type CallHasher = BlakeTwo256;
type AnnouncementDepositBase = AnnouncementDepositBase;
type AnnouncementDepositFactor = AnnouncementDepositFactor;
type WeightInfo = weights::pallet_proxy::WeightInfo<Runtime>;
type WeightInfo = weights::pallet_proxy::SubstrateWeight<Runtime>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fix for the proxy_pallet

@wilwade
Copy link
Collaborator Author

wilwade commented May 22, 2024

@wilwade Could you please update the commit message to include a description of the issue? It seems to be missing from the ticket as well. Including this information would make it easier to review the PR.

Additionally, as a friendly reminder, please keep PRs scoped to the issue at hand. It looks like there are some additional changes that might be out of scope for this particular fix.

Updated the issue and the PR description to make it easier to understand why these were combined. (tldr: Couldn't run the benchmarks to verify the fix without greater changes)

@enddynayn
Copy link
Collaborator

@wilwade Could you please update the commit message to include a description of the issue? It seems to be missing from the ticket as well. Including this information would make it easier to review the PR.
Additionally, as a friendly reminder, please keep PRs scoped to the issue at hand. It looks like there are some additional changes that might be out of scope for this particular fix.

Updated the issue and the PR description to make it easier to understand why these were combined. (tldr: Couldn't run the benchmarks to verify the fix without greater changes)

Thank you so much!

@enddynayn
Copy link
Collaborator

Thanks for updating the Wiki.

Copy link
Collaborator

@mattheworris mattheworris left a comment

Choose a reason for hiding this comment

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

  • Read through changes

🚢 it!

@wilwade wilwade enabled auto-merge (squash) May 22, 2024 14:58
Copy link
Collaborator

@shannonwells shannonwells left a comment

Choose a reason for hiding this comment

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

Read through the code, read through comments/questions...good to go

@wilwade wilwade merged commit 0db0a79 into main May 22, 2024
28 checks passed
@wilwade wilwade deleted the chore/fix-benchmarks branch May 22, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metadata-changed Metadata has changed since the latest full release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants