From c8cec108b0ef1395ec72c8695d2b710876ef169d Mon Sep 17 00:00:00 2001 From: jeanmon Date: Fri, 16 Feb 2024 11:12:19 +0000 Subject: [PATCH 1/4] Yellow paper: AVM circuit Chiplets section --- yellow-paper/docs/public-vm/avm-circuit.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/yellow-paper/docs/public-vm/avm-circuit.md b/yellow-paper/docs/public-vm/avm-circuit.md index 6ab5a2f437d..f0642f898a9 100644 --- a/yellow-paper/docs/public-vm/avm-circuit.md +++ b/yellow-paper/docs/public-vm/avm-circuit.md @@ -149,7 +149,24 @@ Any lookup into calldata from a request's initial contract call must retrieve a **TODO** ## Chiplets -**TODO** + +A chiplet is a component dedicating to perform specialized sub-operations sharing some commonalities. Each chiplet consists of a specific table being part of the AVM circuit, i.e., specific columns with relations solely acting on them form the chiplet. The main rationale is to offload specialized computations outside of the **operations trace** (instruction controller) which might require more than a single row and/or additional dedicated columns. In addition, this approach offers modularity as chiplets are very independent components. + +The interaction between a chiplet and the instruction controller follows the following pattern: + +1. The **inputs** of a chiplet sub-operation are loaded to the respective intermediate registers (usually $I_a$, $I_b$). +2. The dedicated chiplet fetches/copies the content of the intermediate registers from the **operations trace** in its own table and executes the operation. +3. The output of the operation is copied back to the **operations trace** in a specific register (usually $I_c$). This register is usually involved in a write memory sub-operation. + +In addition to the mentioned inputs and output, some other relevant information such as the instruction tag might be copied as well to the chiplet. + +In the circuit, the transmission of the input/output between the **chiplet trace** and the **operations trace** are performed through lookup or permutation constraints, i.e., they ensure that all relevant intermediate registers have the same values between both traces. The unique key of this mapping is `CLK` which is basically used as a "DB foreign key" from the **chiplet trace** pointing to corresponding entry in the **operations trace**. + +The planned chiplets for the AVM are: + +- **ALU**: Arithmetic and bitwise operations such as addition, multiplication, XOR, etc... +- **Type Converter**: Dedicated to casting words between different types and/or type constraints. +- **Complex Operations:** Cryptographic relevant operations or other computationally intensive gadgets. Potentially comprised of several chiplets (TBD). ## Circuit I/O ### How do "Public Inputs" work in the AVM circuit? From adf9eaeb6beb366680d3847841952fdfefc106b4 Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:24:45 +0100 Subject: [PATCH 2/4] Update yellow-paper/docs/public-vm/avm-circuit.md Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com> --- yellow-paper/docs/public-vm/avm-circuit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yellow-paper/docs/public-vm/avm-circuit.md b/yellow-paper/docs/public-vm/avm-circuit.md index f0642f898a9..a098d5c2a8f 100644 --- a/yellow-paper/docs/public-vm/avm-circuit.md +++ b/yellow-paper/docs/public-vm/avm-circuit.md @@ -150,7 +150,7 @@ Any lookup into calldata from a request's initial contract call must retrieve a ## Chiplets -A chiplet is a component dedicating to perform specialized sub-operations sharing some commonalities. Each chiplet consists of a specific table being part of the AVM circuit, i.e., specific columns with relations solely acting on them form the chiplet. The main rationale is to offload specialized computations outside of the **operations trace** (instruction controller) which might require more than a single row and/or additional dedicated columns. In addition, this approach offers modularity as chiplets are very independent components. +A chiplet is essentially a sub-circuit for performing specialized sub-operations. A chiplet is defined as a dedicated table (a set of columns and relations) in the AVM circuit that is activated when the the relevant sub-operation is used. The main rationale behind the use of chiplets is to offload specialized computations to a region of the circuit _outside the main operations trace and instruction controller_ where the computations might require many rows and/or additional dedicated columns. In addition, this approach offers strong modularity for the operations implemented as chiplets. The interaction between a chiplet and the instruction controller follows the following pattern: From 130e950e99cb069d1f864cf3095720e484f4c3ea Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:25:02 +0100 Subject: [PATCH 3/4] Update yellow-paper/docs/public-vm/avm-circuit.md Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com> --- yellow-paper/docs/public-vm/avm-circuit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yellow-paper/docs/public-vm/avm-circuit.md b/yellow-paper/docs/public-vm/avm-circuit.md index a098d5c2a8f..eb183aff79a 100644 --- a/yellow-paper/docs/public-vm/avm-circuit.md +++ b/yellow-paper/docs/public-vm/avm-circuit.md @@ -166,7 +166,7 @@ The planned chiplets for the AVM are: - **ALU**: Arithmetic and bitwise operations such as addition, multiplication, XOR, etc... - **Type Converter**: Dedicated to casting words between different types and/or type constraints. -- **Complex Operations:** Cryptographic relevant operations or other computationally intensive gadgets. Potentially comprised of several chiplets (TBD). +- **Gadgets:** Relevant cryptographic operations or other computationally intensive operations. There will likely be multiple chiplets of this category, including `Poseidon2Permutation`, `Keccakf1600`, and `ECADD`. ## Circuit I/O ### How do "Public Inputs" work in the AVM circuit? From 55fcbf44e1ca27332dddb1de8872127aee6bb5fb Mon Sep 17 00:00:00 2001 From: David Banks <47112877+dbanks12@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:29:15 -0500 Subject: [PATCH 4/4] Update yellow-paper/docs/public-vm/avm-circuit.md --- yellow-paper/docs/public-vm/avm-circuit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yellow-paper/docs/public-vm/avm-circuit.md b/yellow-paper/docs/public-vm/avm-circuit.md index eb183aff79a..57eee866234 100644 --- a/yellow-paper/docs/public-vm/avm-circuit.md +++ b/yellow-paper/docs/public-vm/avm-circuit.md @@ -150,7 +150,7 @@ Any lookup into calldata from a request's initial contract call must retrieve a ## Chiplets -A chiplet is essentially a sub-circuit for performing specialized sub-operations. A chiplet is defined as a dedicated table (a set of columns and relations) in the AVM circuit that is activated when the the relevant sub-operation is used. The main rationale behind the use of chiplets is to offload specialized computations to a region of the circuit _outside the main operations trace and instruction controller_ where the computations might require many rows and/or additional dedicated columns. In addition, this approach offers strong modularity for the operations implemented as chiplets. +A chiplet is essentially a sub-circuit for performing specialized sub-operations. A chiplet is defined as a dedicated table (a set of columns and relations) in the AVM circuit that is activated when the relevant sub-operation is used. The main rationale behind the use of chiplets is to offload specialized computations to a region of the circuit _outside the main operations trace and instruction controller_ where the computations might require many rows and/or additional dedicated columns. In addition, this approach offers strong modularity for the operations implemented as chiplets. The interaction between a chiplet and the instruction controller follows the following pattern: