Skip to content

More scalable Proof of Space - #2526

Merged
nazar-pc merged 2 commits into
mainfrom
more-scalable-proof-of-space
Feb 12, 2024
Merged

More scalable Proof of Space#2526
nazar-pc merged 2 commits into
mainfrom
more-scalable-proof-of-space

Conversation

@nazar-pc

Copy link
Copy Markdown
Member

This one is a bit counter-intuitive.

Before/after:

chia/table/parallel     time:   [108.23 ms 109.01 ms 109.63 ms]
chia/table/parallel     time:   [119.45 ms 123.55 ms 127.52 ms]

Limited to 4 efficiency cores before/after:

chia/table/parallel     time:   [487.01 ms 489.29 ms 492.04 ms]
chia/table/parallel     time:   [531.40 ms 536.19 ms 541.15 ms]

So you might be wondering, why on Earth would I send a PR that makes things slower?

2 parallel benches before/after:

chia/table/parallel     time:   [189.94 ms 192.78 ms 195.86 ms]
chia/table/parallel     time:   [178.51 ms 185.22 ms 191.66 ms]

4 parallel benches before/after:

chia/table/parallel     time:   [451.34 ms 458.56 ms 465.66 ms]
chia/table/parallel     time:   [334.04 ms 338.05 ms 342.08 ms]

As you can see, old code is significantly slower with concurrency 2 or 4, new version improves performance down to 85ms per table when 4 tables are constructed concurrently. This is because updated implementation is doing strictly less work for each table, such that when other tables are processed concurrently they have more resources available to them, but every individual table generation is a bit slower.

With the performance level achieved already for single table creation scalability that improves plotting speeds seems much more important.

I plan to submit changes later that will increase default concurrency on farmer to take advantage of these improvements and maybe introduce optimizations of similar nature (and hopefully supranational/blst#203) to push plotting performance further than it ever was. It should also help to further reduce replotting impact on normal usage of the computer.

Please let me know if you think this tradeoff is not worth it or have any other concerns.

P.S. As a bonus parallel PoSpace is now supported in no-std environment, not that I expect anyone to take advantage of that 🙃

Code contributor checklist:

@nazar-pc nazar-pc added the need to audit This change needs to be audited label Feb 11, 2024
@nazar-pc
nazar-pc requested a review from rg3l3dr as a code owner February 11, 2024 00:08
@nazar-pc nazar-pc removed the need to audit This change needs to be audited label Feb 11, 2024

@dariolina dariolina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Got 16% improvement on my side as well! Nice work

@nazar-pc
nazar-pc added this pull request to the merge queue Feb 12, 2024
Merged via the queue into main with commit 1f7ce08 Feb 12, 2024
@nazar-pc
nazar-pc deleted the more-scalable-proof-of-space branch February 12, 2024 14:24
@nazar-pc nazar-pc mentioned this pull request Feb 19, 2024
1 task
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 this pull request may close these issues.

2 participants