mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-08 19:44:57 -05:00
docs: add admonitions, fixes, and nbsphinx syntax color
# Conflicts: # docs/user/advanced_examples/QuantizedLinearRegression.ipynb # docs/user/advanced_examples/QuantizedLogisticRegression.ipynb
This commit is contained in:
@@ -1,31 +1,39 @@
|
||||
# What is ConcreteFHE
|
||||
# What is **Concrete**
|
||||
|
||||
## Introduction
|
||||
|
||||
ConcreteFHE, or Concrete for short, is an open-source framework which aims to simplify the use of so-called fully homomorphic encryption (FHE) for data scientists. FHE is a new powerful cryptographic tool, which allows e.g. servers to perform computations directly on encrypted data, without needing to decrypt first. With FHE, privacy is at the center, and one can build services which ensure full privacy of the user and are the perfect equivalent of their unsecure counterpart. FHE is also a killer feature regarding data breaches: as anything done on the server is done over encrypted data, even if the server is compromised, there is in the end no leak of any kind of useful data.
|
||||
**Concrete Framework**, or **Concrete** for short, is an open-source framework which aims to simplify the use of so-called fully homomorphic encryption (FHE) for data scientists.
|
||||
|
||||
The Concrete framework is made of several parts:
|
||||
FHE is a new powerful cryptographic tool, which allows e.g. servers to perform computations directly on encrypted data, without needing to decrypt first. With FHE, privacy is at the center, and one can build services which ensure full privacy of the user and are the perfect equivalent of their unsecure counterpart.
|
||||
|
||||
FHE is also a killer feature regarding data breaches: as anything done on the server is done over encrypted data, even if the server is compromised, there is in the end no leak of any kind of useful data.
|
||||
|
||||
**Concrete** is made of several parts:
|
||||
- a library, called concrete-lib, which contains the core cryptographic API's for computing with FHE
|
||||
- a compiler, called concrete-compiler, which allows to turn an MLIR program into an FHE program, on the top of concrete-lib
|
||||
- some frontends, which convert different langages to MLIR, to finally be compiled.
|
||||
|
||||
In the first version of Concrete framework, there is a single frontend, called homomorphic numpy (or hnp), which is the equivalent of numpy. With our toolchain, a data scientist can convert a numpy program into an FHE program, without any a-priori knowledge on cryptography.
|
||||
```{important}
|
||||
In the first version of Concrete, there is a single frontend, called homomorphic numpy (or hnp), which is the equivalent of numpy. With our toolchain, a data scientist can convert a numpy program into an FHE program, without any a-priori knowledge on cryptography.
|
||||
```
|
||||
|
||||
## Organization of the documentation
|
||||
|
||||
Basically, we have divided our documentation into several parts:
|
||||
- one about basic elements, notably description of the installation, that you are currently reading
|
||||
- one dedicated to _users_ of Concrete, with tutorials, how-to's and deeper explanations
|
||||
- and finally, one dedicated to _developpers_ of Concrete, who could be internal or external contributors to the framework
|
||||
- one dedicated to _users_ of **Concrete**, with tutorials, how-to's and deeper explanations
|
||||
- and finally, one dedicated to _developpers_ of **Concrete**, who could be internal or external contributors to the framework
|
||||
|
||||
## A work in progress
|
||||
|
||||
```{note}
|
||||
Concrete is a work in progress, and is currently limited to a certain number of operators and features. In the future, there will be improvements as described in this [section](user/explanation/FUTURE_FEATURES.md).
|
||||
```
|
||||
|
||||
The main _current_ limits are:
|
||||
- Concrete is only supporting unsigned integers
|
||||
- Concrete needs the integer to be less than 7 bits (included)
|
||||
- Concrete is mostly restricted to scalars (by opposition to tensors). The only exception is the `dot` operator, which can dot a tensor of encrypted values with a tensor of constant values
|
||||
- **Concrete** is only supporting unsigned integers
|
||||
- **Concrete** needs the integer to be less than 7 bits (included)
|
||||
- **Concrete** is mostly restricted to scalars (by opposition to tensors). The only exception is the `dot` operator, which can dot a tensor of encrypted values with a tensor of constant values
|
||||
|
||||
The first two limits can be taken care of with the use of quantization, as explained a bit further in [this](user/explanation/QUANTIZATION.md) and [this](user/howto/REDUCE_NEEDED_PRECISION.md) parts of the documentation.
|
||||
|
||||
|
||||
@@ -54,6 +54,9 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
||||
# Group member variables and methods separately (not alphabetically)
|
||||
autodoc_member_order = "groupwise"
|
||||
|
||||
# -- Options for nbsphinx ----------------------------------------------------
|
||||
|
||||
nbsphinx_codecell_lexer = 'ipython3'
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Compilation Pipeline In Depth
|
||||
|
||||
## What is concretefhe?
|
||||
## What is **concretefhe**?
|
||||
|
||||
`concretefhe` is the python API of the `concrete` framework for developing homomorphic applications.
|
||||
**concretefhe** is the python API of the **Concrete** framework for developing homomorphic applications.
|
||||
One of its essential functionalities is to transform Python functions to their `MLIR` equivalent.
|
||||
Unfortunately, not all python functions can be converted due to the limits of current product (we are in the alpha stage), or sometimes due to inherent restrictions of FHE itself.
|
||||
However, one can already build interesting and impressing use cases, and more will be available in further versions of the framework.
|
||||
@@ -104,7 +104,7 @@ Tracing is also responsible for indicating whether the values in the node would
|
||||
|
||||
The goal of topological transforms is to make more functions compilable.
|
||||
|
||||
With the current version of `concrete` floating point inputs and floating point outputs are not supported.
|
||||
With the current version of **Concrete** floating point inputs and floating point outputs are not supported.
|
||||
However, if the floating points operations are intermediate operations, they can sometimes be fused into a single table lookup from integer to integer thanks to some specific transforms.
|
||||
|
||||
Let's take a closer look at the transforms we perform today.
|
||||
@@ -199,7 +199,7 @@ Assigned Data Types:
|
||||
|
||||
## MLIR conversion
|
||||
|
||||
The actual compilation will be done by the concrete compiler, which is expecting an MLIR input. The MLIR conversion goes from an operation graph to its MLIR equivalent. You can read more about it [here](./MLIR.md)
|
||||
The actual compilation will be done by the **Concrete** compiler, which is expecting an MLIR input. The MLIR conversion goes from an operation graph to its MLIR equivalent. You can read more about it [here](./MLIR.md)
|
||||
|
||||
## Example walkthrough #1
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ The simplified graph of operations with the float subgraph condensed in an `Arbi
|
||||
|
||||

|
||||
|
||||
## How is it done in concretefhe?
|
||||
## How is it done in **Concrete**?
|
||||
|
||||
The first step consists in detecting where we go from floating point computation back to integers. This allows to identify the potential terminal node of the float subgraph we are going to fuse.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# MLIR
|
||||
|
||||
MLIR is the intermediate representation used by the concrete compiler, so we need to convert the operation graph to MLIR, which will look something like the following, for a graph performing the dot between two input tensors.
|
||||
MLIR is the intermediate representation used by the **Concrete** compiler, so we need to convert the operation graph to MLIR, which will look something like the following, for a graph performing the dot between two input tensors.
|
||||
|
||||
```
|
||||
func @main(%arg0: tensor<4xi7>, %arg1: tensor<4x!HLFHE.eint<6>>) -> !HLFHE.eint<6> {
|
||||
|
||||
@@ -15,7 +15,7 @@ In this section we will go over some terms that we use throughout the project.
|
||||
|
||||
## Module structure
|
||||
|
||||
In this section, we will discuss the module structure of `concretefhe` briefly. You are encouraged to check individual `.py` files to learn more!
|
||||
In this section, we will discuss the module structure of **concretefhe** briefly. You are encouraged to check individual `.py` files to learn more!
|
||||
|
||||
- concrete
|
||||
- common: types and utilities that can be used by multiple frontends (e.g., numpy, torch)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
|
||||
# Contributing
|
||||
|
||||
There are two ways to contribute to `concretefhe`:
|
||||
```{important}
|
||||
There are two ways to contribute to **concretefhe**:
|
||||
- you can open issues to report bugs, typos and suggest ideas
|
||||
- you can ask to become an official contributor by emailing hello@zama.ai. Only approved contributors can send pull requests, so please make sure to get in touch before you do!
|
||||
```
|
||||
|
||||
Let's go over some other important things that you need to be careful about.
|
||||
|
||||
@@ -26,7 +28,7 @@ git checkout -b fix/tracing_indexing_42
|
||||
|
||||
### Conformance
|
||||
|
||||
Each commit to `concretefhe` should be comformant to the standards decided by the team. Conformance can be checked using the following commands.
|
||||
Each commit to **concretefhe** should be conformant to the standards decided by the team. Conformance can be checked using the following commands.
|
||||
|
||||
```shell
|
||||
make pcc
|
||||
@@ -75,7 +77,9 @@ To learn more about conventional commits, check [this](https://www.conventionalc
|
||||
|
||||
## Before creating pull request
|
||||
|
||||
```{important}
|
||||
We remind that only official contributors can send pull requests. To become such an official contributor, please email hello@zama.ai.
|
||||
```
|
||||
|
||||
You should rebase on top of `main` branch before you create your pull request. This is to avoid merge commits and have a clean git log. After you commit your changes to your new branch, you can use the following commands to rebase.
|
||||
|
||||
|
||||
@@ -6,15 +6,18 @@ Before you start this section, go ahead and install docker. You can follow [this
|
||||
|
||||
### Linux
|
||||
|
||||
```console
|
||||
```shell
|
||||
xhost +localhost
|
||||
```
|
||||
|
||||
### Mac OS
|
||||
|
||||
To be able to use X forwarding on Mac OS: first, you need to install xquartz. Secondly, open XQuartz.app application, and open a new terminal within XQuartz.app. Make sure in the application parameters to authorize network connections are set (currently in the Security settings); finally, in the XQuartz.app terminal, type
|
||||
To be able to use X forwarding on Mac OS:
|
||||
- Install XQuartz
|
||||
- Open XQuartz.app application, make sure in the application parameters that `authorize network connections` are set (currently in the Security settings)
|
||||
- Open a new terminal within XQuartz.app and type:
|
||||
|
||||
```console
|
||||
```shell
|
||||
xhost +127.0.0.1
|
||||
```
|
||||
|
||||
@@ -24,13 +27,13 @@ and now, the X server should be all set in docker (in the regular terminal).
|
||||
|
||||
Install Xming and use Xlaunch:
|
||||
- Multiple Windows, Display number: 0
|
||||
- Start no client
|
||||
- `Start no client`
|
||||
- **IMPORTANT**: Check `No Access Control`
|
||||
- You can save this configuration to re-launch easily, then click finish.
|
||||
|
||||
## Logging in and building the image
|
||||
|
||||
Docker image of `concretefhe` is based on another docker image provided by the compiler team. Once you have access to this repository you should be able to launch the commands to build the dev docker image with `make docker_build`.
|
||||
Docker image of **Concrete** is based on another docker image provided by the compiler team. Once you have access to this repository you should be able to launch the commands to build the dev docker image with `make docker_build`.
|
||||
|
||||
Upon joining to the team, you need to log in using the following command:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## Installing Python v3.8
|
||||
|
||||
`concretefhe` is a `Python` library. So `Python` should be installed to develop `concretefhe`. `v3.8` is the only supported version.
|
||||
**concretefhe** is a `Python` library. So `Python` should be installed to develop **concretefhe**. `v3.8` is the only supported version.
|
||||
|
||||
You can follow [this](https://realpython.com/installing-python/) guide to install it (alternatively you can google `how to install python 3.8`).
|
||||
|
||||
@@ -21,7 +21,7 @@ On Linux you can install make from your distribution's preferred package manager
|
||||
|
||||
On Mac OS you can install a more recent version of make via brew:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
# check for gmake
|
||||
which gmake
|
||||
# If you don't have it, it will error out, install gmake
|
||||
@@ -34,11 +34,13 @@ It is possible to install gmake as make, check this [StackOverflow post](https:/
|
||||
|
||||
On Windows check [this GitHub gist](https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058#make).
|
||||
|
||||
**/!\\ In the next sections, be sure to use the proper `make` tool for your system, `make`, `gmake` or other. /!\\**
|
||||
```{hint}
|
||||
In the next sections, be sure to use the proper `make` tool for your system, `make`, `gmake` or other.
|
||||
```
|
||||
|
||||
## Cloning repository
|
||||
|
||||
Now, it's time to get the source code of `concretefhe`. You can use the following command to do that.
|
||||
Now, it's time to get the source code of **concretefhe**. You can use the following command to do that.
|
||||
|
||||
```shell
|
||||
git clone https://github.com/zama-ai/concretefhe-internal.git
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
## Release Candidate cycle
|
||||
|
||||
Before settling for a final release, we go through a Release Candidate (RC) cycle. The idea is that once the code base and documentations look ready for a release you create an RC Release by opening an issue with the release template here: https://github.com/zama-ai/concretefhe-internal/issues/new?assignees=&labels=&template=release.md starting with version `vX.Y.Zrc1` and then with versions `vX.Y.Zrc2`, `vX.Y.Zrc3`...
|
||||
Before settling for a final release, we go through a Release Candidate (RC) cycle. The idea is that once the code base and documentations look ready for a release you create an RC Release by opening an issue with the release template [here](https://github.com/zama-ai/concretefhe-internal/issues/new?assignees=&labels=&template=release.md), starting with version `vX.Y.Zrc1` and then with versions `vX.Y.Zrc2`, `vX.Y.Zrc3`...
|
||||
|
||||
## Proper release
|
||||
|
||||
Once the last RC is deemed ready, open an issue with the release template using the last RC version from which you remove the `rc?` part (i.e. `v12.67.19` if your last RC version was `v12.67.19-rc4`): https://github.com/zama-ai/concretefhe-internal/issues/new?assignees=&labels=&template=release.md.
|
||||
Once the last RC is deemed ready, open an issue with the release template using the last RC version from which you remove the `rc?` part (i.e. `v12.67.19` if your last RC version was `v12.67.19-rc4`) on [github](https://github.com/zama-ai/concretefhe-internal/issues/new?assignees=&labels=&template=release.md).
|
||||
|
||||
@@ -7,7 +7,7 @@ Concrete Framework's documentation
|
||||
:caption: Basics
|
||||
|
||||
README.md
|
||||
Installing <user/howto/INSTALLING.md>
|
||||
user/howto/INSTALLING.md
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
@@ -21,7 +21,6 @@ Concrete Framework's documentation
|
||||
:maxdepth: 2
|
||||
:caption: How to
|
||||
|
||||
user/howto/INSTALLING.md
|
||||
user/howto/COMPILING_AND_EXECUTING.md
|
||||
user/howto/REDUCE_NEEDED_PRECISION.md
|
||||
user/howto/DEBUG_SUPPORT_SUBMIT_ISSUES.md
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"source": [
|
||||
"# Quantized Linear Regression\n",
|
||||
"\n",
|
||||
"Currently, **concrete** only supports unsigned integers up to 7-bits. Nevertheless, we want to evaluate a linear regression model with it. Luckily, we can make use of **quantization** to overcome this limitation!"
|
||||
"Currently, **Concrete** only supports unsigned integers up to 7-bits. Nevertheless, we want to evaluate a linear regression model with it. Luckily, we can make use of **quantization** to overcome this limitation!"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"source": [
|
||||
"# Quantized Logistic Regression\n",
|
||||
"\n",
|
||||
"Currently, **concrete** only supports unsigned integers up to 7-bits. Nevertheless, we want to evaluate a logistic regression model with it. Luckily, we can make use of **quantization** to overcome this limitation!"
|
||||
"Currently, **Concrete** only supports unsigned integers up to 7-bits. Nevertheless, we want to evaluate a logistic regression model with it. Luckily, we can make use of **quantization** to overcome this limitation!"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
# FHE and Concrete Framework Limits
|
||||
# FHE and **Concrete Framework** Limits
|
||||
|
||||
## FHE limits
|
||||
|
||||
FHE used to be an impossible thing to imagine, twenty years ago. Then, with advances due to [Craig Gentry](https://crypto.stanford.edu/craig/), this became a dream come true. And, even more recently, with several generations of new scheme, FHE became practical.
|
||||
FHE used to be an impossible thing to imagine, twenty years ago. Then, with advances due to [Craig Gentry](https://crypto.stanford.edu/craig/), this became a dream come true. And, even more recently, with several generations of new scheme, FHE became practical.
|
||||
|
||||
### Speed
|
||||
|
||||
However, one still has to consider that FHE is slow, as compared to the vanilla implementations. With the different HW pluggins that can be added to Concrete, an important speed factor can be achieved.
|
||||
However, one still has to consider that FHE is slow, as compared to the vanilla implementations. With the different HW pluggins that can be added to **Concrete**, an important speed factor can be achieved.
|
||||
|
||||
### Multiplying by constants
|
||||
|
||||
In the scheme used in the Concrete Framework, namely [TFHE](https://tfhe.github.io/tfhe/), multiplications by constants is only defined for integer constants. Notably, one can't multiply by floats. As float multiplication is very usual in the data science (think of weights of dense layers, for example), this could be a problem, but quantization is at our rescue. See [this](QUANTIZATION.md) section for more details.
|
||||
In the scheme used in the **Concrete Framework**, namely [TFHE](https://tfhe.github.io/tfhe/), multiplications by constants is only defined for integer constants. Notably, one can't multiply by floats. As float multiplication is very usual in the data science (think of weights of dense layers, for example), this could be a problem, but quantization is at our rescue. See [this](QUANTIZATION.md) section for more details.
|
||||
|
||||
### Achieving computations of not-linear functions
|
||||
|
||||
For most FHE scheme but TFHE, the application of a non-linear function is complicated and slow, if not impossible. Typically, this is a blocker, since activation functions _are_ non-linear. However, in the Concrete Framework, we use an operation called _programmable bootstrapping_ (described in this [white paper](https://whitepaper.zama.ai)), which allows to apply any table lookup: by quantizing the non-linear function, any function can thus be replaced.
|
||||
For most FHE scheme but TFHE, the application of a non-linear function is complicated and slow, if not impossible. Typically, this is a blocker, since activation functions _are_ non-linear. However, in the **Concrete Framework**, we use an operation called _programmable bootstrapping_ (described in this [white paper](https://whitepaper.zama.ai)), which allows to apply any table lookup: by quantizing the non-linear function, any function can thus be replaced.
|
||||
|
||||
## Concrete Framework limits
|
||||
## **Concrete Framework** limits
|
||||
|
||||
Since this is an early version of the product, not everything is done, to say the least. What we wanted to tackle first was the cryptographic complexities. This is why we concentrated on the cryptographic part, and let some engineering problems for later.
|
||||
Since this is an early version of the product, not everything is done, to say the least. What we wanted to tackle first was the cryptographic complexities. This is why we concentrated on the cryptographic part, and let some engineering problems for later.
|
||||
|
||||
### Limited to scalars
|
||||
|
||||
Today, the Concrete Framework is mostly limited to scalars. Notably, in our numpy frontend, we can not use [tensors](https://numpy.org/doc/stable/user/theory.broadcasting.html?highlight=vector). As explained in [this section](FUTURE_FEATURES.md), this limit will be removed in the next version.
|
||||
Today, the **Concrete Framework** is mostly limited to scalars. Notably, in our numpy frontend, we can not use [tensors](https://numpy.org/doc/stable/user/theory.broadcasting.html?highlight=vector). As explained in [this section](FUTURE_FEATURES.md), this limit will be removed in the next version.
|
||||
|
||||
### Currently executing locally
|
||||
|
||||
As of today, the execution of the FHE program is done locally. Notably, in the current version, there is no client (on which we encrypt the private data, or decrypt the returned result) or server (on which the computation is done completely over encrypted data), but a single host. As explained in [this section](FUTURE_FEATURES.md), this limit will be removed in the next version, such that the Concrete Framework can be used in production.
|
||||
As of today, the execution of the FHE program is done locally. Notably, in the current version, there is no client (on which we encrypt the private data, or decrypt the returned result) or server (on which the computation is done completely over encrypted data), but a single host. As explained in [this section](FUTURE_FEATURES.md), this limit will be removed in the next version, such that the **Concrete Framework** can be used in production.
|
||||
|
||||
### Currently slow
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# Quantization
|
||||
|
||||
From Wikipedia https://en.wikipedia.org/wiki/Quantization :
|
||||
```{note}
|
||||
from [Wikipedia](https://en.wikipedia.org/wiki/Quantization):
|
||||
|
||||
> Quantization is the process of constraining an input from a continuous or otherwise large set of values (such as the real numbers) to a discrete set (such as the integers).
|
||||
```
|
||||
|
||||
## Why is it needed?
|
||||
|
||||
@@ -14,7 +16,7 @@ The basic idea of quantization is to take a range of values represented by a _la
|
||||
|
||||
## Quantization in practice
|
||||
|
||||
To quantize a range of values on a smaller range of values, we first need to choose the data type that is going to be used. ConcreteLib, the library used in the Concrete Framework, is currently limited to 7 bits unsigned integers, so we'll use that for the example. Knowing that, for a value in the range `[min_range, max_range]`, we can compute the step of the quantization, which is `(max_range - min_range) / (2**n - 1)` where n is the number of bits, here 7, so in practice the quantization step is `step = (max_range - min_range) / 127`. This means the gap between consecutive representible values cannot be smaller than that `step` value which means there can be a substantial loss of precision. Every interval of length `step = (max_range - min_range) / 127` will be represented by a value in `[0..127]`.
|
||||
To quantize a range of values on a smaller range of values, we first need to choose the data type that is going to be used. **ConcreteLib**, the library used in the **Concrete Framework**, is currently limited to 7 bits unsigned integers, so we'll use that for the example. Knowing that, for a value in the range `[min_range, max_range]`, we can compute the step of the quantization, which is `(max_range - min_range) / (2**n - 1)` where n is the number of bits, here 7, so in practice the quantization step is `step = (max_range - min_range) / 127`. This means the gap between consecutive representible values cannot be smaller than that `step` value which means there can be a substantial loss of precision. Every interval of length `step = (max_range - min_range) / 127` will be represented by a value in `[0..127]`.
|
||||
|
||||
The IntelLabs distiller quantization documentation goes into a detailed explanation about the math to quantize values and how to keep computations consistent: [quantization algorithm documentation](https://intellabs.github.io/distiller/algo_quantization.html).
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import concrete.numpy as hnp
|
||||
|
||||
## Defining a function to compile
|
||||
|
||||
You need to have a python function that follows the [limits](../explanation/FHE_AND_FRAMEWORK_LIMITS.md) of the Concrete Framework. Here is a simple example:
|
||||
You need to have a python function that follows the [limits](../explanation/FHE_AND_FRAMEWORK_LIMITS.md) of the **Concrete Framework**. Here is a simple example:
|
||||
|
||||
```python
|
||||
def f(x, y):
|
||||
@@ -58,8 +58,10 @@ You can use `.run(...)` method of `engine` returned by `hnp.compile_numpy_functi
|
||||
0
|
||||
```
|
||||
|
||||
```{caution}
|
||||
Be careful about the inputs, though.
|
||||
If you were to run with values outside the range of the inputset, the result might not be correct.
|
||||
```
|
||||
|
||||
## Further reading
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Debugging / Support / Submitting Issues
|
||||
|
||||
First, let's not forget that this version of Concrete framework is a beta product, meaning that it is not completely polished, contains several bugs (would they be known or unknown at this time). Also, let's not forget that FHE is a highly hot topic, and notably, that it cannot be considered as a solved problem.
|
||||
First, let's not forget that this version of **Concrete** is a beta product, meaning that it is not completely polished, contains several bugs (would they be known or unknown at this time). Also, let's not forget that FHE is a highly hot topic, and notably, that it cannot be considered as a solved problem.
|
||||
|
||||
Anyway, let's list some ways to debug your problems here. If nothing seems conclusive, you can still report the issue, as explained in a later section of this page.
|
||||
|
||||
## Is it a bug by the framework or by the user?
|
||||
|
||||
If ever your numpy program fails, it may be because:
|
||||
- of bugs due to Concrete framework
|
||||
- of bugs due to **Concrete**
|
||||
- of bugs due to the user, notably who would have a bug without even considering FHE (does the function you want to compile run well with numpy?), or who would not use the framework as expected or not consider the limits of the framework.
|
||||
|
||||
For the latter kind of bugs, we encourage the user to have a look at:
|
||||
@@ -58,7 +58,7 @@ In order to simplify our work and let us reproduce your bug easily, any informat
|
||||
- the reproducibility rate you see on your side
|
||||
- any insight you might have on the bug
|
||||
- any workaround you have been able to find
|
||||
may be useful to us. Don't remember, Concrete is a project where we are open to contribution, more information at Contributing (TODO: add a link).
|
||||
may be useful to us. Don't remember, **Concrete** is a project where we are open to contribution, more information at Contributing (TODO: add a link).
|
||||
|
||||
## Submitting an issue
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# FAQ
|
||||
|
||||
## What is Concrete FHE?
|
||||
## What is **Concrete**?
|
||||
|
||||
See [here](../../README.md)
|
||||
|
||||
@@ -10,5 +10,5 @@ See [here](../../README.md)
|
||||
|
||||
## Can I contribute?
|
||||
|
||||
## What are the future features of Concrete?
|
||||
## What are the future features of **Concrete**?
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
## Docker image
|
||||
|
||||
```{note}
|
||||
Currently the project is only available as a docker image. To get the image you need to login to ghcr.io with docker.
|
||||
```
|
||||
|
||||
```shell
|
||||
docker login ghcr.io
|
||||
@@ -13,38 +15,25 @@ This command will ask for a username and a password. For username, just enter yo
|
||||
You can then either pull the latest docker image or a specific version:
|
||||
|
||||
```shell
|
||||
docker pull ghcr.io/zama-ai/concretefhe-internal:latest
|
||||
docker pull ghcr.io/zama-ai/concretefhe:latest
|
||||
# or
|
||||
docker pull ghcr.io/zama-ai/concretefhe-internal:v0.1.0
|
||||
docker pull ghcr.io/zama-ai/concretefhe:v0.1.0
|
||||
```
|
||||
|
||||
You can then use this image with the following command:
|
||||
|
||||
```shell
|
||||
# Without local volume:
|
||||
docker run --rm -it -p 8888:8888 ghcr.io/zama-ai/concretefhe-internal:v0.1.0
|
||||
docker run --rm -it -p 8888:8888 ghcr.io/zama-ai/concretefhe:v0.1.0
|
||||
|
||||
# With local volume to save notebooks on host:
|
||||
docker run --rm -it -p 8888:8888 -v /host/path:/data ghcr.io/zama-ai/concretefhe-internal:v0.1.0
|
||||
docker run --rm -it -p 8888:8888 -v /host/path:/data ghcr.io/zama-ai/concretefhe:v0.1.0
|
||||
```
|
||||
|
||||
This will launch a concretefhe enabled jupyter server in the docker, that you can access from your browser.
|
||||
This will launch a **Concrete** enabled jupyter server in the docker, that you can access from your browser.
|
||||
|
||||
Alternatively you can just open a shell in the docker:
|
||||
|
||||
```shell
|
||||
docker run --rm -it ghcr.io/zama-ai/concretefhe-internal:v0.1.0 /bin/bash
|
||||
|
||||
root@e2d6c00e2f3d:/data# python3
|
||||
Python 3.8.10 (default, Jun 2 2021, 10:49:15)
|
||||
[GCC 9.4.0] on linux
|
||||
Type "help", "copyright", "credits" or "license" for more information.
|
||||
>>> import concrete.numpy as hnp
|
||||
>>> dir(hnp)
|
||||
['ClearScalar', 'ClearTensor', 'CompilationArtifacts', 'CompilationConfiguration', 'EncryptedScalar', 'EncryptedTensor', 'Float', 'Float32', 'Float64', 'Integer', 'LookupTable', 'ScalarValue', 'SignedInteger', 'TensorValue', 'UnsignedInteger', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'compile', 'compile_numpy_function', 'compile_numpy_function_into_op_graph', 'draw_graph', 'get_printable_graph', 'np_dtypes_helpers', 'trace_numpy_function', 'tracing']
|
||||
>>>
|
||||
docker run --rm -it ghcr.io/zama-ai/concretefhe:v0.1.0 /bin/bash
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user