-
Notifications
You must be signed in to change notification settings - Fork 330
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
perf: local bus #1293
Merged
Merged
perf: local bus #1293
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR contains changes to create a global and local interaction bus. The global bus will be used for all sent/received messages that needs to be communicated across shards (e.g. memory slots that are accessed in multiple shards and syscall made).
The main purpose of this change is to reduce the amount of data needed to commit in our prover phase 1. Currently, it commits to all the chips' main trace. But with the global bus, it will only need to commit to the cross shard information, which is a small fraction of all the main traces.
Summary of changes
Stark changes
Core prover (prover_with_context and prove.open)
In phase 1, for each shard it will do the following:
In phase 2, for each shard it will do the following:
a. Will accept two different sets of prover data (traces, commitment, main_data, chip ordering) for the local and global chips.
b. It will merge the trace, chip ordering, and main_data for the quotient computation and permutation trace.
c. It will call pcs.open on the two separate commitment and traces, and then merge those openings into one list.
Proof struct
Changes to the proof struct include:
Verifier
Changes to the verify include:
Permutation
Changes to the permutation file include:
Folder
Will contain two cumulative sums and two sets of permutation challenges (one for global, one for local). For the recursion folders, the global versions will just be set to zero.
Builder
All send/receive interactions must specify which bus it’s using.
Runtime/Executor
For every memory access in the shard, it will need to save the first and last access for each memory slot accessed (in the
local_memory_access
field). So in the memory reads/write function (mr/mw), that structure will be updated. Note that each precompile invocation will also need to save similar information since the precompile memory accesses can happen on a different shard.For every syscall innovation, it will emit a syscall event with the opcode and arguments to populate the syscall table.
The record will have two additional fields (MemoryLocalEvent and SyscallEvent) to populate the local memory tables and syscall tables respectively.
RiscvAir/MachineAir changes:
MachineAir trait
Added
commit_trace
function that is used to specify whether the chip should be committed to the global or local commitment. By default, it will be to the local commitment (the recursion proofs will not be having a notion of a global bus). The only chips that are added to the global commitment are (Global init/finalize memory, program memory, local init/finalize memory, syscall tables).New chips:
Generate dependencies
It now labels the set of chips to run generate dependencies on during phase 1.
Core Precompiles:
All the core precompiles contains the following changes:
Miscellaneous changes
shard
column from the byte table and all references to it in the code.ZeroCommitment
trait that is implemented for the PCS structs to return a “dummy” commitment. This is used to set the recursion proof’s global commitment to some value.