Skip to content

Commit

Permalink
docs(frontend): updata API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
youben11 committed Dec 26, 2024
1 parent 509f35b commit b1a67d2
Show file tree
Hide file tree
Showing 27 changed files with 75 additions and 99 deletions.
9 changes: 9 additions & 0 deletions docs/dev/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@
- [`composition.CompositionPolicy`](./concrete.fhe.compilation.composition.md): A protocol for composition policies.
- [`composition.CompositionRule`](./concrete.fhe.compilation.composition.md): A raw composition rule.
- [`configuration.ApproximateRoundingConfig`](./concrete.fhe.compilation.configuration.md): Controls the behavior of approximate rounding.
- [`configuration.BitwiseStrategy`](./concrete.fhe.compilation.configuration.md): BitwiseStrategy, to specify implementation preference for bitwise operations.
- [`configuration.ComparisonStrategy`](./concrete.fhe.compilation.configuration.md): ComparisonStrategy, to specify implementation preference for comparisons.
- [`configuration.Configuration`](./concrete.fhe.compilation.configuration.md): Configuration class, to allow the compilation process to be customized.
- [`configuration.Exactness`](./concrete.fhe.compilation.configuration.md).
- [`configuration.MinMaxStrategy`](./concrete.fhe.compilation.configuration.md): MinMaxStrategy, to specify implementation preference for minimum and maximum operations.
- [`configuration.MultiParameterStrategy`](./concrete.fhe.compilation.configuration.md): MultiParamStrategy, to set optimization strategy for multi-parameter.
- [`configuration.MultivariateStrategy`](./concrete.fhe.compilation.configuration.md): MultivariateStrategy, to specify implementation preference for multivariate operations.
- [`configuration.ParameterSelectionStrategy`](./concrete.fhe.compilation.configuration.md): ParameterSelectionStrategy, to set optimization strategy.
- [`configuration.SecurityLevel`](./concrete.fhe.compilation.configuration.md): Security level used to optimize the circuit parameters.
- [`decorators.Compilable`](./concrete.fhe.compilation.decorators.md): Compilable class, to wrap a function and provide methods to trace and compile it.
- [`evaluation_keys.EvaluationKeys`](./concrete.fhe.compilation.evaluation_keys.md): EvaluationKeys required for execution.
- [`keys.Keys`](./concrete.fhe.compilation.keys.md): Keys class, to manage generate/reuse keys.
Expand Down
3 changes: 0 additions & 3 deletions docs/dev/api/concrete.compiler.compilation_feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# <kbd>module</kbd> `concrete.compiler.compilation_feedback`
Compilation feedback.

**Global Variables**
---------------
- **REGEX_LOCATION**

---

Expand Down
4 changes: 2 additions & 2 deletions docs/dev/api/concrete.fhe.compilation.circuit.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ Enable FHE simulation.
```python
encrypt(
*args: Optional[int, ndarray, List]
) → Union[Value, Tuple[Union[Value, NoneType], ], NoneType]
) → Union[Value, Tuple[Optional[Value], ], NoneType]
```

Encrypt argument(s) to for evaluation.
Expand Down Expand Up @@ -493,7 +493,7 @@ Generate keys required for homomorphic evaluation.

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

Expand Down
4 changes: 2 additions & 2 deletions docs/dev/api/concrete.fhe.compilation.client.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Decrypt result(s) of evaluation.
encrypt(
*args: Optional[int, ndarray, List],
function_name: Optional[str] = None
) → Union[Value, Tuple[Union[Value, NoneType], ], NoneType]
) → Union[Value, Tuple[Optional[Value], ], NoneType]
```

Encrypt argument(s) to for evaluation.
Expand Down Expand Up @@ -216,7 +216,7 @@ Simulate decryption of result(s) of evaluation.
simulate_encrypt(
*args: Optional[int, ndarray, List],
function_name: Optional[str] = None
) → Union[Value, Tuple[Union[Value, NoneType], ], NoneType]
) → Union[Value, Tuple[Optional[Value], ], NoneType]
```

Simulate encryption of argument(s) for evaluation.
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/api/concrete.fhe.compilation.composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Create a composition rule from a tuple containing an output clause and an input

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/composition.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/composition.py#L44"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `CompositionPolicy`
A protocol for composition policies.
Expand Down
51 changes: 36 additions & 15 deletions docs/dev/api/concrete.fhe.compilation.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ Declaration of `Configuration` class.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L24"><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/configuration.py#L25"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `SecurityLevel`
Security level used to optimize the circuit parameters.





---

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

## <kbd>class</kbd> `ParameterSelectionStrategy`
ParameterSelectionStrategy, to set optimization strategy.
Expand All @@ -25,7 +36,7 @@ ParameterSelectionStrategy, to set optimization strategy.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L51"><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/configuration.py#L61"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `MultiParameterStrategy`
MultiParamStrategy, to set optimization strategy for multi-parameter.
Expand All @@ -36,7 +47,7 @@ MultiParamStrategy, to set optimization strategy for multi-parameter.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L77"><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/configuration.py#L87"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `Exactness`
Exactness, to specify for specific operator the implementation preference (default and local).
Expand All @@ -47,14 +58,14 @@ Exactness, to specify for specific operator the implementation preference (defau

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L86"><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/configuration.py#L96"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `ApproximateRoundingConfig`
Controls the behavior of approximate rounding.

In the following `k` is the ideal rounding output precision. Often the precision used after rounding is `k`+1 to avoid overflow. `logical_clipping`, `approximate_clipping_start_precision` can be used to stay at precision `k`, either logically or physically at the successor TLU. See examples in https://github.com/zama-ai/concrete/blob/main/docs/core-features/rounding.md.

<a href="../../tempdirectoryforapidocs/<string>"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../../<string>"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

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

Expand All @@ -77,7 +88,7 @@ __init__(

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L125"><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/configuration.py#L135"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `ComparisonStrategy`
ComparisonStrategy, to specify implementation preference for comparisons.
Expand All @@ -88,7 +99,7 @@ ComparisonStrategy, to specify implementation preference for comparisons.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L497"><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/configuration.py#L507"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `BitwiseStrategy`
BitwiseStrategy, to specify implementation preference for bitwise operations.
Expand All @@ -99,7 +110,7 @@ BitwiseStrategy, to specify implementation preference for bitwise operations.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L695"><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/configuration.py#L705"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `MultivariateStrategy`
MultivariateStrategy, to specify implementation preference for multivariate operations.
Expand All @@ -110,7 +121,7 @@ MultivariateStrategy, to specify implementation preference for multivariate oper

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L804"><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/configuration.py#L814"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `MinMaxStrategy`
MinMaxStrategy, to specify implementation preference for minimum and maximum operations.
Expand All @@ -121,12 +132,12 @@ MinMaxStrategy, to specify implementation preference for minimum and maximum ope

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L939"><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/configuration.py#L949"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `Configuration`
Configuration class, to allow the compilation process to be customized.

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L998"><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/configuration.py#L1012"><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 @@ -184,7 +195,11 @@ __init__(
detect_overflow_in_simulation: bool = False,
dynamic_indexing_check_out_of_bounds: bool = True,
dynamic_assignment_check_out_of_bounds: bool = True,
simulate_encrypt_run_decrypt: bool = False
simulate_encrypt_run_decrypt: bool = False,
range_restriction: Optional[RangeRestriction] = None,
keyset_restriction: Optional[KeysetRestriction] = None,
auto_schedule_run: bool = False,
security_level: SecurityLevel = <SecurityLevel.SECURITY_128_BITS: 128>
)
```

Expand All @@ -197,7 +212,7 @@ __init__(

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/configuration.py#L1180"><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/configuration.py#L1204"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `fork`

Expand Down Expand Up @@ -255,10 +270,16 @@ fork(
detect_overflow_in_simulation: Union[Keep, bool] = <concrete.fhe.compilation.configuration.Configuration.Keep object at ADDRESS>,
dynamic_indexing_check_out_of_bounds: Union[Keep, bool] = <concrete.fhe.compilation.configuration.Configuration.Keep object at ADDRESS>,
dynamic_assignment_check_out_of_bounds: Union[Keep, bool] = <concrete.fhe.compilation.configuration.Configuration.Keep object at ADDRESS>,
simulate_encrypt_run_decrypt: Union[Keep, bool] = <concrete.fhe.compilation.configuration.Configuration.Keep object at ADDRESS>
simulate_encrypt_run_decrypt: Union[Keep, bool] = <concrete.fhe.compilation.configuration.Configuration.Keep object at ADDRESS>,
range_restriction: Optional[Keep, RangeRestriction] = <concrete.fhe.compilation.configuration.Configuration.Keep object at ADDRESS>,
keyset_restriction: Optional[Keep, KeysetRestriction] = <concrete.fhe.compilation.configuration.Configuration.Keep object at ADDRESS>,
auto_schedule_run: Union[Keep, bool] = <concrete.fhe.compilation.configuration.Configuration.Keep object at ADDRESS>,
security_level: Union[Keep, SecurityLevel] = <concrete.fhe.compilation.configuration.Configuration.Keep object at ADDRESS>
) → Configuration
```

Get a new configuration from another one specified changes.

See Configuration.
See Configuration.


8 changes: 4 additions & 4 deletions docs/dev/api/concrete.fhe.compilation.module.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ That this function requires the python `pygraphviz` package which itself require
```python
encrypt(
*args: Optional[int, ndarray, List]
) → Union[Value, Tuple[Union[Value, NoneType], ], NoneType]
) → Union[Value, Tuple[Optional[Value], ], NoneType]
```

Encrypt argument(s) to for evaluation.
Expand Down Expand Up @@ -367,7 +367,7 @@ Encrypt inputs, run the function, and decrypt the outputs in one go.

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

Expand All @@ -391,7 +391,7 @@ Evaluate the function.

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

Expand All @@ -414,7 +414,7 @@ Evaluate the function asynchronuously.
### <kbd>method</kbd> `run_sync`

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

Evaluate the function synchronuously.
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/api/concrete.fhe.compilation.module_compiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ __init__(functions: List[FunctionDef], composition: CompositionPolicy)

```python
compile(
inputsets: Optional[Dict[str, Union[Iterable[Any], Iterable[Tuple[Any, ]]]], NoneType] = None,
inputsets: Optional[Dict[str, Optional[Iterable[Any], Iterable[Tuple[Any, ]]]]] = None,
configuration: Optional[Configuration] = None,
module_artifacts: Optional[ModuleDebugArtifacts] = None,
**kwargs
Expand Down
4 changes: 2 additions & 2 deletions docs/dev/api/concrete.fhe.compilation.server.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ Load the server from the given path in zip format.
### <kbd>method</kbd> `memory_usage_per_location`

```python
memory_usage_per_location(function: str) → Dict[str, Union[int, NoneType]]
memory_usage_per_location(function: str) → Dict[str, Optional[int]]
```

Get the memory usage of operations per location.
Expand Down Expand Up @@ -536,7 +536,7 @@ Get the number of programmable bootstraps per tag per parameter in the compiled

```python
run(
*args: Optional[Value, Tuple[Union[Value], ], NoneType],
*args: Optional[Value, Tuple[Optional[Value], ]],
evaluation_keys: Optional[EvaluationKeys] = None,
function_name: Optional[str] = None
) → Union[Value, Tuple[Value, ]]
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/api/concrete.fhe.compilation.status.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Declaration of `EncryptionStatus` class.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/status.py#L11"><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/status.py#L10"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `EncryptionStatus`
EncryptionStatus enum, to represent encryption status of parameters.
Expand Down
10 changes: 4 additions & 6 deletions docs/dev/api/concrete.fhe.compilation.utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ Declaration of various functions and constants related to compilation.
**Global Variables**
---------------
- **TYPE_CHECKING**
- **SignedInteger**
- **UnsignedInteger**

---

Expand Down Expand Up @@ -106,7 +104,7 @@ Fuse appropriate subgraphs in a graph to a single Operation.Generic node.
find_float_subgraph_with_unique_terminal_node(
graph: Graph,
processed_terminal_nodes: Set[Node]
) → Union[Tuple[Dict[Node, NoneType], Dict[Node, NoneType], Node], NoneType]
) → Optional[Tuple[Dict[Node, NoneType], Dict[Node, NoneType], Node]]
```

Find a subgraph with float computations that end with an integer output.
Expand Down Expand Up @@ -134,7 +132,7 @@ Find a subgraph with float computations that end with an integer output.
find_tlu_subgraph_with_multiple_variable_inputs_that_has_a_single_common_ancestor(
graph: Graph,
processed_terminal_nodes: Set[Node]
) → Union[Tuple[Dict[Node, NoneType], Dict[Node, NoneType], Node], NoneType]
) → Optional[Tuple[Dict[Node, NoneType], Dict[Node, NoneType], Node]]
```

Find a subgraph with a tlu computation that has multiple variable inputs where all variable inputs share a common ancestor.
Expand All @@ -159,7 +157,7 @@ Find a subgraph with a tlu computation that has multiple variable inputs whe
## <kbd>function</kbd> `find_single_lca`

```python
find_single_lca(graph: Graph, nodes: List[Node]) → Union[Node, NoneType]
find_single_lca(graph: Graph, nodes: List[Node]) → Optional[Node]
```

Find the single lowest common ancestor of a list of nodes.
Expand Down Expand Up @@ -281,7 +279,7 @@ convert_subgraph_to_subgraph_node(
all_nodes: Dict[Node, NoneType],
start_nodes: Dict[Node, NoneType],
terminal_node: Node
) → Union[Tuple[Node, Node], NoneType]
) → Optional[Tuple[Node, Node]]
```

Convert a subgraph to Operation.Generic node.
Expand Down
4 changes: 2 additions & 2 deletions docs/dev/api/concrete.fhe.compilation.wiring.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Return an iterator over composition rules.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/wiring.py#L63"><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/wiring.py#L62"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `WireOutput`
A protocol for wire outputs.
Expand All @@ -83,7 +83,7 @@ Return an iterator over the possible outputs of the wire output.

---

<a href="../../frontends/concrete-python/concrete/fhe/compilation/wiring.py#L75"><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/wiring.py#L74"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `WireInput`
A protocol for wire inputs.
Expand Down
4 changes: 0 additions & 4 deletions docs/dev/api/concrete.fhe.dtypes.integer.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
# <kbd>module</kbd> `concrete.fhe.dtypes.integer`
Declaration of `Integer` class.

**Global Variables**
---------------
- **SignedInteger**
- **UnsignedInteger**


---
Expand Down
2 changes: 0 additions & 2 deletions docs/dev/api/concrete.fhe.dtypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Define available data types and their semantics.
- **base**
- **float**
- **integer**
- **SignedInteger**
- **UnsignedInteger**
- **utils**


4 changes: 0 additions & 4 deletions docs/dev/api/concrete.fhe.dtypes.utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
# <kbd>module</kbd> `concrete.fhe.dtypes.utils`
Declaration of various functions and constants related to data types.

**Global Variables**
---------------
- **SignedInteger**
- **UnsignedInteger**

---

Expand Down
1 change: 0 additions & 1 deletion docs/dev/api/concrete.fhe.extensions.round_bit_pattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Declaration of `round_bit_pattern` function, to provide an interface for rounded
**Global Variables**
---------------
- **MAXIMUM_TLU_BIT_WIDTH**
- **local**

---

Expand Down
Loading

0 comments on commit b1a67d2

Please sign in to comment.