diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index e4529e7ac6..066394a58c 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -7,7 +7,7 @@ * [What is Concrete?](get-started/readme.md) * [Installation](get-started/installing.md) * [Quick start](get-started/quick_start.md) -* [Limitations](get-started/limitations.md) +* [Quick overview](get-started/quick_overview.md) * [Terminology](get-started/terminology.md) ## Operations @@ -78,19 +78,19 @@ ## Developers * [Contributing](dev/contributing.md) + * [Project layout](explanations/layout.md) + * [Compiler backend](explanations/backends/README.md) + * [Adding a new backend](explanations/backends/new_backend.md) + * [Optimizer](explanations/optimizer.md) + * [MLIR FHE dialects](explanations/dialects.md) + * [FHELinalg dialect](explanations/FHELinalgDialect.md) + * [FHE dialect](explanations/FHEDialect.md) + * [TFHE dialect](explanations/TFHEDialect.md) + * [Concrete dialect](explanations/ConcreteDialect.md) + * [Tracing dialect](explanations/TracingDialect.md) + * [Runtime dialect](explanations/RTDialect.md) + * [SDFG dialect](explanations/SDFGDialect.md) + * [Call FHE circuits from other languages](explanations/call_from_other_language.md) * [Release note](https://github.com/zama-ai/concrete/releases) * [Feature request](https://github.com/zama-ai/concrete/issues/new?assignees=\&labels=feature\&projects=\&template=features.md) * [Bug report](https://github.com/zama-ai/concrete/issues/new?assignees=\&labels=bug%2C+triage\&projects=\&template=bug_report.md) -* [Project layout](explanations/layout.md) -* [Compiler backend](explanations/backends/README.md) - * [Adding a new backend](explanations/backends/new_backend.md) -* [Optimizer](explanations/optimizer.md) -* [MLIR FHE dialects](explanations/dialects.md) - * [FHELinalg dialect](explanations/FHELinalgDialect.md) - * [FHE dialect](explanations/FHEDialect.md) - * [TFHE dialect](explanations/TFHEDialect.md) - * [Concrete dialect](explanations/ConcreteDialect.md) - * [Tracing dialect](explanations/TracingDialect.md) - * [Runtime dialect](explanations/RTDialect.md) - * [SDFG dialect](explanations/SDFGDialect.md) -* [Call FHE circuits from other languages](explanations/call_from_other_language.md) diff --git a/docs/get-started/limitations.md b/docs/get-started/limitations.md deleted file mode 100644 index 3b2ebc4800..0000000000 --- a/docs/get-started/limitations.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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. diff --git a/docs/get-started/quick_overview.md b/docs/get-started/quick_overview.md new file mode 100644 index 0000000000..03580b35ec --- /dev/null +++ b/docs/get-started/quick_overview.md @@ -0,0 +1,62 @@ +# Quick overview + +In this document, we give a quick overview of the philosophy behind Concrete. + +## Functions + +### Available FHE-friendly functions + +Concrete is a compiler, which aims to turn Python code into its FHE equivalent, in a process which is +called the FHE compilation. The best efforts were made to simplify the process: in particular, +exceptions apart, the same functions than the Python users are used to use are available. More complete +list of available functions is given [in the reference section](../dev/compatibility.md). + +### Levelled vs non-levelled operations + +Basically, in the compiled circuit, there will be two kind of operations: +- levelled operations, which are the additions, subtractions or multiplications by a constant; these +operations are also called the linear operations +- table lookup (TLU) operations, which are used to do anything which is not linear. + +TLU operations are essential to be able to compile complex functions. We explain their use in +different sections of the documentation: [direct TLU use](../core-features/table_lookups.md) or +[internal use to replace some non-linear functions](../core-features/non_linear_operations.md). We have +tools in Concrete to replace univariate or multivariate non-linear functions (ie, functions of one +or more inputs) by TLU. + +TLU are more costly that levelled operations, so we also explain how to limit their impact. + +Remark that matrix multiplication (aka Gemm -- General Matrix multiplication) and convolutions are +levelled operations, since they imply only additions and multiplications by constant. + +### Conditional branches and loops + +Functions can't use conditional branches or non-constant-size loops, +unless [modules](../compilation/composing_functions_with_modules.md) are used. However, +control flow statements with constant values are allowed, for example, +`for i in range(SOME_CONSTANT)`, `if os.environ.get("SOME_FEATURE") == "ON":`. + +## Data + +### Integers + +In Concrete, everything needs to be an integer. Users needing floats can quantize to integers before +encryption, operate on integers and dequantize to floats after decryption: all of this is done for +the user in Concrete ML. However, 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)`. + +### Scalars and tensors + +Functions can use scalar and tensors. As with Python, it is prefered to use tensorization, to make +computations faster. + +### Inputs + +Inputs of a compiled function can be either encrypted or clear. Use of clear inputs is however +quite limited. Remark that constants can appear in the program +without much constraints, they are different from clear inputs which are dynamic. + +## 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.