Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Re-run weight baseline #13336

Closed
wants to merge 3 commits into from
Closed

Re-run weight baseline #13336

wants to merge 3 commits into from

Conversation

athei
Copy link
Member

@athei athei commented Feb 8, 2023

@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Feb 8, 2023
@athei athei mentioned this pull request Feb 8, 2023
// Standard Error: 8_433
.saturating_add(Weight::from_ref_time(12_773_098).saturating_mul(n.into()))
// Minimum execution time: 341_790 nanoseconds.
Weight::from_ref_time(648_404_995)
Copy link
Contributor

Choose a reason for hiding this comment

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

wow, that's a significant increase

@mateo-moon
Copy link
Contributor

/cmd queue -c bench $ pallet dev contracts

@ggwpez
Copy link
Member

ggwpez commented Feb 8, 2023

Looks like 13 cases went up by over 20% while the other 104 stayed consistent. Maybe we have to increase the INSTR_BENCHMARK_BATCHES to get them to be consistent for the VMs.

@athei
Copy link
Member Author

athei commented Feb 8, 2023

@Robbepop Could it be still the problem with cranelift producing unaligned memory operations? I think we fixed it in wasmi by not zeroing a huge stack on every instantiate? But this was only a 10% spread.

Maybe we have to increase the INSTR_BENCHMARK_BATCHES to get them to be consistent for the VMs.

The thing is: It was working before. We can experiment with those. But this shouldn't be done on a live codebase. My work is completely stalled now. So please roll back those changes at least for substrate. Then you can find a working config on a branch. Once everything works we can switch over. But right now I have pressing deadlines and need to merge stuff. And I can't do that while flying blind with benchmarks.

@ggwpez
Copy link
Member

ggwpez commented Feb 8, 2023

The thing is: It was working before. We can experiment with those. But this shouldn't be done on a live codebase. My work is completely stalled now. So please roll back those changes at least for substrate. Then you can find a working config on a branch. Once everything works we can switch over. But right now I have pressing deadlines and need to merge stuff. And I can't do that while flying blind with benchmarks.

Yea, maybe we can swap the labels back to the old machines @oleg-plakida? Then fix it in #13316 and merge after it stays consistent.

@alvicsam
Copy link
Contributor

alvicsam commented Feb 8, 2023

@athei you can run benchmarks on the old runner with command

/cmd queue -c bench -v PIPELINE_SCRIPTS_REF=bm-fallback $ pallet dev <pallet_name>

Does this unblock you?

@ggwpez
Copy link
Member

ggwpez commented Feb 8, 2023

/cmd queue -c bench $ pallet dev pallet_contracts

@Robbepop
Copy link
Contributor

Robbepop commented Feb 8, 2023

@Robbepop Could it be still the problem with cranelift producing unaligned memory operations? I think we fixed it in wasmi by not zeroing a huge stack on every instantiate? But this was only a 10% spread.

I cannot remember to have noticed that the unaligned memory issue has been fixed in Wasmtime.

Not so much has changed in wasmi with respect to Wasm instantiation besides a bug fix that should improve performance for imported memories and tables significantly.

@athei
Copy link
Member Author

athei commented Feb 8, 2023

@Robbepop Could it be still the problem with cranelift producing unaligned memory operations? I think we fixed it in wasmi by not zeroing a huge stack on every instantiate? But this was only a 10% spread.

I cannot remember to have noticed that the unaligned memory issue has been fixed in Wasmtime.

Not so much has changed in wasmi with respect to Wasm instantiation besides a bug fix that should improve performance for imported memories and tables significantly.

I know it isn't fixed in cranelift. But I think we shrank the initial stack size in wasmi massively to it doesn't have a big impact anymore (or at least make it configurable).

@ggwpez
Copy link
Member

ggwpez commented Feb 8, 2023

/bot bench $ pallet dev pallet_contracts

Third run is a bit more consistent over-all with one outlier to instr_br_table @ 157%, the other br instructions are quite high as well 🤔 third-diff-to-second.zip

@ggwpez
Copy link
Member

ggwpez commented Feb 8, 2023

bot bench $ pallet dev pallet_contracts

@ggwpez
Copy link
Member

ggwpez commented Feb 8, 2023

bot clean

@command-bot
Copy link

command-bot bot commented Feb 8, 2023

@ggwpez Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_contracts has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2367985 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2367985/artifacts/download.

// Standard Error: 68
.saturating_add(Weight::from_ref_time(57_263).saturating_mul(c.into()))
// Minimum execution time: 36_506 nanoseconds.
Weight::from_ref_time(40_743_562)
Copy link
Contributor

Choose a reason for hiding this comment

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

significant increase

// Standard Error: 33
.saturating_add(Weight::from_ref_time(35_317).saturating_mul(c.into()))
// Minimum execution time: 471_172 nanoseconds.
Weight::from_ref_time(499_386_220)
Copy link
Contributor

Choose a reason for hiding this comment

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

same

// Standard Error: 378
.saturating_add(Weight::from_ref_time(124_393).saturating_mul(c.into()))
// Minimum execution time: 4_501_838 nanoseconds.
Weight::from_ref_time(899_786_250)
Copy link
Contributor

Choose a reason for hiding this comment

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

same

// Standard Error: 12
.saturating_add(Weight::from_ref_time(2_401).saturating_mul(s.into()))
// Minimum execution time: 2_359_219 nanoseconds.
Weight::from_ref_time(338_145_767)
Copy link
Contributor

Choose a reason for hiding this comment

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

oh gosh

@athei athei closed this Feb 16, 2023
@athei athei deleted the at/weights branch February 16, 2023 15:23
@mateo-moon mateo-moon restored the at/weights branch February 22, 2023 17:05
@athei athei deleted the at/weights branch March 10, 2023 11:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants