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

Decode in parallel #206

Open
eigmax opened this issue Jan 7, 2025 · 1 comment
Open

Decode in parallel #206

eigmax opened this issue Jan 7, 2025 · 1 comment

Comments

@eigmax
Copy link
Member

eigmax commented Jan 7, 2025

Test if we can decode in parallel, then perform it. https://github.com/zkMIPS/zkm/blob/main/prover/src/witness/transition.rs#L531

@VanhGer
Copy link
Contributor

VanhGer commented Jan 7, 2025

In the simulate_cpu function, we call transition(state, kernel) sequentially to update the state. Inside the transition function, we use try_perform_instruction once, where we decode the state.registers once. So the simplest solution to parallelize this computation is by parallelizing the matching pattern inside the decode function.

To do that, we need to create a vector consists of all possible patterns and their corresponding results, allowing us to use iter_par for parallel processing. However, this approach takes a lot of memory, and slows down the decode because of the time required to construct the vector. So it does not bring any tangible benefit.

We think about changing the whole simulator process for optimization.

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

No branches or pull requests

2 participants