Optimization pass: Use AutoHoG to construct compound multi-input/multi-output gates for CGGI schemes #648
asraa
started this conversation in
Design discussions
Replies: 1 comment 2 replies
-
Some notes:
@sbian3 could we get access to a copy of the AutoHoG paper linked above? I don't have access to it. Some questions I have related to the paper:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
AutoHoG is a procedure for generating "enriched" compound gates over FHE that can reduce the computational complexity of boolean FHE circuit, like the CGGI scheme, when compared to using standard cell libraries (e.g. LUT cells, or AND/NOT/XOR/etc gates). AutoHoG takes Verilog and synthesizes a netlist (as JSON), which is then converted into a DAG (as JSON). AutoHoG produces an optimized DAG which is given the Iyokan for gate evaluation.
Currently, our tosa-to-boolean-tfhe pipeline lowers standard MLIR circuits to an optimized combinational circuit using either LUT cells or the standard boolean gate cells. This conversion pass internally converts the module into Verilog and calls Yosys as a library. The Yosys passes use ABC to techmap the circuit. The resulting RTLIL (Yosys' internal circuit representation) is converted back to MLIR using a combinational circuit dialect that contains LUT and boolean gate operations.
Proposal
This proposal is to integrate AutoHoG into our pass pipeline as a replacement for the current Yosys Optimizer pass described above.
Design and Discussions
The multi-input single-output (MISO) gates generated by AutoHoG specify (1) a linear combination to apply to the inputs and (2) a truth table applied to the result of the linear combination. In our current pass, we read the truth table value from the RTLIL cell's string attribute. If the optimized DAG can contain custom attributes for the cells, we can translate those into MLIR attributes.
In MLIR, we can construct an abstract cell that holds (1) a custom attribute "linear combination" that contains (i) an array of integers describing the weights of the linear combination and (ii) an offset added and (2) an integer attribute that represents the truth table input T (a table of size n can be represented with an n-bit integer). For e.g.
AutoHoG also combines multiple MISO gates to a MIMO gate by combining gates that have the same inputs. This technique can evaluate multiple LUTs on those same inputs with the cost of a single bootstrap. After blind rotate, we multiply by another polynomial. The biggest concern here is holding this polynomial in memory.
TODO: I'm still working on this one
The exit dialect we lower to to emit library code (before we simply lower the scheme to low-level instructions / LLVM / etc) will require the ability to evaluate the linear combinations at runtime and to generate the LUTs are runtime. We may be able to encode the linear logic into API calls when lowering to the scheme-specific dialects, for e.g. the MISO gate can be lowered to
Clearly, we need to lower to dialects that can support granular ops like generate test polynomials, blind roate, multiplying by polynomials, etc.
cc @sbian3 @Lavendes
I will continue to update tomorrow with more info.
Beta Was this translation helpful? Give feedback.
All reactions