-
Notifications
You must be signed in to change notification settings - Fork 97
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
[blocked] Support bus interactions in the mock prover #2306
Draft
Schaeff
wants to merge
6
commits into
main
Choose a base branch
from
bus-mock-prover
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
Following a conversation with @georgwiese, this is blocked due to existing issues with the multiplicities. |
Schaeff
changed the title
Support bus interactions in the mock prover
[blocked] Support bus interactions in the mock prover
Jan 6, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 9, 2025
While working on #2306, @Schaeff came across several bugs in multiplicity witness generation. These were undetected, because we ignored multiplicities in the mock prover, which will be fixed by #2310. With this PR, #2310 will be green. The issue was that counting multiplicities inside `Machine::process_plookup()` fails if the caller actually discards the result. This happens in a few places, for example during our loop optimization in the "dynamic machine". With this PR, we instead have a centralized `MultiplicityColumnGenerator` that counts multiplicities after the fact, by going over each lookup, evaluating the two selected tuples on all rows, and counting how often each element in the LHS appears in the RHS. To measure the runtime of this, I ran: ```sh export TEST=keccak export POWDR_JIT_OPT_LEVEL=0 cargo run -r --bin powdr-rs compile riscv/tests/riscv_data/$TEST -o output --max-degree-log 18 cargo run -r --features plonky3,halo2 pil output/$TEST.asm -o output -f --field gl --linker-mode bus ``` I get the following profile on the server: ``` == Witgen profile (2554126 events) 32.4% ( 2.6s): Secondary machine 0: main_binary (BlockMachine) 23.1% ( 1.9s): Main machine (Dynamic) 12.7% ( 1.0s): Secondary machine 4: main_regs (DoubleSortedWitnesses32) 10.0% ( 809.9ms): FixedLookup 7.7% ( 621.1ms): Secondary machine 5: main_shift (BlockMachine) 5.6% ( 454.6ms): Secondary machine 2: main_poseidon_gl (BlockMachine) 3.8% ( 312.3ms): multiplicity witgen 3.8% ( 308.2ms): witgen (outer code) 0.6% ( 45.3ms): Secondary machine 1: main_memory (DoubleSortedWitnesses32) 0.4% ( 33.4ms): Secondary machine 6: main_split_gl (BlockMachine) 0.0% ( 8.0µs): Secondary machine 3: main_publics (WriteOnceMemory) --------------------------- ==> Total: 8.114630092s ``` So the cost is ~4%. I'm sure it can be optimized further but I would like to leave this to a future PR.
leonardoalt
pushed a commit
that referenced
this pull request
Jan 11, 2025
While working on #2306, @Schaeff came across several bugs in multiplicity witness generation. These were undetected, because we ignored multiplicities in the mock prover, which will be fixed by #2310. With this PR, #2310 will be green. The issue was that counting multiplicities inside `Machine::process_plookup()` fails if the caller actually discards the result. This happens in a few places, for example during our loop optimization in the "dynamic machine". With this PR, we instead have a centralized `MultiplicityColumnGenerator` that counts multiplicities after the fact, by going over each lookup, evaluating the two selected tuples on all rows, and counting how often each element in the LHS appears in the RHS. To measure the runtime of this, I ran: ```sh export TEST=keccak export POWDR_JIT_OPT_LEVEL=0 cargo run -r --bin powdr-rs compile riscv/tests/riscv_data/$TEST -o output --max-degree-log 18 cargo run -r --features plonky3,halo2 pil output/$TEST.asm -o output -f --field gl --linker-mode bus ``` I get the following profile on the server: ``` == Witgen profile (2554126 events) 32.4% ( 2.6s): Secondary machine 0: main_binary (BlockMachine) 23.1% ( 1.9s): Main machine (Dynamic) 12.7% ( 1.0s): Secondary machine 4: main_regs (DoubleSortedWitnesses32) 10.0% ( 809.9ms): FixedLookup 7.7% ( 621.1ms): Secondary machine 5: main_shift (BlockMachine) 5.6% ( 454.6ms): Secondary machine 2: main_poseidon_gl (BlockMachine) 3.8% ( 312.3ms): multiplicity witgen 3.8% ( 308.2ms): witgen (outer code) 0.6% ( 45.3ms): Secondary machine 1: main_memory (DoubleSortedWitnesses32) 0.4% ( 33.4ms): Secondary machine 6: main_split_gl (BlockMachine) 0.0% ( 8.0µs): Secondary machine 3: main_publics (WriteOnceMemory) --------------------------- ==> Total: 8.114630092s ``` So the cost is ~4%. I'm sure it can be optimized further but I would like to leave this to a future PR.
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.
Tested with
test_data/asm/block_to_block_with_bus.asm
by removing the bus send: