Concrete
WebsiteLibrariesProducts & ServicesDevelopersSupport
1.0
1.0
  • What is Concrete?
  • Getting Started
    • Installation
    • Quick Start
    • Compatibility
    • Exactness
    • Performance
  • Tutorials
    • Decorator
    • Formatting
    • Tagging
    • Extensions
    • Table Lookups
    • Rounded Table Lookups
    • Floating Points
    • Simulation
    • Direct Circuits
    • Key Value Database
  • How To
    • Configure
    • Manage Keys
    • Deploy
    • Debug
  • Developer
    • Contribute
    • Terminology and Structure
    • Compilation
    • Fusing
Powered by GitBook

Libraries

  • TFHE-rs
  • Concrete
  • Concrete ML
  • fhEVM

Developers

  • Blog
  • Documentation
  • Github
  • FHE resources

Company

  • About
  • Introduction to FHE
  • Media
  • Careers
On this page

Was this helpful?

Export as PDF
  1. How To

Configure

Concrete can be customized using Configurations:

from concrete import fhe
import numpy as np

configuration = fhe.Configuration(p_error=0.01, dataflow_parallelize=True)

@fhe.compiler({"x": "encrypted"})
def f(x):
    return x + 42

inputset = range(10)
circuit = f.compile(inputset, configuration=configuration)

You can overwrite individual options as kwargs to the compile method:

from concrete import fhe
import numpy as np

@fhe.compiler({"x": "encrypted"})
def f(x):
    return x + 42

inputset = range(10)
circuit = f.compile(inputset, p_error=0.01, dataflow_parallelize=True)

Or you can combine both:

from concrete import fhe
import numpy as np

configuration = fhe.Configuration(p_error=0.01)

@fhe.compiler({"x": "encrypted"})
def f(x):
    return x + 42

inputset = range(10)
circuit = f.compile(inputset, configuration=configuration, loop_parallelize=True)

Additional kwarg to compile functions take higher precedence. So if you set the option in both configuration and compile methods, the value in the compile method will be used.

Options

  • show_graph: Optional[bool] = None

    • Whether to print computation graph during compilation. True means always print, False means never print, None means print depending on verbose configuration below.

  • show_mlir: Optional[bool] = None

    • Whether to print MLIR during compilation. True means always print, False means never print, None means print depending on verbose configuration below.

  • show_optimizer: Optional[bool] = None

    • Whether to print optimizer output during compilation. True means always print, False means never print, None means print depending on verbose configuration below.

  • verbose: bool = False

    • Whether to print details related to compilation.

  • dump_artifacts_on_unexpected_failures: bool = True

    • Whether to export debugging artifacts automatically on compilation failures.

  • auto_adjust_rounders: bool = False

    • Whether to adjust rounders automatically.

  • p_error: Optional[float] = None

  • global_p_error: Optional[float] = None

  • single_precision: bool = True

    • Whether to use single precision for the whole circuit.

  • jit: bool = False

    • Whether to use JIT compilation.

  • loop_parallelize: bool = True

    • Whether to enable loop parallelization in the compiler.

  • dataflow_parallelize: bool = False

    • Whether to enable dataflow parallelization in the compiler.

  • auto_parallelize: bool = False

    • Whether to enable auto parallelization in the compiler.

  • enable_unsafe_features: bool = False

    • Whether to enable unsafe features.

  • use_insecure_key_cache: bool = False (Unsafe)

    • Whether to use the insecure key cache.

  • insecure_key_cache_location: Optional[Union[Path, str]] = None

    • Location of insecure key cache.

PreviousKey Value DatabaseNextManage Keys

Last updated 2 years ago

Was this helpful?

Error probability for individual table lookups. If set, all table lookups will have the probability of a non-exact result smaller than the set value. See to learn more.

Global error probability for the whole circuit. If set, the whole circuit will have the probability of a non-exact result smaller than the set value. See to learn more.

Exactness
Exactness