Skip to content

Commit

Permalink
docs(frontend): massive modifications in the documentation
Browse files Browse the repository at this point in the history
refs #812
  • Loading branch information
bcm-at-zama committed Jul 24, 2024
1 parent d00d4e5 commit ae6fa35
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 23 deletions.
13 changes: 7 additions & 6 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
* [What is Concrete?](get-started/readme.md)
* [Installation](get-started/installing.md)
* [Quick start](get-started/quick_start.md)
* [Compatibility](get-started/compatibility.md)
* [Limitations](get-started/limitations.md)
* [Terminology](get-started/terminology.md)

## Core features
## Operations

* [Overview](core-features/fhe_basics.md)
* [Table lookups (basics)](core-features/table_lookups.md)
* [Table Lookups basics](core-features/table_lookups.md)
* [Non-linear operations](core-features/non_linear_operations.md)
* Advanced features
* Other operations
* [Bit extraction](core-features/bit_extraction.md)
* [Common tips](core-features/workarounds.md)
* [Extensions](core-features/extensions.md)
Expand Down Expand Up @@ -57,12 +57,13 @@
## References

* [API](dev/api/README.md)
* [Supported operations](dev/compatibility.md)

## Explanations

* [Compiler workflow](dev/compilation/compiler_workflow.md)
* Compiler internals
* [Table lookups](core-features/table_lookups_advanced.md)
* Advanced features
* [Table Lookups advanced](core-features/table_lookups_advanced.md)
* [Rounding](core-features/rounding.md)
* [Truncating](core-features/truncating.md)
* [Floating points](core-features/floating_points.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/core-features/non_linear_operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In Concrete, there are basically two types of operations:
TLU are essential to be able to compile all functions, by keeping the semantic of user's program, but
they can be slower, depending on the bitwidth of the inputs of the TLU.

In this document, we explain briefly, from a user point of view, how it works for non-linear operations as comparisons, min/max, bitwise operations, shifts. In [the poweruser documentation](table_lookups_advanced.md), we enter a bit more into the details.
In this document, we explain briefly, from a user point of view, how it works for non-linear operations as comparisons, min/max, bitwise operations, shifts. In [the TLU advanced documentation](table_lookups_advanced.md), we enter a bit more into the details.

## Changing bit width in the MLIR or dynamically with a TLU

Expand Down
4 changes: 2 additions & 2 deletions docs/core-features/table_lookups.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Table lookup

In TFHE, there exists mainly two operations: the linear operations (additions, subtractions, multiplications by integers) and the rest. And the rest is done with table lookups (TLUs), which means that a lot of things are done with TLU. In this document, we explain briefly, from a user point of view, how TLU can be used. In [the poweruser documentation](table_lookups_advanced.md), we enter a bit more into the details.
In TFHE, there exists mainly two operations: the linear operations (additions, subtractions, multiplications by integers) and the rest. And the rest is done with table lookups (TLUs), which means that a lot of things are done with TLU. In this document, we explain briefly, from a user point of view, how TLU can be used. In [the TLU advanced documentation](table_lookups_advanced.md), we enter a bit more into the details.

## Performance

Expand Down Expand Up @@ -133,7 +133,7 @@ As we said in the beginning of this document, bitsize of the inputs of TLU are c

For lot of use-cases, like for example in Machine Learning, it is possible to replace the table lookup `y = T[i]` by some `y = T'[i']`, where `i'` only has the most significant bits of `i` and `T'` is a much shorter table, and still maintain a good accuracy of the function. The interest of such a method stands in the fact that, since the table `T'` is much smaller, the corresponding TLU will be done much more quickly.

There are different flavors of doing this in Concrete. We describe them quickly here, and refer the user to the [poweruser documentation](table_lookups_advanced.md) for more explanations.
There are different flavors of doing this in Concrete. We describe them quickly here, and refer the user to the [TLU advanced documentation](table_lookups_advanced.md) for more explanations.

The first possibility is to set `i'` as the truncation of `i`: here, we just take the most significant bits of `i`. This is done with `fhe.truncate_bit_pattern`.

Expand Down
14 changes: 0 additions & 14 deletions docs/get-started/compatibility.md → docs/dev/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,3 @@ Some operations are not supported between two encrypted values. If attempted, a
* [np.ndarray.ndim](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.ndim.html)
* [np.ndarray.size](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.size.html)
* [np.ndarray.T](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.T.html)

## Limitations

### Control flow constraints

Concrete doesn not support some control flow statements, including the `if` and `while` statement when the condition depends on an encrypted value. However, control flow statements with constant values are allowed, for example, `for i in range(SOME_CONSTANT)`, `if os.environ.get("SOME_FEATURE") == "ON":`.

### Type constraints

Floating-point inputs or floating-point outputs are not supported. You can have floating-point intermediate values as long as they can be converted to an integer Table Lookup, for example, `(60 * np.sin(x)).astype(np.int64)`.

### Bit width constraints

Bit width of encrypted values has a limit. We are constantly working on increasing the bit width limit. Exceeding this limit will trigger an error.
13 changes: 13 additions & 0 deletions docs/get-started/limitations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Limitations
This document outlines the current limitations of Concrete, concerning the control flow constraints, the encrypted type constraints, and the bit width constraints of encrypted values.
## Control flow constraints

Concrete doesn not support some control flow statements, including the `if` and `while` statement when the condition depends on an encrypted value. However, control flow statements with constant values are allowed, for example, `for i in range(SOME_CONSTANT)`, `if os.environ.get("SOME_FEATURE") == "ON":`.

## Type constraints

Floating-point inputs or floating-point outputs are not supported. You can have floating-point intermediate values as long as they can be converted to an integer Table Lookup, for example, `(60 * np.sin(x)).astype(np.int64)`.

## Bit width constraints

Bit width of encrypted values has a limit. We are constantly working on increasing the bit width limit. Exceeding this limit will trigger an error.
3 changes: 3 additions & 0 deletions docs/get-started/terminology.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ This document provides clear definitions of key concepts used in **Concrete** fr

* **Circuit:** The result of compilation. A circuit includes both client and server components. It has methods for various operations, such as printing and evaluation.

* **Table Lookup (TLU):** TLU stands for instructions in the form of y = T[i]. In FHE, this operation is performed with Programmable Bootstrapping, which is the equivalent operation on encrypted values."

* **Programmable Bootstrapping (PBS):** PBS is equivalent to table lookup `y = T[i]` on encrypted values, which means that the inputs `i` and the outputs `y` are encrypted, but the table `T` is not encrypted.

0 comments on commit ae6fa35

Please sign in to comment.