Skip to content

Commit

Permalink
docs(frontend): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
youben11 committed Dec 24, 2024
1 parent 7244153 commit c688131
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 94 deletions.
4 changes: 2 additions & 2 deletions docs/dev/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
- [`graph.MultiGraphProcessor`](./concrete.fhe.representation.graph.md): MultiGraphProcessor base class, to define the API for a multiple graph processing pipeline.
- [`node.Node`](./concrete.fhe.representation.node.md): Node class, to represent computation in a computation graph.
- [`operation.Operation`](./concrete.fhe.representation.operation.md): Operation enum, to distinguish nodes within a computation graph.
- [`bridge.Bridge`](./concrete.fhe.tfhers.bridge.md): TFHErs Bridge extend a Circuit with TFHErs functionalities.
- [`bridge.Bridge`](./concrete.fhe.tfhers.bridge.md): TFHErs Bridge extend an Module with TFHErs functionalities.
- [`dtypes.CryptoParams`](./concrete.fhe.tfhers.dtypes.md): Crypto parameters used for a tfhers integer.
- [`dtypes.EncryptionKeyChoice`](./concrete.fhe.tfhers.dtypes.md): TFHErs key choice: big or small.
- [`dtypes.TFHERSIntegerType`](./concrete.fhe.tfhers.dtypes.md) to represent tfhers integer types.
Expand Down Expand Up @@ -355,7 +355,7 @@
- [`utils.format_constant`](./concrete.fhe.representation.utils.md): Get the textual representation of a constant.
- [`utils.format_indexing_element`](./concrete.fhe.representation.utils.md): Format an indexing element.
- [`tfhers.get_type_from_params`](./concrete.fhe.tfhers.md): Get a TFHE-rs integer type from TFHE-rs parameters in JSON format.
- [`bridge.new_bridge`](./concrete.fhe.tfhers.bridge.md): Create a TFHErs bridge from a circuit.
- [`bridge.new_bridge`](./concrete.fhe.tfhers.bridge.md): Create a TFHErs bridge from a circuit or module.
- [`tracing.from_native`](./concrete.fhe.tfhers.tracing.md): Convert a Concrete integer to the tfhers representation.
- [`tracing.to_native`](./concrete.fhe.tfhers.tracing.md): Convert a tfhers integer to the Concrete representation.
- [`scalar.clear_scalar_builder`](./concrete.fhe.values.scalar.md): Build a clear scalar value.
Expand Down
26 changes: 10 additions & 16 deletions docs/dev/api/concrete.fhe.compilation.circuit.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ Get the number of encrypted negations per tag per parameter in the circuit.

---

#### <kbd>property</kbd> function_name

Return the name of the circuit.

---

#### <kbd>property</kbd> global_p_error

Get the probability of having at least one simple TLU error during the entire execution.
Expand Down Expand Up @@ -325,7 +319,7 @@ Get all statistics of the circuit.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L233"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L226"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `cleanup`

Expand All @@ -337,7 +331,7 @@ Cleanup the temporary library output directory.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L200"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L193"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `decrypt`

Expand All @@ -361,7 +355,7 @@ Decrypt result(s) of evaluation.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L52"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L45"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `draw`

Expand Down Expand Up @@ -395,7 +389,7 @@ That this function requires the python `pygraphviz` package which itself require

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L100"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L93"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `enable_fhe_execution`

Expand All @@ -407,7 +401,7 @@ Enable FHE execution.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L94"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L87"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `enable_fhe_simulation`

Expand All @@ -419,7 +413,7 @@ Enable FHE simulation.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L165"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L158"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `encrypt`

Expand All @@ -443,7 +437,7 @@ Encrypt argument(s) to for evaluation.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L218"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L211"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `encrypt_run_decrypt`

Expand All @@ -465,7 +459,7 @@ Encrypt inputs, run the circuit, and decrypt the outputs in one go.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L135"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L128"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `keygen`

Expand Down Expand Up @@ -493,7 +487,7 @@ Generate keys required for homomorphic evaluation.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L182"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L175"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `run`

Expand All @@ -517,7 +511,7 @@ Evaluate the circuit.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L106"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/circuit.py#L99"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `simulate`

Expand Down
24 changes: 22 additions & 2 deletions docs/dev/api/concrete.fhe.compilation.keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Return the associated client specs if any.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/keys.py#L187"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/keys.py#L206"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `deserialize`

Expand Down Expand Up @@ -174,11 +174,31 @@ serialize() → bytes

Serialize keys into bytes.

Serialized keys are not encrypted, so be careful how you store/transfer them!
Serialized keys are not encrypted, so be careful how you store/transfer them! `serialize_to_file` is supposed to be more performant as it avoid copying the buffer between the Compiler and the Frontend.



**Returns:**
bytes: serialized keys

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/keys.py#L189"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `serialize_to_file`

```python
serialize_to_file(path: Path)
```

Serialize keys into a file.

Serialized keys are not encrypted, so be careful how you store/transfer them! This is supposed to be more performant than `serialize` as it avoid copying the buffer between the Compiler and the Frontend.



**Args:**

- <b>`path`</b> (Path): where to save serialized keys


92 changes: 75 additions & 17 deletions docs/dev/api/concrete.fhe.compilation.module.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,30 @@ Declaration of `FheModule` classes.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L27"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L30"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `ExecutionRt`
Runtime object class for execution.

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L42"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `__init__`

```python
__init__(client, server, auto_schedule_run)
```









---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L36"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L66"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `SimulationRt`
Runtime object class for simulation.
Expand All @@ -31,12 +43,12 @@ Runtime object class for simulation.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L45"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L75"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `FheFunction`
Fhe function class, allowing to run or simulate one function of an fhe module.

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L56"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L86"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `__init__`

Expand Down Expand Up @@ -245,13 +257,13 @@ Get all statistics of the function.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L204"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L333"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `decrypt`

```python
decrypt(
*results: Union[Value, Tuple[Value, ]]
*results: Union[Value, Tuple[Value, ], Awaitable[Union[Value, Tuple[Value, ]]]]
) → Union[int, ndarray, Tuple[Union[int, ndarray, NoneType], ], NoneType]
```

Expand All @@ -269,7 +281,7 @@ Decrypt result(s) of evaluation.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L82"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L112"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `draw`

Expand Down Expand Up @@ -303,7 +315,7 @@ That this function requires the python `pygraphviz` package which itself require

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L160"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L190"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `encrypt`

Expand All @@ -327,7 +339,7 @@ Encrypt argument(s) to for evaluation.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L225"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L355"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `encrypt_run_decrypt`

Expand All @@ -349,20 +361,66 @@ Encrypt inputs, run the function, and decrypt the outputs in one go.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L180"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L253"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `run`

```python
run(
*args: Optional[Value, Tuple[Union[Value], ], NoneType]
) → Union[Value, Tuple[Value, ]]
) → Union[Value, Tuple[Value, ], Awaitable[Union[Value, Tuple[Value, ]]]]
```

Evaluate the function.



**Args:**
*args (Value): argument(s) for evaluation



**Returns:**
Union[Value, Tuple[Value, ...], Awaitable[Union[Value, Tuple[Value, ...]]]]: result(s) of evaluation or future of result(s) of evaluation if configured with async_run=True

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L228"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `run_async`

```python
run_async(
*args: Optional[Value, Tuple[Union[Value], ], NoneType]
) → Union[Value, Tuple[Value, ], Awaitable[Union[Value, Tuple[Value, ]]]]
```

Evaluate the function asynchronuously.



**Args:**
*args (Value): argument(s) for evaluation



**Returns:**
Union[Awaitable[Value], Awaitable[Tuple[Value, ...]]]: result(s) a future of the evaluation

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L210"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `run_sync`

```python
run_sync(*args: Optional[Value, Tuple[Union[Value], ], NoneType]) → Any
```

Evaluate the function synchronuously.



**Args:**
*args (Value): argument(s) for evaluation

Expand All @@ -373,7 +431,7 @@ Evaluate the function.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L145"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L175"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `simulate`

Expand All @@ -396,12 +454,12 @@ Simulate execution of the function.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L567"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L697"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `FheModule`
Fhe module class, to combine computation graphs, mlir, runtime objects into a single object.

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L579"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L709"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `__init__`

Expand Down Expand Up @@ -508,7 +566,7 @@ Get all statistics of the module.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L677"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L809"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `cleanup`

Expand All @@ -520,7 +578,7 @@ Cleanup the temporary library output directory.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L748"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L880"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `functions`

Expand All @@ -532,7 +590,7 @@ Return a dictionnary containing all the functions of the module.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L652"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../frontends/concrete-python/concrete/fhe/compilation/module.py#L784"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `keygen`

Expand Down
Loading

0 comments on commit c688131

Please sign in to comment.