diff --git a/ci/scripts/make_apidocs.sh b/ci/scripts/make_apidocs.sh index dd2791bcb4..378fc6879b 100755 --- a/ci/scripts/make_apidocs.sh +++ b/ci/scripts/make_apidocs.sh @@ -31,20 +31,6 @@ pip install lazydocs .venvtrash/bin/lazydocs --output-path="../docs/dev/api" --overview-file="README.md" --src-base-url="../../" --no-watermark concrete cd - -# Add the files in the summary -FILES=$(cd docs && find dev/api -name "*.md") - -TMP_FILE=$(mktemp /tmp/apidocs.XXXXXX) -rm -rf "$TMP_FILE" -touch "$TMP_FILE" - -for f in $FILES -do - filename=$(echo "$f" | rev | cut -d '/' -f 1 | rev) - - echo " * [$filename]($f)" >> "$TMP_FILE" -done - rm -rf "$FRESH_DIRECTORY" # New files? diff --git a/docs/dev/api/README.md b/docs/dev/api/README.md index 94f3f65878..eb9bcfe741 100644 --- a/docs/dev/api/README.md +++ b/docs/dev/api/README.md @@ -4,37 +4,13 @@ ## Modules -- [`concrete.compiler`](./concrete.compiler.md): Compiler submodule. -- [`concrete.compiler.client_parameters`](./concrete.compiler.client_parameters.md): Client parameters. -- [`concrete.compiler.client_support`](./concrete.compiler.client_support.md): Client support. -- [`concrete.compiler.compilation_context`](./concrete.compiler.compilation_context.md): CompilationContext. -- [`concrete.compiler.compilation_feedback`](./concrete.compiler.compilation_feedback.md): Compilation feedback. -- [`concrete.compiler.compilation_options`](./concrete.compiler.compilation_options.md): CompilationOptions. -- [`concrete.compiler.evaluation_keys`](./concrete.compiler.evaluation_keys.md): EvaluationKeys. -- [`concrete.compiler.key_set`](./concrete.compiler.key_set.md): KeySet. -- [`concrete.compiler.key_set_cache`](./concrete.compiler.key_set_cache.md): KeySetCache. -- [`concrete.compiler.lambda_argument`](./concrete.compiler.lambda_argument.md): LambdaArgument. -- [`concrete.compiler.library_compilation_result`](./concrete.compiler.library_compilation_result.md): LibraryCompilationResult. -- [`concrete.compiler.library_lambda`](./concrete.compiler.library_lambda.md): LibraryLambda. -- [`concrete.compiler.library_support`](./concrete.compiler.library_support.md): LibrarySupport. -- [`concrete.compiler.parameter`](./concrete.compiler.parameter.md): Parameter. -- [`concrete.compiler.public_arguments`](./concrete.compiler.public_arguments.md): PublicArguments. -- [`concrete.compiler.public_result`](./concrete.compiler.public_result.md): PublicResult. -- [`concrete.compiler.server_circuit`](./concrete.compiler.server_circuit.md): ServerCircuit. -- [`concrete.compiler.server_program`](./concrete.compiler.server_program.md): ServerProgram. -- [`concrete.compiler.simulated_value_decrypter`](./concrete.compiler.simulated_value_decrypter.md): SimulatedValueDecrypter. -- [`concrete.compiler.simulated_value_exporter`](./concrete.compiler.simulated_value_exporter.md): SimulatedValueExporter. -- [`concrete.compiler.utils`](./concrete.compiler.utils.md): Common utils for the compiler submodule. -- [`concrete.compiler.value`](./concrete.compiler.value.md): Value. -- [`concrete.compiler.value_decrypter`](./concrete.compiler.value_decrypter.md): ValueDecrypter. -- [`concrete.compiler.value_exporter`](./concrete.compiler.value_exporter.md): ValueExporter. -- [`concrete.compiler.wrapper`](./concrete.compiler.wrapper.md): Wrapper for native Cpp objects. - [`concrete.fhe`](./concrete.fhe.md): Concrete. - [`concrete.fhe.compilation`](./concrete.fhe.compilation.md): Glue the compilation process together. - [`concrete.fhe.compilation.artifacts`](./concrete.fhe.compilation.artifacts.md): Declaration of `DebugArtifacts` class. - [`concrete.fhe.compilation.circuit`](./concrete.fhe.compilation.circuit.md): Declaration of `Circuit` class. - [`concrete.fhe.compilation.client`](./concrete.fhe.compilation.client.md): Declaration of `Client` class. - [`concrete.fhe.compilation.compiler`](./concrete.fhe.compilation.compiler.md): Declaration of `Compiler` class. +- [`concrete.fhe.compilation.composition`](./concrete.fhe.compilation.composition.md): Declaration of classes related to composition. - [`concrete.fhe.compilation.configuration`](./concrete.fhe.compilation.configuration.md): Declaration of `Configuration` class. - [`concrete.fhe.compilation.decorators`](./concrete.fhe.compilation.decorators.md): Declaration of `circuit` and `compiler` decorators. - [`concrete.fhe.compilation.keys`](./concrete.fhe.compilation.keys.md): Declaration of `Keys` class. @@ -73,6 +49,7 @@ - [`concrete.fhe.mlir.converter`](./concrete.fhe.mlir.converter.md): Declaration of `Converter` class. - [`concrete.fhe.mlir.processors`](./concrete.fhe.mlir.processors.md): All graph processors. - [`concrete.fhe.mlir.processors.assign_bit_widths`](./concrete.fhe.mlir.processors.assign_bit_widths.md): Declaration of `AssignBitWidths` graph processor. +- [`concrete.fhe.mlir.processors.assign_node_ids`](./concrete.fhe.mlir.processors.assign_node_ids.md): Declaration of `AssignNodeIds` graph processor. - [`concrete.fhe.mlir.processors.check_integer_only`](./concrete.fhe.mlir.processors.check_integer_only.md): Declaration of `CheckIntegerOnly` graph processor. - [`concrete.fhe.mlir.processors.process_rounding`](./concrete.fhe.mlir.processors.process_rounding.md): Declaration of `ProcessRounding` graph processor. - [`concrete.fhe.mlir.utils`](./concrete.fhe.mlir.utils.md): Declaration of various functions and constants related to MLIR conversion. @@ -82,6 +59,10 @@ - [`concrete.fhe.representation.node`](./concrete.fhe.representation.node.md): Declaration of `Node` class. - [`concrete.fhe.representation.operation`](./concrete.fhe.representation.operation.md): Declaration of `Operation` enum. - [`concrete.fhe.representation.utils`](./concrete.fhe.representation.utils.md): Declaration of various functions and constants related to representation of computation. +- [`concrete.fhe.tfhers`](./concrete.fhe.tfhers.md): tfhers module to represent, and compute on tfhers integer values. +- [`concrete.fhe.tfhers.dtypes`](./concrete.fhe.tfhers.dtypes.md): Declaration of `TFHERSIntegerType` class. +- [`concrete.fhe.tfhers.tracing`](./concrete.fhe.tfhers.tracing.md): Tracing of tfhers operations. +- [`concrete.fhe.tfhers.values`](./concrete.fhe.tfhers.values.md): Declaration of `TFHERSInteger` which wraps values as being of tfhers types. - [`concrete.fhe.tracing`](./concrete.fhe.tracing.md): Provide `function` to `computation graph` functionality. - [`concrete.fhe.tracing.tracer`](./concrete.fhe.tracing.tracer.md): Declaration of `Tracer` class. - [`concrete.fhe.tracing.typing`](./concrete.fhe.tracing.typing.md): Declaration of type annotation. @@ -89,7 +70,32 @@ - [`concrete.fhe.values.scalar`](./concrete.fhe.values.scalar.md): Declaration of `ClearScalar` and `EncryptedScalar` wrappers. - [`concrete.fhe.values.tensor`](./concrete.fhe.values.tensor.md): Declaration of `ClearTensor` and `EncryptedTensor` wrappers. - [`concrete.fhe.values.value_description`](./concrete.fhe.values.value_description.md): Declaration of `ValueDescription` class. -- [`concrete.fhe.version`](./concrete.fhe.version.md) +- [`concrete.fhe.version`](./concrete.fhe.version.md): Version of the project, which is updated automatically by the CI right before releasing. +- [`concrete.compiler`](./concrete.compiler.md): Compiler submodule. +- [`concrete.compiler.client_parameters`](./concrete.compiler.client_parameters.md): Client parameters. +- [`concrete.compiler.client_support`](./concrete.compiler.client_support.md): Client support. +- [`concrete.compiler.compilation_context`](./concrete.compiler.compilation_context.md): CompilationContext. +- [`concrete.compiler.compilation_feedback`](./concrete.compiler.compilation_feedback.md): Compilation feedback. +- [`concrete.compiler.compilation_options`](./concrete.compiler.compilation_options.md): CompilationOptions. +- [`concrete.compiler.evaluation_keys`](./concrete.compiler.evaluation_keys.md): EvaluationKeys. +- [`concrete.compiler.key_set`](./concrete.compiler.key_set.md): KeySet. +- [`concrete.compiler.key_set_cache`](./concrete.compiler.key_set_cache.md): KeySetCache. +- [`concrete.compiler.lambda_argument`](./concrete.compiler.lambda_argument.md): LambdaArgument. +- [`concrete.compiler.library_compilation_result`](./concrete.compiler.library_compilation_result.md): LibraryCompilationResult. +- [`concrete.compiler.library_lambda`](./concrete.compiler.library_lambda.md): LibraryLambda. +- [`concrete.compiler.library_support`](./concrete.compiler.library_support.md): LibrarySupport. +- [`concrete.compiler.parameter`](./concrete.compiler.parameter.md): Parameter. +- [`concrete.compiler.public_arguments`](./concrete.compiler.public_arguments.md): PublicArguments. +- [`concrete.compiler.public_result`](./concrete.compiler.public_result.md): PublicResult. +- [`concrete.compiler.server_circuit`](./concrete.compiler.server_circuit.md): ServerCircuit. +- [`concrete.compiler.server_program`](./concrete.compiler.server_program.md): ServerProgram. +- [`concrete.compiler.simulated_value_decrypter`](./concrete.compiler.simulated_value_decrypter.md): SimulatedValueDecrypter. +- [`concrete.compiler.simulated_value_exporter`](./concrete.compiler.simulated_value_exporter.md): SimulatedValueExporter. +- [`concrete.compiler.utils`](./concrete.compiler.utils.md): Common utils for the compiler submodule. +- [`concrete.compiler.value`](./concrete.compiler.value.md): Value. +- [`concrete.compiler.value_decrypter`](./concrete.compiler.value_decrypter.md): ValueDecrypter. +- [`concrete.compiler.value_exporter`](./concrete.compiler.value_exporter.md): ValueExporter. +- [`concrete.compiler.wrapper`](./concrete.compiler.wrapper.md): Wrapper for native Cpp objects. - [`concrete.lang`](./concrete.lang.md): Concretelang python module - [`concrete.lang.dialects`](./concrete.lang.dialects.md) - [`concrete.lang.dialects.fhe`](./concrete.lang.dialects.fhe.md): FHE dialect module @@ -98,30 +104,6 @@ ## Classes -- [`client_parameters.ClientParameters`](./concrete.compiler.client_parameters.md): ClientParameters are public parameters used for key generation. -- [`client_support.ClientSupport`](./concrete.compiler.client_support.md): Client interface for doing key generation and encryption. -- [`compilation_context.CompilationContext`](./concrete.compiler.compilation_context.md): Support class for compilation context. -- [`compilation_feedback.CircuitCompilationFeedback`](./concrete.compiler.compilation_feedback.md): CircuitCompilationFeedback is a set of hint computed by the compiler engine for a circuit. -- [`compilation_feedback.ProgramCompilationFeedback`](./concrete.compiler.compilation_feedback.md): CompilationFeedback is a set of hint computed by the compiler engine. -- [`compilation_options.CompilationOptions`](./concrete.compiler.compilation_options.md): CompilationOptions holds different flags and options of the compilation process. -- [`evaluation_keys.EvaluationKeys`](./concrete.compiler.evaluation_keys.md): EvaluationKeys required for execution. -- [`key_set.KeySet`](./concrete.compiler.key_set.md): KeySet stores the different keys required for an encrypted computation. -- [`key_set_cache.KeySetCache`](./concrete.compiler.key_set_cache.md): KeySetCache is a cache for KeySet to avoid generating similar keys multiple times. -- [`lambda_argument.LambdaArgument`](./concrete.compiler.lambda_argument.md): LambdaArgument holds scalar or tensor values. -- [`library_compilation_result.LibraryCompilationResult`](./concrete.compiler.library_compilation_result.md): LibraryCompilationResult holds the result of the library compilation. -- [`library_lambda.LibraryLambda`](./concrete.compiler.library_lambda.md): LibraryLambda reference a compiled library and can be ran using LibrarySupport. -- [`library_support.LibrarySupport`](./concrete.compiler.library_support.md): Support class for library compilation and execution. -- [`parameter.Parameter`](./concrete.compiler.parameter.md): An FHE parameter. -- [`public_arguments.PublicArguments`](./concrete.compiler.public_arguments.md): PublicArguments holds encrypted and plain arguments, as well as public materials. -- [`public_result.PublicResult`](./concrete.compiler.public_result.md): PublicResult holds the result of an encrypted execution and can be decrypted using ClientSupport. -- [`server_circuit.ServerCircuit`](./concrete.compiler.server_circuit.md): ServerCircuit references a circuit that can be called for execution and simulation. -- [`server_program.ServerProgram`](./concrete.compiler.server_program.md): ServerProgram references compiled circuit objects. -- [`simulated_value_decrypter.SimulatedValueDecrypter`](./concrete.compiler.simulated_value_decrypter.md): A helper class to decrypt `Value`s. -- [`simulated_value_exporter.SimulatedValueExporter`](./concrete.compiler.simulated_value_exporter.md): A helper class to create `Value`s. -- [`value.Value`](./concrete.compiler.value.md): An encrypted/clear value which can be scalar/tensor. -- [`value_decrypter.ValueDecrypter`](./concrete.compiler.value_decrypter.md): A helper class to decrypt `Value`s. -- [`value_exporter.ValueExporter`](./concrete.compiler.value_exporter.md): A helper class to create `Value`s. -- [`wrapper.WrapperCpp`](./concrete.compiler.wrapper.md): Wrapper base class for native Cpp objects. - [`artifacts.DebugArtifacts`](./concrete.fhe.compilation.artifacts.md): DebugArtifacts class, to export information about the compilation process for single function. - [`artifacts.FunctionDebugArtifacts`](./concrete.fhe.compilation.artifacts.md): An object containing debug artifacts for a certain function in an fhe module. - [`artifacts.ModuleDebugArtifacts`](./concrete.fhe.compilation.artifacts.md): An object containing debug artifacts for an fhe module. @@ -129,6 +111,9 @@ - [`client.Client`](./concrete.fhe.compilation.client.md): Client class, which can be used to manage keys, encrypt arguments and decrypt results. - [`compiler.Compiler`](./concrete.fhe.compilation.compiler.md): Compiler class, to glue the compilation pipeline. - [`compiler.EncryptionStatus`](./concrete.fhe.compilation.compiler.md): EncryptionStatus enum, to represent encryption status of parameters. +- [`composition.CompositionClause`](./concrete.fhe.compilation.composition.md): A raw composition clause. +- [`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. @@ -144,9 +129,19 @@ - [`module.FheFunction`](./concrete.fhe.compilation.module.md): Fhe function class, allowing to run or simulate one function of an fhe module. - [`module.FheModule`](./concrete.fhe.compilation.module.md): Fhe module class, to combine computation graphs, mlir, runtime objects into a single object. - [`module.SimulationRt`](./concrete.fhe.compilation.module.md): Runtime object class for simulation. +- [`module_compiler.AllComposable`](./concrete.fhe.compilation.module_compiler.md): Composition policy that allows to forward any output of the module to any of its input. +- [`module_compiler.AllInputs`](./concrete.fhe.compilation.module_compiler.md): All the inputs of a given function of a module. +- [`module_compiler.AllOutputs`](./concrete.fhe.compilation.module_compiler.md): All the outputs of a given function of a module. - [`module_compiler.DebugManager`](./concrete.fhe.compilation.module_compiler.md): A debug manager, allowing streamlined debugging. - [`module_compiler.FunctionDef`](./concrete.fhe.compilation.module_compiler.md): An object representing the definition of a function as used in an fhe module. +- [`module_compiler.Input`](./concrete.fhe.compilation.module_compiler.md): The input of a given function of a module. - [`module_compiler.ModuleCompiler`](./concrete.fhe.compilation.module_compiler.md): Compiler class for multiple functions, to glue the compilation pipeline. +- [`module_compiler.NotComposable`](./concrete.fhe.compilation.module_compiler.md): Composition policy that does not allow the forwarding of any output to any input. +- [`module_compiler.Output`](./concrete.fhe.compilation.module_compiler.md): The output of a given function of a module. +- [`module_compiler.Wire`](./concrete.fhe.compilation.module_compiler.md): A forwarding rule between an output and an input. +- [`module_compiler.WireInput`](./concrete.fhe.compilation.module_compiler.md): A protocol for wire inputs. +- [`module_compiler.WireOutput`](./concrete.fhe.compilation.module_compiler.md): A protocol for wire outputs. +- [`module_compiler.Wired`](./concrete.fhe.compilation.module_compiler.md): Composition policy which allows the forwarding of certain outputs to certain inputs. - [`server.Server`](./concrete.fhe.compilation.server.md): Server class, which can be used to perform homomorphic computation. - [`specs.ClientSpecs`](./concrete.fhe.compilation.specs.md): ClientSpecs class, to create Client objects. - [`value.Value`](./concrete.fhe.compilation.value.md): Value class, to store scalar or tensor values which can be encrypted or clear. @@ -155,7 +150,7 @@ - [`integer.Integer`](./concrete.fhe.dtypes.integer.md): Integer class, to represent integers. - [`bits.Bits`](./concrete.fhe.extensions.bits.md): Bits class, to provide indexing into the bits of integers. - [`round_bit_pattern.Adjusting`](./concrete.fhe.extensions.round_bit_pattern.md): Adjusting class, to be used as early stop signal during adjustment. -- [`round_bit_pattern.AutoRounder`](./concrete.fhe.extensions.round_bit_pattern.md): AutoRounder class, to optimize for number of msbs to keep druing round bit pattern operation. +- [`round_bit_pattern.AutoRounder`](./concrete.fhe.extensions.round_bit_pattern.md): AutoRounder class, to optimize for number of msbs to keep during round bit pattern operation. - [`table.LookupTable`](./concrete.fhe.extensions.table.md): LookupTable class, to provide a way to do direct table lookups. - [`truncate_bit_pattern.Adjusting`](./concrete.fhe.extensions.truncate_bit_pattern.md): Adjusting class, to be used as early stop signal during adjustment. - [`truncate_bit_pattern.AutoTruncator`](./concrete.fhe.extensions.truncate_bit_pattern.md): AutoTruncator class, to optimize for the number of msbs to keep during truncate operation. @@ -165,6 +160,7 @@ - [`converter.Converter`](./concrete.fhe.mlir.converter.md): Converter class, to convert a computation graph to MLIR. - [`assign_bit_widths.AdditionalConstraints`](./concrete.fhe.mlir.processors.assign_bit_widths.md): AdditionalConstraints class to customize bit-width assignment step easily. - [`assign_bit_widths.AssignBitWidths`](./concrete.fhe.mlir.processors.assign_bit_widths.md): AssignBitWidths graph processor, to assign proper bit-widths to be compatible with FHE. +- [`assign_node_ids.AssignNodeIds`](./concrete.fhe.mlir.processors.assign_node_ids.md) to node properties. - [`check_integer_only.CheckIntegerOnly`](./concrete.fhe.mlir.processors.check_integer_only.md): CheckIntegerOnly graph processor, to make sure the graph only contains integer nodes. - [`process_rounding.ProcessRounding`](./concrete.fhe.mlir.processors.process_rounding.md): ProcessRounding graph processor, to analyze rounding and support regular operations on it. - [`utils.Comparison`](./concrete.fhe.mlir.utils.md): Comparison enum, to store the result comparison in 2-bits as there are three possible outcomes. @@ -178,6 +174,8 @@ - [`graph.MultiGraphProcessor`](./concrete.fhe.representation.graph.md): MultiGraphProcessor base class, to define the API for a multiple graph processing pipeline. - [`node.Node`](./concrete.fhe.representation.node.md): Node class, to represent computation in a computation graph. - [`operation.Operation`](./concrete.fhe.representation.operation.md): Operation enum, to distinguish nodes within a computation graph. +- [`dtypes.TFHERSIntegerType`](./concrete.fhe.tfhers.dtypes.md) to represent tfhers integer types. +- [`values.TFHERSInteger`](./concrete.fhe.tfhers.values.md) into typed values, using tfhers types. - [`tracer.Annotation`](./concrete.fhe.tracing.tracer.md): Base annotation for direct definition. - [`tracer.ScalarAnnotation`](./concrete.fhe.tracing.tracer.md): Base scalar annotation for direct definition. - [`tracer.TensorAnnotation`](./concrete.fhe.tracing.tracer.md): Base tensor annotation for direct definition. @@ -314,13 +312,33 @@ - [`typing.uint8`](./concrete.fhe.tracing.typing.md): Scalar uint8 annotation. - [`typing.uint9`](./concrete.fhe.tracing.typing.md): Scalar uint9 annotation. - [`value_description.ValueDescription`](./concrete.fhe.values.value_description.md): ValueDescription class, to combine data type, shape, and encryption status into a single object. +- [`client_parameters.ClientParameters`](./concrete.compiler.client_parameters.md): ClientParameters are public parameters used for key generation. +- [`client_support.ClientSupport`](./concrete.compiler.client_support.md): Client interface for doing key generation and encryption. +- [`compilation_context.CompilationContext`](./concrete.compiler.compilation_context.md): Support class for compilation context. +- [`compilation_feedback.CircuitCompilationFeedback`](./concrete.compiler.compilation_feedback.md): CircuitCompilationFeedback is a set of hint computed by the compiler engine for a circuit. +- [`compilation_feedback.ProgramCompilationFeedback`](./concrete.compiler.compilation_feedback.md): CompilationFeedback is a set of hint computed by the compiler engine. +- [`compilation_options.CompilationOptions`](./concrete.compiler.compilation_options.md): CompilationOptions holds different flags and options of the compilation process. +- [`evaluation_keys.EvaluationKeys`](./concrete.compiler.evaluation_keys.md): EvaluationKeys required for execution. +- [`key_set.KeySet`](./concrete.compiler.key_set.md): KeySet stores the different keys required for an encrypted computation. +- [`key_set_cache.KeySetCache`](./concrete.compiler.key_set_cache.md): KeySetCache is a cache for KeySet to avoid generating similar keys multiple times. +- [`lambda_argument.LambdaArgument`](./concrete.compiler.lambda_argument.md): LambdaArgument holds scalar or tensor values. +- [`library_compilation_result.LibraryCompilationResult`](./concrete.compiler.library_compilation_result.md): LibraryCompilationResult holds the result of the library compilation. +- [`library_lambda.LibraryLambda`](./concrete.compiler.library_lambda.md): LibraryLambda reference a compiled library and can be ran using LibrarySupport. +- [`library_support.LibrarySupport`](./concrete.compiler.library_support.md): Support class for library compilation and execution. +- [`parameter.Parameter`](./concrete.compiler.parameter.md): An FHE parameter. +- [`public_arguments.PublicArguments`](./concrete.compiler.public_arguments.md): PublicArguments holds encrypted and plain arguments, as well as public materials. +- [`public_result.PublicResult`](./concrete.compiler.public_result.md): PublicResult holds the result of an encrypted execution and can be decrypted using ClientSupport. +- [`server_circuit.ServerCircuit`](./concrete.compiler.server_circuit.md): ServerCircuit references a circuit that can be called for execution and simulation. +- [`server_program.ServerProgram`](./concrete.compiler.server_program.md): ServerProgram references compiled circuit objects. +- [`simulated_value_decrypter.SimulatedValueDecrypter`](./concrete.compiler.simulated_value_decrypter.md): A helper class to decrypt `Value`s. +- [`simulated_value_exporter.SimulatedValueExporter`](./concrete.compiler.simulated_value_exporter.md): A helper class to create `Value`s. +- [`value.Value`](./concrete.compiler.value.md): An encrypted/clear value which can be scalar/tensor. +- [`value_decrypter.ValueDecrypter`](./concrete.compiler.value_decrypter.md): A helper class to decrypt `Value`s. +- [`value_exporter.ValueExporter`](./concrete.compiler.value_exporter.md): A helper class to create `Value`s. +- [`wrapper.WrapperCpp`](./concrete.compiler.wrapper.md): Wrapper base class for native Cpp objects. ## Functions -- [`compiler.init_dfr`](./concrete.compiler.md): Initialize dataflow parallelization. -- [`compiler.round_trip`](./concrete.compiler.md): Parse the MLIR input, then return it back. -- [`compilation_feedback.tag_from_location`](./concrete.compiler.compilation_feedback.md): Extract tag of the operation from its location. -- [`utils.lookup_runtime_lib`](./concrete.compiler.utils.md): Try to find the absolute path to the runtime library. - [`decorators.circuit`](./concrete.fhe.compilation.decorators.md): Provide a direct interface for compilation of single circuit programs. - [`decorators.compiler`](./concrete.fhe.compilation.decorators.md): Provide an easy interface for the compilation of single-circuit programs. - [`decorators.function`](./concrete.fhe.compilation.decorators.md): Provide an easy interface to define a function within an fhe module. @@ -365,6 +383,8 @@ - [`utils.flood_replace_none_values`](./concrete.fhe.mlir.utils.md): Use flooding algorithm to replace `None` values. - [`utils.format_constant`](./concrete.fhe.representation.utils.md): Get the textual representation of a constant. - [`utils.format_indexing_element`](./concrete.fhe.representation.utils.md): Format an indexing element. +- [`tracing.from_native`](./concrete.fhe.tfhers.tracing.md): Convert a Concrete integer to the tfhers representation. +- [`tracing.to_native`](./concrete.fhe.tfhers.tracing.md): Convert a tfhers integer to the Concrete representation. - [`scalar.clear_scalar_builder`](./concrete.fhe.values.scalar.md): Build a clear scalar value. - [`scalar.encrypted_scalar_builder`](./concrete.fhe.values.scalar.md): Build an encrypted scalar value. - [`scalar.clear_scalar_builder`](./concrete.fhe.values.scalar.md): Build a clear scalar value. @@ -373,3 +393,7 @@ - [`tensor.encrypted_tensor_builder`](./concrete.fhe.values.tensor.md): Build an encrypted tensor value. - [`tensor.clear_tensor_builder`](./concrete.fhe.values.tensor.md): Build a clear tensor value. - [`tensor.encrypted_tensor_builder`](./concrete.fhe.values.tensor.md): Build an encrypted tensor value. +- [`compiler.init_dfr`](./concrete.compiler.md): Initialize dataflow parallelization. +- [`compiler.round_trip`](./concrete.compiler.md): Parse the MLIR input, then return it back. +- [`compilation_feedback.tag_from_location`](./concrete.compiler.compilation_feedback.md): Extract tag of the operation from its location. +- [`utils.lookup_runtime_lib`](./concrete.compiler.utils.md): Try to find the absolute path to the runtime library. diff --git a/docs/dev/api/concrete.compiler.compilation_options.md b/docs/dev/api/concrete.compiler.compilation_options.md index e8b2715c47..cecdff2d22 100644 --- a/docs/dev/api/concrete.compiler.compilation_options.md +++ b/docs/dev/api/concrete.compiler.compilation_options.md @@ -43,7 +43,34 @@ Wrap the native Cpp object. --- - + + +### method `add_composition` + +```python +add_composition(from_func: str, from_pos: int, to_func: str, to_pos: int) +``` + +Adds a composition rule. + + + +**Args:** + + - `from_func` (str): the name of the circuit the output comes from. + - `from_pos` (int): the return position of the output. + - `to_func` (str): the name of the circuit the input targets. + - `to_pos` (int): the argument position of the input. + + + +**Raises:** + + - `TypeError`: if the inputs do not have the proper type. + +--- + + ### method `force_encoding` @@ -96,7 +123,7 @@ Build a CompilationOptions. --- - + ### method `set_all_v0_parameter` @@ -148,7 +175,7 @@ Set all the V0 parameters. --- - + ### method `set_auto_parallelize` @@ -172,7 +199,7 @@ Set option for auto parallelization. --- - + ### method `set_batch_tfhe_ops` @@ -196,7 +223,7 @@ Set flag that triggers the batching of scalar TFHE operations. --- - + ### method `set_composable` @@ -204,23 +231,23 @@ Set flag that triggers the batching of scalar TFHE operations. set_composable(composable: bool) ``` -Set option for composition. +Set composable flag. **Args:** - - `composable` (bool): whether to turn it on or off + - `composable` (bool): the composable flag. **Raises:** - - `TypeError`: if the value to set is not boolean + - `TypeError`: if the inputs do not have the proper type. --- - + ### method `set_compress_evaluation_keys` @@ -244,7 +271,7 @@ Set option for compression of evaluation keys. --- - + ### method `set_compress_input_ciphertexts` @@ -268,7 +295,7 @@ Set option for compression of input ciphertexts. --- - + ### method `set_dataflow_parallelize` @@ -292,7 +319,7 @@ Set option for dataflow parallelization. --- - + ### method `set_display_optimizer_choice` @@ -316,7 +343,7 @@ Set display flag of optimizer choices. --- - + ### method `set_emit_gpu_ops` @@ -340,7 +367,31 @@ Set flag that allows gpu ops to be emitted. --- - + + +### method `set_enable_overflow_detection_in_simulation` + +```python +set_enable_overflow_detection_in_simulation(enable_overflow_detection: bool) +``` + +Enable or disable overflow detection during simulation. + + + +**Args:** + + - `enable_overflow_detection` (bool): flag to enable or disable overflow detection + + + +**Raises:** + + - `TypeError`: if the value to set is not bool + +--- + + ### method `set_enable_tlu_fusing` @@ -364,7 +415,7 @@ Enable or disable tlu fusing. --- - + ### method `set_funcname` @@ -388,7 +439,7 @@ Set entrypoint function name. --- - + ### method `set_global_p_error` @@ -413,7 +464,7 @@ Set global error probability for the full circuit. --- - + ### method `set_loop_parallelize` @@ -437,7 +488,7 @@ Set option for loop parallelization. --- - + ### method `set_optimize_concrete` @@ -461,7 +512,7 @@ Set flag to enable/disable optimization of concrete intermediate representation. --- - + ### method `set_optimizer_multi_parameter_strategy` @@ -487,7 +538,7 @@ Set the strategy of the optimizer for multi-parameter. --- - + ### method `set_optimizer_strategy` @@ -511,7 +562,7 @@ Set the strategy of the optimizer. --- - + ### method `set_p_error` @@ -536,7 +587,7 @@ Set error probability for shared by each pbs. --- - + ### method `set_print_tlu_fusing` @@ -560,7 +611,7 @@ Enable or disable printing tlu fusing. --- - + ### method `set_security_level` @@ -585,7 +636,7 @@ Set security level. --- - + ### method `set_v0_parameter` @@ -623,7 +674,7 @@ Set the basic V0 parameters. --- - + ### method `set_verify_diagnostics` @@ -647,7 +698,7 @@ Set option for diagnostics verification. --- - + ### method `simulation` diff --git a/docs/dev/api/concrete.compiler.md b/docs/dev/api/concrete.compiler.md index 7d1167c016..09e64baaca 100644 --- a/docs/dev/api/concrete.compiler.md +++ b/docs/dev/api/concrete.compiler.md @@ -80,7 +80,7 @@ init_dfr() Initialize dataflow parallelization. -It is not always required to initialize the dataflow runtime as it can be implicitly done during compilation. However, it is required in case no compilation has previously been done and the runtime is needed +It is not always required to initialize the dataflow runtime as it can be implicitely done during compilation. However, it is required in case no compilation has previously been done and the runtime is needed --- diff --git a/docs/dev/api/concrete.fhe.compilation.artifacts.md b/docs/dev/api/concrete.fhe.compilation.artifacts.md index 0d608f95e5..131b1098d7 100644 --- a/docs/dev/api/concrete.fhe.compilation.artifacts.md +++ b/docs/dev/api/concrete.fhe.compilation.artifacts.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.artifacts` Declaration of `DebugArtifacts` class. @@ -9,12 +9,12 @@ Declaration of `DebugArtifacts` class. --- - + ## class `FunctionDebugArtifacts` An object containing debug artifacts for a certain function in an fhe module. - + ### method `__init__` @@ -31,7 +31,7 @@ __init__() --- - + ### method `add_graph` @@ -50,7 +50,7 @@ Add a representation of the function being compiled. --- - + ### method `add_parameter_encryption_status` @@ -69,7 +69,7 @@ Add parameter encryption status of a parameter of the function being compiled. --- - + ### method `add_source_code` @@ -87,18 +87,18 @@ Add source code of the function being compiled. --- - + ## class `ModuleDebugArtifacts` An object containing debug artifacts for an fhe module. - + ### method `__init__` ```python __init__( - function_names: List[str], + function_names: Optional[List[str]] = None, output_directory: Union[str, Path] = PosixPath('.artifacts') ) ``` @@ -112,7 +112,7 @@ __init__( --- - + ### method `add_client_parameters` @@ -130,7 +130,7 @@ Add client parameters used. --- - + ### method `add_mlir_to_compile` @@ -147,7 +147,7 @@ Add textual representation of the resulting MLIR. --- - + ### method `export` @@ -160,12 +160,12 @@ Export the collected information to `self.output_directory`. --- - + ## class `DebugArtifacts` DebugArtifacts class, to export information about the compilation process for single function. - + ### method `__init__` @@ -194,7 +194,7 @@ Return the directory to export artifacts to. --- - + ### method `add_client_parameters` @@ -212,7 +212,7 @@ Add client parameters used. --- - + ### method `add_graph` @@ -231,7 +231,7 @@ Add a representation of the function being compiled. --- - + ### method `add_mlir_to_compile` @@ -248,7 +248,7 @@ Add textual representation of the resulting MLIR. --- - + ### method `add_parameter_encryption_status` @@ -267,7 +267,7 @@ Add parameter encryption status of a parameter of the function being compiled. --- - + ### method `add_source_code` @@ -284,7 +284,7 @@ Add source code of the function being compiled. --- - + ### method `export` diff --git a/docs/dev/api/concrete.fhe.compilation.circuit.md b/docs/dev/api/concrete.fhe.compilation.circuit.md index 35eed1a0a8..5cc05cbc96 100644 --- a/docs/dev/api/concrete.fhe.compilation.circuit.md +++ b/docs/dev/api/concrete.fhe.compilation.circuit.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.circuit` Declaration of `Circuit` class. @@ -9,12 +9,12 @@ Declaration of `Circuit` class. --- - + ## class `Circuit` Circuit class, to combine computation graph, mlir, client and server into a single object. - + ### method `__init__` @@ -23,7 +23,8 @@ __init__( graph: Graph, mlir: Module, compilation_context: CompilationContext, - configuration: Optional[Configuration] = None + configuration: Optional[Configuration] = None, + composition_rules: Optional[Iterable[CompositionRule]] = None ) ``` @@ -172,6 +173,12 @@ Get the keys of the circuit. --- +#### property memory_usage_per_location + +Get the memory usage of operations in the circuit per location. + +--- + #### property mlir Textual representation of the MLIR module. @@ -276,7 +283,7 @@ Get all statistics of the circuit. --- - + ### method `cleanup` @@ -288,7 +295,7 @@ Cleanup the temporary library output directory. --- - + ### method `decrypt` @@ -312,7 +319,7 @@ Decrypt result(s) of evaluation. --- - + ### method `draw` @@ -346,7 +353,7 @@ That this function requires the python `pygraphviz` package which itself require --- - + ### method `enable_fhe_execution` @@ -358,7 +365,7 @@ Enable FHE execution. --- - + ### method `enable_fhe_simulation` @@ -370,7 +377,7 @@ Enable FHE simulation. --- - + ### method `encrypt` @@ -394,7 +401,7 @@ Encrypt argument(s) to for evaluation. --- - + ### method `encrypt_run_decrypt` @@ -416,7 +423,7 @@ Encrypt inputs, run the circuit, and decrypt the outputs in one go. --- - + ### method `keygen` @@ -441,7 +448,7 @@ Generate keys required for homomorphic evaluation. --- - + ### method `run` @@ -465,7 +472,7 @@ Evaluate the circuit. --- - + ### method `simulate` diff --git a/docs/dev/api/concrete.fhe.compilation.client.md b/docs/dev/api/concrete.fhe.compilation.client.md index d8c0dc8c5e..a030f46fba 100644 --- a/docs/dev/api/concrete.fhe.compilation.client.md +++ b/docs/dev/api/concrete.fhe.compilation.client.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.client` Declaration of `Client` class. @@ -9,12 +9,12 @@ Declaration of `Client` class. --- - + ## class `Client` Client class, which can be used to manage keys, encrypt arguments and decrypt results. - + ### method `__init__` @@ -51,7 +51,7 @@ Get the keys for the client. --- - + ### method `decrypt` @@ -76,7 +76,7 @@ Decrypt result(s) of evaluation. --- - + ### method `encrypt` @@ -101,7 +101,7 @@ Encrypt argument(s) to for evaluation. --- - + ### method `keygen` @@ -126,7 +126,7 @@ Generate keys required for homomorphic evaluation. --- - + ### method `load` @@ -153,7 +153,7 @@ Load the client from the given path in zip format. --- - + ### method `save` diff --git a/docs/dev/api/concrete.fhe.compilation.compiler.md b/docs/dev/api/concrete.fhe.compilation.compiler.md index a7009a5678..165c53d621 100644 --- a/docs/dev/api/concrete.fhe.compilation.compiler.md +++ b/docs/dev/api/concrete.fhe.compilation.compiler.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.compiler` Declaration of `Compiler` class. @@ -9,7 +9,7 @@ Declaration of `Compiler` class. --- - + ## class `EncryptionStatus` EncryptionStatus enum, to represent encryption status of parameters. @@ -20,12 +20,12 @@ EncryptionStatus enum, to represent encryption status of parameters. --- - + ## class `Compiler` Compiler class, to glue the compilation pipeline. - + ### method `__init__` @@ -45,7 +45,7 @@ __init__( --- - + ### method `assemble` @@ -81,7 +81,7 @@ Assemble a circuit from the raw parameter values, used in direct circuit definit --- - + ### method `compile` @@ -114,7 +114,7 @@ Compile the function using an inputset. --- - + ### method `trace` diff --git a/docs/dev/api/concrete.fhe.compilation.composition.md b/docs/dev/api/concrete.fhe.compilation.composition.md new file mode 100644 index 0000000000..726bdd44dd --- /dev/null +++ b/docs/dev/api/concrete.fhe.compilation.composition.md @@ -0,0 +1,78 @@ + + + + +# module `concrete.fhe.compilation.composition` +Declaration of classes related to composition. + + + +--- + + + +## class `CompositionClause` +A raw composition clause. + + + + +--- + + + +### method `create` + +```python +create(tup: Tuple[str, int]) → CompositionClause +``` + +Create a composition clause from a tuple of a function name and a position. + + +--- + + + +## class `CompositionRule` +A raw composition rule. + + + + +--- + + + +### method `create` + +```python +create(tup: Tuple[CompositionClause, CompositionClause]) → CompositionRule +``` + +Create a composition rule from a tuple containing an output clause and an input clause. + + +--- + + + +## class `CompositionPolicy` +A protocol for composition policies. + + + + +--- + + + +### method `get_rules_iter` + +```python +get_rules_iter(funcs: List[Graph]) → Iterable[CompositionRule] +``` + +Return an iterator over composition rules. + + diff --git a/docs/dev/api/concrete.fhe.compilation.configuration.md b/docs/dev/api/concrete.fhe.compilation.configuration.md index b04510c65f..0cbc8cb1d5 100644 --- a/docs/dev/api/concrete.fhe.compilation.configuration.md +++ b/docs/dev/api/concrete.fhe.compilation.configuration.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.configuration` Declaration of `Configuration` class. @@ -14,7 +14,7 @@ Declaration of `Configuration` class. --- - + ## class `ParameterSelectionStrategy` ParameterSelectionStrategy, to set optimization strategy. @@ -25,7 +25,7 @@ ParameterSelectionStrategy, to set optimization strategy. --- - + ## class `MultiParameterStrategy` MultiParamStrategy, to set optimization strategy for multi-parameter. @@ -36,7 +36,7 @@ MultiParamStrategy, to set optimization strategy for multi-parameter. --- - + ## class `Exactness` Exactness, to specify for specific operator the implementation preference (default and local). @@ -47,12 +47,12 @@ Exactness, to specify for specific operator the implementation preference (defau --- - + ## class `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. +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. @@ -77,7 +77,7 @@ __init__( --- - + ## class `ComparisonStrategy` ComparisonStrategy, to specify implementation preference for comparisons. @@ -88,7 +88,7 @@ ComparisonStrategy, to specify implementation preference for comparisons. --- - + ## class `BitwiseStrategy` BitwiseStrategy, to specify implementation preference for bitwise operations. @@ -99,7 +99,7 @@ BitwiseStrategy, to specify implementation preference for bitwise operations. --- - + ## class `MultivariateStrategy` MultivariateStrategy, to specify implementation preference for multivariate operations. @@ -110,7 +110,7 @@ MultivariateStrategy, to specify implementation preference for multivariate oper --- - + ## class `MinMaxStrategy` MinMaxStrategy, to specify implementation preference for minimum and maximum operations. @@ -121,12 +121,12 @@ MinMaxStrategy, to specify implementation preference for minimum and maximum ope --- - + ## class `Configuration` Configuration class, to allow the compilation process to be customized. - + ### method `__init__` @@ -179,7 +179,12 @@ __init__( approximate_rounding_config: Optional[ApproximateRoundingConfig] = None, optimize_tlu_based_on_measured_bounds: bool = False, enable_tlu_fusing: bool = True, - print_tlu_fusing: bool = False + print_tlu_fusing: bool = False, + optimize_tlu_based_on_original_bit_width: Union[bool, int] = 8, + 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 ) ``` @@ -192,7 +197,7 @@ __init__( --- - + ### method `fork` @@ -245,7 +250,12 @@ fork( approximate_rounding_config: Optional[Keep, ApproximateRoundingConfig] = , optimize_tlu_based_on_measured_bounds: Union[Keep, bool] = , enable_tlu_fusing: Union[Keep, bool] = , - print_tlu_fusing: Union[Keep, bool] = + print_tlu_fusing: Union[Keep, bool] = , + optimize_tlu_based_on_original_bit_width: Union[Keep, bool, int] = , + detect_overflow_in_simulation: Union[Keep, bool] = , + dynamic_indexing_check_out_of_bounds: Union[Keep, bool] = , + dynamic_assignment_check_out_of_bounds: Union[Keep, bool] = , + simulate_encrypt_run_decrypt: Union[Keep, bool] = ) → Configuration ``` diff --git a/docs/dev/api/concrete.fhe.compilation.decorators.md b/docs/dev/api/concrete.fhe.compilation.decorators.md index e3055e4b01..e7197d7de4 100644 --- a/docs/dev/api/concrete.fhe.compilation.decorators.md +++ b/docs/dev/api/concrete.fhe.compilation.decorators.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.decorators` Declaration of `circuit` and `compiler` decorators. @@ -8,7 +8,7 @@ Declaration of `circuit` and `compiler` decorators. --- - + ## function `circuit` @@ -37,7 +37,7 @@ Provide a direct interface for compilation of single circuit programs. --- - + ## function `compiler` @@ -55,7 +55,7 @@ Provide an easy interface for the compilation of single-circuit programs. --- - + ## function `module` @@ -68,7 +68,7 @@ Provide an easy interface for the compilation of multi functions modules. --- - + ## function `function` @@ -86,12 +86,12 @@ Provide an easy interface to define a function within an fhe module. --- - + ## class `Compilable` Compilable class, to wrap a function and provide methods to trace and compile it. - + ### method `__init__` @@ -108,7 +108,7 @@ __init__(function_: Callable, parameters) --- - + ### method `compile` @@ -141,7 +141,7 @@ Compile the function into a circuit. --- - + ### method `trace` diff --git a/docs/dev/api/concrete.fhe.compilation.keys.md b/docs/dev/api/concrete.fhe.compilation.keys.md index 7b3e60baf0..a1d5a5e6c1 100644 --- a/docs/dev/api/concrete.fhe.compilation.keys.md +++ b/docs/dev/api/concrete.fhe.compilation.keys.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.keys` Declaration of `Keys` class. @@ -9,14 +9,14 @@ Declaration of `Keys` class. --- - + ## class `Keys` Keys class, to manage generate/reuse keys. Includes encryption keys as well as evaluation keys. Be careful when serializing/saving keys! - + ### method `__init__` @@ -48,7 +48,7 @@ Get only evaluation keys. --- - + ### method `deserialize` @@ -70,7 +70,7 @@ Deserialize keys from bytes. --- - + ### method `generate` @@ -95,7 +95,7 @@ Generate new keys. --- - + ### method `load` @@ -112,7 +112,7 @@ Load keys from a location. --- - + ### method `load_if_exists_generate_and_save_otherwise` @@ -134,7 +134,7 @@ Load keys from a location if they exist, else generate new keys and save to that --- - + ### method `save` @@ -153,7 +153,7 @@ Saved keys are not encrypted, so be careful how you store/transfer them! --- - + ### method `serialize` diff --git a/docs/dev/api/concrete.fhe.compilation.md b/docs/dev/api/concrete.fhe.compilation.md index 83a38bcbad..e2ac00bdad 100644 --- a/docs/dev/api/concrete.fhe.compilation.md +++ b/docs/dev/api/concrete.fhe.compilation.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation` Glue the compilation process together. @@ -13,6 +13,7 @@ Glue the compilation process together. - **utils** - **value** - **client** +- **composition** - **configuration** - **server** - **circuit** diff --git a/docs/dev/api/concrete.fhe.compilation.module.md b/docs/dev/api/concrete.fhe.compilation.module.md index 71b3d2003b..f71d5b22ae 100644 --- a/docs/dev/api/concrete.fhe.compilation.module.md +++ b/docs/dev/api/concrete.fhe.compilation.module.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.module` Declaration of `FheModule` classes. @@ -9,7 +9,7 @@ Declaration of `FheModule` classes. --- - + ## class `ExecutionRt` Runtime object class for execution. @@ -20,7 +20,7 @@ Runtime object class for execution. --- - + ## class `SimulationRt` Runtime object class for simulation. @@ -31,17 +31,22 @@ Runtime object class for simulation. --- - + ## class `FheFunction` Fhe function class, allowing to run or simulate one function of an fhe module. - + ### method `__init__` ```python -__init__(name: str, runtime: Union[ExecutionRt, SimulationRt], graph: Graph) +__init__( + name: str, + runtime: Union[ExecutionRt, SimulationRt], + graph: Graph, + configuration: Configuration +) ``` @@ -239,7 +244,7 @@ Get all statistics of the function. --- - + ### method `decrypt` @@ -263,7 +268,7 @@ Decrypt result(s) of evaluation. --- - + ### method `draw` @@ -297,7 +302,7 @@ That this function requires the python `pygraphviz` package which itself require --- - + ### method `encrypt` @@ -321,7 +326,7 @@ Encrypt argument(s) to for evaluation. --- - + ### method `encrypt_run_decrypt` @@ -343,7 +348,7 @@ Encrypt inputs, run the function, and decrypt the outputs in one go. --- - + ### method `run` @@ -367,7 +372,7 @@ Evaluate the function. --- - + ### method `simulate` @@ -390,12 +395,12 @@ Simulate execution of the function. --- - + ## class `FheModule` Fhe module class, to combine computation graphs, mlir, runtime objects into a single object. - + ### method `__init__` @@ -404,7 +409,8 @@ __init__( graphs: Dict[str, Graph], mlir: Module, compilation_context: CompilationContext, - configuration: Optional[Configuration] = None + configuration: Optional[Configuration] = None, + composition_rules: Optional[Iterable[CompositionRule]] = None ) ``` @@ -413,6 +419,12 @@ __init__( +--- + +#### property client + +Returns the client object tied to the module if not in simulation mode. + --- #### property complexity @@ -451,6 +463,12 @@ Get probability of error for each simple TLU (on a scalar). --- +#### property server + +Get the server object tied to the module. + +--- + #### property size_of_bootstrap_keys Get size of the bootstrap keys of the module. @@ -477,7 +495,7 @@ Get all statistics of the module. --- - + ### method `cleanup` @@ -489,7 +507,7 @@ Cleanup the temporary library output directory. --- - + ### method `functions` @@ -501,7 +519,7 @@ Return a dictionnary containing all the functions of the module. --- - + ### method `keygen` diff --git a/docs/dev/api/concrete.fhe.compilation.module_compiler.md b/docs/dev/api/concrete.fhe.compilation.module_compiler.md index b8555fff22..4b713d7a0a 100644 --- a/docs/dev/api/concrete.fhe.compilation.module_compiler.md +++ b/docs/dev/api/concrete.fhe.compilation.module_compiler.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.module_compiler` Declaration of `MultiCompiler` class. @@ -9,12 +9,12 @@ Declaration of `MultiCompiler` class. --- - + ## class `FunctionDef` An object representing the definition of a function as used in an fhe module. - + ### method `__init__` @@ -34,7 +34,7 @@ __init__( --- - + ### method `evaluate` @@ -62,12 +62,15 @@ Trace, fuse, measure bounds, and update values in the resulting graph in one go. --- - + ### method `trace` ```python -trace(sample: Union[Any, Tuple[Any, ]]) +trace( + sample: Union[Any, Tuple[Any, ]], + artifacts: Optional[FunctionDebugArtifacts] = None +) ``` Trace the function and fuse the resulting graph with a sample input. @@ -76,16 +79,247 @@ Trace the function and fuse the resulting graph with a sample input. **Args:** sample (Union[Any, Tuple[Any, ...]]): sample to use for tracing + - `artifacts`: Optiona[FunctionDebugArtifacts]: the object to store artifacts in + + +--- + + + +## class `NotComposable` +Composition policy that does not allow the forwarding of any output to any input. + + + + +--- + + + +### method `get_rules_iter` + +```python +get_rules_iter(_funcs: List[FunctionDef]) → Iterable[CompositionRule] +``` + +Return an iterator over composition rules. + + +--- + + + +## class `AllComposable` +Composition policy that allows to forward any output of the module to any of its input. + + + + +--- + + + +### method `get_rules_iter` + +```python +get_rules_iter(funcs: List[Graph]) → Iterable[CompositionRule] +``` + +Return an iterator over composition rules. + + +--- + + + +## class `WireOutput` +A protocol for wire outputs. + + + + +--- + + + +### method `get_outputs_iter` + +```python +get_outputs_iter() → Iterable[CompositionClause] +``` + +Return an iterator over the possible outputs of the wire output. + + +--- + + + +## class `WireInput` +A protocol for wire inputs. + + + + +--- + + + +### method `get_inputs_iter` + +```python +get_inputs_iter() → Iterable[CompositionClause] +``` + +Return an iterator over the possible inputs of the wire input. + + +--- + + + +## class `Output` +The output of a given function of a module. + + + + +--- + + + +### method `get_outputs_iter` + +```python +get_outputs_iter() → Iterable[CompositionClause] +``` + +Return an iterator over the possible outputs of the wire output. + + +--- + + + +## class `AllOutputs` +All the outputs of a given function of a module. + + + + +--- + + + +### method `get_outputs_iter` + +```python +get_outputs_iter() → Iterable[CompositionClause] +``` + +Return an iterator over the possible outputs of the wire output. + + +--- + + + +## class `Input` +The input of a given function of a module. + + + + +--- + + + +### method `get_inputs_iter` + +```python +get_inputs_iter() → Iterable[CompositionClause] +``` + +Return an iterator over the possible inputs of the wire input. + + +--- + + + +## class `AllInputs` +All the inputs of a given function of a module. + + + + +--- + + + +### method `get_inputs_iter` + +```python +get_inputs_iter() → Iterable[CompositionClause] +``` + +Return an iterator over the possible inputs of the wire input. + + +--- + + + +## class `Wire` +A forwarding rule between an output and an input. + + + + +--- + + + +### method `get_rules_iter` + +```python +get_rules_iter(_) → Iterable[CompositionRule] +``` + +Return an iterator over composition rules. + + +--- + + + +## class `Wired` +Composition policy which allows the forwarding of certain outputs to certain inputs. + + + + +--- + + + +### method `get_rules_iter` + +```python +get_rules_iter(_) → Iterable[CompositionRule] +``` + +Return an iterator over composition rules. --- - + ## class `DebugManager` A debug manager, allowing streamlined debugging. - + ### method `__init__` @@ -102,7 +336,7 @@ __init__(config: Configuration) --- - + ### method `debug_assigned_graph` @@ -114,7 +348,7 @@ Print assigned graphs if configuration tells so. --- - + ### method `debug_bit_width_assignments` @@ -126,7 +360,7 @@ Print bitwidth assignments if configuration tells so. --- - + ### method `debug_bit_width_constaints` @@ -138,7 +372,7 @@ Print bitwidth constraints if configuration tells so. --- - + ### method `debug_computation_graph` @@ -150,7 +384,7 @@ Print computation graph if configuration tells so. --- - + ### method `debug_mlir` @@ -162,7 +396,7 @@ Print mlir if configuration tells so. --- - + ### method `debug_statistics` @@ -174,7 +408,7 @@ Print statistics if configuration tells so. --- - + ### method `debug_table` @@ -186,7 +420,7 @@ Return a context manager that prints a table around what is printed inside the s --- - + ### method `show_assigned_graph` @@ -198,7 +432,7 @@ Tell if the configuration involves showing assigned graph. --- - + ### method `show_bit_width_assignments` @@ -210,7 +444,7 @@ Tell if the configuration involves showing bitwidth assignments. --- - + ### method `show_bit_width_constraints` @@ -222,7 +456,7 @@ Tell if the configuration involves showing bitwidth constraints. --- - + ### method `show_graph` @@ -234,7 +468,7 @@ Tell if the configuration involves showing graph. --- - + ### method `show_mlir` @@ -246,7 +480,7 @@ Tell if the configuration involves showing mlir. --- - + ### method `show_optimizer` @@ -258,7 +492,7 @@ Tell if the configuration involves showing optimizer. --- - + ### method `show_statistics` @@ -271,17 +505,17 @@ Tell if the configuration involves showing statistics. --- - + ## class `ModuleCompiler` Compiler class for multiple functions, to glue the compilation pipeline. - + ### method `__init__` ```python -__init__(functions: List[FunctionDef]) +__init__(functions: List[FunctionDef], composition: CompositionPolicy) ``` @@ -293,7 +527,7 @@ __init__(functions: List[FunctionDef]) --- - + ### method `compile` diff --git a/docs/dev/api/concrete.fhe.compilation.server.md b/docs/dev/api/concrete.fhe.compilation.server.md index fa4047d842..6d6dfb9e71 100644 --- a/docs/dev/api/concrete.fhe.compilation.server.md +++ b/docs/dev/api/concrete.fhe.compilation.server.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.server` Declaration of `Server` class. @@ -13,23 +13,24 @@ Declaration of `Server` class. --- - + ## class `Server` Server class, which can be used to perform homomorphic computation. - + ### method `__init__` ```python __init__( client_specs: ClientSpecs, - output_dir: Optional[TemporaryDirectory], + output_dir: Union[NoneType, str, Path], support: LibrarySupport, compilation_result: LibraryCompilationResult, server_program: ServerProgram, - is_simulated: bool + is_simulated: bool, + composition_rules: Optional[List[CompositionRule]] ) ``` @@ -84,7 +85,7 @@ Get all statistics of the compiled program. --- - + ### method `cleanup` @@ -96,7 +97,7 @@ Cleanup the temporary library output directory. --- - + ### method `clear_addition_count` @@ -108,7 +109,7 @@ Get the number of clear additions in the compiled program. --- - + ### method `clear_addition_count_per_parameter` @@ -122,7 +123,7 @@ Get the number of clear additions per parameter in the compiled program. --- - + ### method `clear_addition_count_per_tag` @@ -134,7 +135,7 @@ Get the number of clear additions per tag in the compiled program. --- - + ### method `clear_addition_count_per_tag_per_parameter` @@ -148,7 +149,7 @@ Get the number of clear additions per tag per parameter in the compiled program. --- - + ### method `clear_multiplication_count` @@ -160,7 +161,7 @@ Get the number of clear multiplications in the compiled program. --- - + ### method `clear_multiplication_count_per_parameter` @@ -174,7 +175,7 @@ Get the number of clear multiplications per parameter in the compiled program. --- - + ### method `clear_multiplication_count_per_tag` @@ -186,7 +187,7 @@ Get the number of clear multiplications per tag in the compiled program. --- - + ### method `clear_multiplication_count_per_tag_per_parameter` @@ -200,7 +201,7 @@ Get the number of clear multiplications per tag per parameter in the compiled pr --- - + ### method `create` @@ -209,7 +210,8 @@ create( mlir: Union[str, Module], configuration: Configuration, is_simulated: bool = False, - compilation_context: Optional[CompilationContext] = None + compilation_context: Optional[CompilationContext] = None, + composition_rules: Optional[Iterable[CompositionRule]] = None ) → Server ``` @@ -226,9 +228,11 @@ Create a server using MLIR and output sign information. compilation_context (CompilationContext): context to use for the Compiler + composition_rules (Iterable[Tuple[str, int, str, int]]): composition rules to be applied when compiling + --- - + ### method `encrypted_addition_count` @@ -240,7 +244,7 @@ Get the number of encrypted additions in the compiled program. --- - + ### method `encrypted_addition_count_per_parameter` @@ -254,7 +258,7 @@ Get the number of encrypted additions per parameter in the compiled program. --- - + ### method `encrypted_addition_count_per_tag` @@ -266,7 +270,7 @@ Get the number of encrypted additions per tag in the compiled program. --- - + ### method `encrypted_addition_count_per_tag_per_parameter` @@ -280,7 +284,7 @@ Get the number of encrypted additions per tag per parameter in the compiled prog --- - + ### method `encrypted_negation_count` @@ -292,7 +296,7 @@ Get the number of encrypted negations in the compiled program. --- - + ### method `encrypted_negation_count_per_parameter` @@ -306,7 +310,7 @@ Get the number of encrypted negations per parameter in the compiled program. --- - + ### method `encrypted_negation_count_per_tag` @@ -318,7 +322,7 @@ Get the number of encrypted negations per tag in the compiled program. --- - + ### method `encrypted_negation_count_per_tag_per_parameter` @@ -332,7 +336,7 @@ Get the number of encrypted negations per tag per parameter in the compiled prog --- - + ### method `key_switch_count` @@ -344,7 +348,7 @@ Get the number of key switches in the compiled program. --- - + ### method `key_switch_count_per_parameter` @@ -356,7 +360,7 @@ Get the number of key switches per parameter in the compiled program. --- - + ### method `key_switch_count_per_tag` @@ -368,7 +372,7 @@ Get the number of key switches per tag in the compiled program. --- - + ### method `key_switch_count_per_tag_per_parameter` @@ -382,7 +386,7 @@ Get the number of key switches per tag per parameter in the compiled program. --- - + ### method `load` @@ -404,7 +408,19 @@ Load the server from the given path in zip format. --- - + + +### method `memory_usage_per_location` + +```python +memory_usage_per_location(function: str = 'main') → Dict[str, int] +``` + +Get the memory usage of operations per location. + +--- + + ### method `packing_key_switch_count` @@ -416,7 +432,7 @@ Get the number of packing key switches in the compiled program. --- - + ### method `packing_key_switch_count_per_parameter` @@ -430,7 +446,7 @@ Get the number of packing key switches per parameter in the compiled program. --- - + ### method `packing_key_switch_count_per_tag` @@ -442,7 +458,7 @@ Get the number of packing key switches per tag in the compiled program. --- - + ### method `packing_key_switch_count_per_tag_per_parameter` @@ -456,7 +472,7 @@ Get the number of packing key switches per tag per parameter in the compiled pro --- - + ### method `programmable_bootstrap_count` @@ -468,7 +484,7 @@ Get the number of programmable bootstraps in the compiled program. --- - + ### method `programmable_bootstrap_count_per_parameter` @@ -482,7 +498,7 @@ Get the number of programmable bootstraps per parameter in the compiled program. --- - + ### method `programmable_bootstrap_count_per_tag` @@ -494,7 +510,7 @@ Get the number of programmable bootstraps per tag in the compiled program. --- - + ### method `programmable_bootstrap_count_per_tag_per_parameter` @@ -508,7 +524,7 @@ Get the number of programmable bootstraps per tag per parameter in the compiled --- - + ### method `run` @@ -538,7 +554,7 @@ Evaluate. --- - + ### method `save` @@ -557,7 +573,7 @@ Save the server into the given path in zip format. --- - + ### method `size_of_inputs` @@ -569,7 +585,7 @@ Get size of the inputs of the compiled program. --- - + ### method `size_of_outputs` diff --git a/docs/dev/api/concrete.fhe.compilation.specs.md b/docs/dev/api/concrete.fhe.compilation.specs.md index 81695d95cc..10a5488da2 100644 --- a/docs/dev/api/concrete.fhe.compilation.specs.md +++ b/docs/dev/api/concrete.fhe.compilation.specs.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.specs` Declaration of `ClientSpecs` class. @@ -9,12 +9,12 @@ Declaration of `ClientSpecs` class. --- - + ## class `ClientSpecs` ClientSpecs class, to create Client objects. - + ### method `__init__` @@ -31,7 +31,7 @@ __init__(client_parameters: ClientParameters) --- - + ### method `deserialize` @@ -53,7 +53,7 @@ Create client specs from its string representation. --- - + ### method `serialize` diff --git a/docs/dev/api/concrete.fhe.compilation.utils.md b/docs/dev/api/concrete.fhe.compilation.utils.md index 9840dd9f71..b6e9cf8c18 100644 --- a/docs/dev/api/concrete.fhe.compilation.utils.md +++ b/docs/dev/api/concrete.fhe.compilation.utils.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.utils` Declaration of various functions and constants related to compilation. @@ -8,7 +8,7 @@ Declaration of various functions and constants related to compilation. --- - + ## function `inputset` @@ -36,7 +36,7 @@ Generate a random inputset. --- - + ## function `validate_input_args` @@ -65,7 +65,7 @@ Validate input arguments. --- - + ## function `fuse` @@ -90,7 +90,7 @@ Fuse appropriate subgraphs in a graph to a single Operation.Generic node. --- - + ## function `find_float_subgraph_with_unique_terminal_node` @@ -118,7 +118,7 @@ Find a subgraph with float computations that end with an integer output. --- - + ## function `find_tlu_subgraph_with_multiple_variable_inputs_that_has_a_single_common_ancestor` @@ -146,7 +146,7 @@ Find a subgraph with a tlu computation that has multiple variable inputs whe --- - + ## function `find_single_lca` @@ -168,7 +168,7 @@ Returns Optional[Node]: single lca if it exists, None otherwise --- - + ## function `is_single_common_ancestor` @@ -198,7 +198,7 @@ Returns bool: True if `candidate` is a single common ancestor of `nodes`, Fals --- - + ## function `find_closest_integer_output_nodes` @@ -229,7 +229,7 @@ Find the closest upstream integer output nodes to a set of start nodes in a grap --- - + ## function `add_nodes_from_to` @@ -263,7 +263,7 @@ Add nodes from `from_nodes` to `to_nodes`, to `all_nodes`. --- - + ## function `convert_subgraph_to_subgraph_node` @@ -302,7 +302,7 @@ Convert a subgraph to Operation.Generic node. --- - + ## function `check_subgraph_fusibility` @@ -337,7 +337,7 @@ shuffling or reshaping a tensor make fusing impossible as there should be a one- --- - + ## function `friendly_type_format` @@ -350,7 +350,7 @@ Convert a type to a string. Remove package name and class/type keywords. --- - + ## function `get_terminal_size` diff --git a/docs/dev/api/concrete.fhe.compilation.value.md b/docs/dev/api/concrete.fhe.compilation.value.md index 396cfee795..bda9179e0a 100644 --- a/docs/dev/api/concrete.fhe.compilation.value.md +++ b/docs/dev/api/concrete.fhe.compilation.value.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.compilation.value` Declaration of `Value` class. @@ -9,12 +9,12 @@ Declaration of `Value` class. --- - + ## class `Value` Value class, to store scalar or tensor values which can be encrypted or clear. - + ### method `__init__` @@ -31,7 +31,7 @@ __init__(inner: Value) --- - + ### method `deserialize` @@ -53,7 +53,7 @@ Deserialize data from bytes. --- - + ### method `serialize` diff --git a/docs/dev/api/concrete.fhe.dtypes.base.md b/docs/dev/api/concrete.fhe.dtypes.base.md index b7580f8cf9..38df86ebd9 100644 --- a/docs/dev/api/concrete.fhe.dtypes.base.md +++ b/docs/dev/api/concrete.fhe.dtypes.base.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.dtypes.base` Declaration of `BaseDataType` abstract class. @@ -9,7 +9,7 @@ Declaration of `BaseDataType` abstract class. --- - + ## class `BaseDataType` BaseDataType abstract class, to form a basis for data types. diff --git a/docs/dev/api/concrete.fhe.dtypes.float.md b/docs/dev/api/concrete.fhe.dtypes.float.md index 33a83934a6..efff44380f 100644 --- a/docs/dev/api/concrete.fhe.dtypes.float.md +++ b/docs/dev/api/concrete.fhe.dtypes.float.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.dtypes.float` Declaration of `Float` class. @@ -9,12 +9,12 @@ Declaration of `Float` class. --- - + ## class `Float` Float class, to represent floating point numbers. - + ### method `__init__` diff --git a/docs/dev/api/concrete.fhe.dtypes.integer.md b/docs/dev/api/concrete.fhe.dtypes.integer.md index a652a0d678..08736e2a95 100644 --- a/docs/dev/api/concrete.fhe.dtypes.integer.md +++ b/docs/dev/api/concrete.fhe.dtypes.integer.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.dtypes.integer` Declaration of `Integer` class. @@ -9,12 +9,12 @@ Declaration of `Integer` class. --- - + ## class `Integer` Integer class, to represent integers. - + ### method `__init__` @@ -31,7 +31,7 @@ __init__(is_signed: bool, bit_width: int) --- - + ### method `can_represent` @@ -53,7 +53,7 @@ Get whether `value` can be represented by the `Integer` or not. --- - + ### method `max` @@ -70,7 +70,7 @@ Get the maximum value that can be represented by the `Integer`. --- - + ### method `min` @@ -87,7 +87,7 @@ Get the minimum value that can be represented by the `Integer`. --- - + ### method `that_can_represent` @@ -111,6 +111,30 @@ Get the minimal `Integer` that can represent `value`. +**Raises:** + ValueError: if `value` cannot be represented by `Integer` + +--- + + + +### method `update_to_represent` + +```python +update_to_represent(value: Any, force_signed: bool = False) +``` + +Update sign and width inplace to be able to represent `value`. + + + +**Args:** + value (Any): value that needs to be represented + + force_signed (bool, default = False): whether to force signed integers or not + + + **Raises:** ValueError: if `value` cannot be represented by `Integer` diff --git a/docs/dev/api/concrete.fhe.dtypes.md b/docs/dev/api/concrete.fhe.dtypes.md index cf9aea6b16..327c618576 100644 --- a/docs/dev/api/concrete.fhe.dtypes.md +++ b/docs/dev/api/concrete.fhe.dtypes.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.dtypes` Define available data types and their semantics. diff --git a/docs/dev/api/concrete.fhe.dtypes.utils.md b/docs/dev/api/concrete.fhe.dtypes.utils.md index cc2a917f8d..ae65b93371 100644 --- a/docs/dev/api/concrete.fhe.dtypes.utils.md +++ b/docs/dev/api/concrete.fhe.dtypes.utils.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.dtypes.utils` Declaration of various functions and constants related to data types. @@ -8,7 +8,7 @@ Declaration of various functions and constants related to data types. --- - + ## function `combine_dtypes` diff --git a/docs/dev/api/concrete.fhe.extensions.array.md b/docs/dev/api/concrete.fhe.extensions.array.md index 54d3005975..75c160d3d8 100644 --- a/docs/dev/api/concrete.fhe.extensions.array.md +++ b/docs/dev/api/concrete.fhe.extensions.array.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.array` Declaration of `array` function, to simplify creation of encrypted arrays. @@ -8,7 +8,7 @@ Declaration of `array` function, to simplify creation of encrypted arrays. --- - + ## function `array` diff --git a/docs/dev/api/concrete.fhe.extensions.bits.md b/docs/dev/api/concrete.fhe.extensions.bits.md index 7c20893248..20eec1369a 100644 --- a/docs/dev/api/concrete.fhe.extensions.bits.md +++ b/docs/dev/api/concrete.fhe.extensions.bits.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.bits` Bit extraction extensions. @@ -12,7 +12,7 @@ Bit extraction extensions. --- - + ## function `bits` @@ -35,12 +35,12 @@ Extract bits of integers. --- - + ## class `Bits` Bits class, to provide indexing into the bits of integers. - + ### method `__init__` diff --git a/docs/dev/api/concrete.fhe.extensions.convolution.md b/docs/dev/api/concrete.fhe.extensions.convolution.md index bfe01ae109..a6d8e4367d 100644 --- a/docs/dev/api/concrete.fhe.extensions.convolution.md +++ b/docs/dev/api/concrete.fhe.extensions.convolution.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.convolution` Tracing and evaluation of convolution. @@ -11,7 +11,7 @@ Tracing and evaluation of convolution. --- - + ## function `conv` diff --git a/docs/dev/api/concrete.fhe.extensions.hint.md b/docs/dev/api/concrete.fhe.extensions.hint.md index 9c93084edf..cd28738cdf 100644 --- a/docs/dev/api/concrete.fhe.extensions.hint.md +++ b/docs/dev/api/concrete.fhe.extensions.hint.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.hint` Declaration of hinting extensions, to provide more information to Concrete. @@ -8,7 +8,7 @@ Declaration of hinting extensions, to provide more information to Concrete. --- - + ## function `hint` diff --git a/docs/dev/api/concrete.fhe.extensions.identity.md b/docs/dev/api/concrete.fhe.extensions.identity.md index 1d7fa7c2b3..7e55fedd31 100644 --- a/docs/dev/api/concrete.fhe.extensions.identity.md +++ b/docs/dev/api/concrete.fhe.extensions.identity.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.identity` Declaration of `identity` extension. @@ -8,7 +8,7 @@ Declaration of `identity` extension. --- - + ## function `identity` diff --git a/docs/dev/api/concrete.fhe.extensions.maxpool.md b/docs/dev/api/concrete.fhe.extensions.maxpool.md index ff03406b14..845fb8a6bf 100644 --- a/docs/dev/api/concrete.fhe.extensions.maxpool.md +++ b/docs/dev/api/concrete.fhe.extensions.maxpool.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.maxpool` Tracing and evaluation of maxpool. @@ -16,7 +16,7 @@ Tracing and evaluation of maxpool. --- - + ## function `maxpool` diff --git a/docs/dev/api/concrete.fhe.extensions.md b/docs/dev/api/concrete.fhe.extensions.md index ba3db82540..4fa512b8ad 100644 --- a/docs/dev/api/concrete.fhe.extensions.md +++ b/docs/dev/api/concrete.fhe.extensions.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions` Provide additional features that are not present in numpy. diff --git a/docs/dev/api/concrete.fhe.extensions.multivariate.md b/docs/dev/api/concrete.fhe.extensions.multivariate.md index 229610dd97..6e8d0bd32d 100644 --- a/docs/dev/api/concrete.fhe.extensions.multivariate.md +++ b/docs/dev/api/concrete.fhe.extensions.multivariate.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.multivariate` Declaration of `multivariate` extension. @@ -8,7 +8,7 @@ Declaration of `multivariate` extension. --- - + ## function `multivariate` diff --git a/docs/dev/api/concrete.fhe.extensions.ones.md b/docs/dev/api/concrete.fhe.extensions.ones.md index bbde30bba8..ab303bf1da 100644 --- a/docs/dev/api/concrete.fhe.extensions.ones.md +++ b/docs/dev/api/concrete.fhe.extensions.ones.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.ones` Declaration of `ones` and `one` functions, to simplify creation of encrypted ones. @@ -8,7 +8,7 @@ Declaration of `ones` and `one` functions, to simplify creation of encrypted one --- - + ## function `ones` @@ -31,7 +31,7 @@ Create an encrypted array of ones. --- - + ## function `one` @@ -49,7 +49,7 @@ Create an encrypted scalar with the value of one. --- - + ## function `ones_like` diff --git a/docs/dev/api/concrete.fhe.extensions.relu.md b/docs/dev/api/concrete.fhe.extensions.relu.md index 7dd3a6af12..abe71bccc7 100644 --- a/docs/dev/api/concrete.fhe.extensions.relu.md +++ b/docs/dev/api/concrete.fhe.extensions.relu.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.relu` Declaration of `relu` extension. @@ -8,7 +8,7 @@ Declaration of `relu` extension. --- - + ## function `relu` diff --git a/docs/dev/api/concrete.fhe.extensions.round_bit_pattern.md b/docs/dev/api/concrete.fhe.extensions.round_bit_pattern.md index 8aa1ce6083..ca42694106 100644 --- a/docs/dev/api/concrete.fhe.extensions.round_bit_pattern.md +++ b/docs/dev/api/concrete.fhe.extensions.round_bit_pattern.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.round_bit_pattern` Declaration of `round_bit_pattern` function, to provide an interface for rounded table lookups. @@ -11,7 +11,7 @@ Declaration of `round_bit_pattern` function, to provide an interface for rounded --- - + ## function `round_bit_pattern` @@ -55,12 +55,12 @@ x = 0b_1011_1000 , lsbs_to_remove = 3 => 0b_1011_1000 x = 0b_1011_1001 , lsbs_to --- - + ## class `Adjusting` Adjusting class, to be used as early stop signal during adjustment. - + ### method `__init__` @@ -78,12 +78,12 @@ __init__(rounder: 'AutoRounder', input_min: int, input_max: int) --- - + ## class `AutoRounder` AutoRounder class, to optimize for number of msbs to keep during round bit pattern operation. - + ### method `__init__` @@ -100,7 +100,7 @@ __init__(target_msbs: int = 16) --- - + ### method `adjust` @@ -115,7 +115,7 @@ Adjust AutoRounders in a function using an inputset. --- - + ### method `dump_dict` @@ -127,7 +127,7 @@ Dump properties of the rounder to a dict. --- - + ### classmethod `load_dict` diff --git a/docs/dev/api/concrete.fhe.extensions.table.md b/docs/dev/api/concrete.fhe.extensions.table.md index 37a811375f..ca09c198fe 100644 --- a/docs/dev/api/concrete.fhe.extensions.table.md +++ b/docs/dev/api/concrete.fhe.extensions.table.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.table` Declaration of `LookupTable` class. @@ -9,12 +9,12 @@ Declaration of `LookupTable` class. --- - + ## class `LookupTable` LookupTable class, to provide a way to do direct table lookups. - + ### method `__init__` @@ -31,7 +31,7 @@ __init__(table: Any) --- - + ### method `apply` diff --git a/docs/dev/api/concrete.fhe.extensions.tag.md b/docs/dev/api/concrete.fhe.extensions.tag.md index 9bf0195c5b..9ad0851b92 100644 --- a/docs/dev/api/concrete.fhe.extensions.tag.md +++ b/docs/dev/api/concrete.fhe.extensions.tag.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.tag` Declaration of `tag` context manager, to allow tagging certain nodes. diff --git a/docs/dev/api/concrete.fhe.extensions.truncate_bit_pattern.md b/docs/dev/api/concrete.fhe.extensions.truncate_bit_pattern.md index e4cbf4c171..931295d953 100644 --- a/docs/dev/api/concrete.fhe.extensions.truncate_bit_pattern.md +++ b/docs/dev/api/concrete.fhe.extensions.truncate_bit_pattern.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.truncate_bit_pattern` Declaration of `truncate_bit_pattern` extension. @@ -11,7 +11,7 @@ Declaration of `truncate_bit_pattern` extension. --- - + ## function `truncate_bit_pattern` @@ -43,12 +43,12 @@ x = 0b_0000 , lsbs_to_remove = 2 => 0b_0000 x = 0b_0001 , lsbs_to_remove = 2 => --- - + ## class `Adjusting` Adjusting class, to be used as early stop signal during adjustment. - + ### method `__init__` @@ -66,12 +66,12 @@ __init__(truncator: 'AutoTruncator', input_min: int, input_max: int) --- - + ## class `AutoTruncator` AutoTruncator class, to optimize for the number of msbs to keep during truncate operation. - + ### method `__init__` @@ -88,7 +88,7 @@ __init__(target_msbs: int = 16) --- - + ### method `adjust` @@ -103,7 +103,7 @@ Adjust AutoTruncators in a function using an inputset. --- - + ### method `dump_dict` @@ -115,7 +115,7 @@ Dump properties of the truncator to a dict. --- - + ### classmethod `load_dict` diff --git a/docs/dev/api/concrete.fhe.extensions.univariate.md b/docs/dev/api/concrete.fhe.extensions.univariate.md index 99941461aa..bf2b588980 100644 --- a/docs/dev/api/concrete.fhe.extensions.univariate.md +++ b/docs/dev/api/concrete.fhe.extensions.univariate.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.univariate` Declaration of `univariate` function. @@ -8,7 +8,7 @@ Declaration of `univariate` function. --- - + ## function `univariate` diff --git a/docs/dev/api/concrete.fhe.extensions.zeros.md b/docs/dev/api/concrete.fhe.extensions.zeros.md index e3d711c571..7a1e14e60c 100644 --- a/docs/dev/api/concrete.fhe.extensions.zeros.md +++ b/docs/dev/api/concrete.fhe.extensions.zeros.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.extensions.zeros` Declaration of `zeros` and `zero` functions, to simplify creation of encrypted zeros. @@ -8,7 +8,7 @@ Declaration of `zeros` and `zero` functions, to simplify creation of encrypted z --- - + ## function `zeros` @@ -31,7 +31,7 @@ Create an encrypted array of zeros. --- - + ## function `zero` @@ -44,12 +44,12 @@ Create an encrypted scalar with the value of zero. **Returns:** - Union[np.ndarray, Tracer]: Tracer that represents the operation during tracing ndarray with zero otherwise + Union[np.ndarray, Tracer]: Tracer that respresents the operation during tracing ndarray with zero otherwise --- - + ## function `zeros_like` diff --git a/docs/dev/api/concrete.fhe.internal.md b/docs/dev/api/concrete.fhe.internal.md index 88262c26f5..f2fbb8c087 100644 --- a/docs/dev/api/concrete.fhe.internal.md +++ b/docs/dev/api/concrete.fhe.internal.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.internal` Export functions that are used internally by other modules for common things (e.g., assertions). diff --git a/docs/dev/api/concrete.fhe.internal.utils.md b/docs/dev/api/concrete.fhe.internal.utils.md index 6b9b670c90..5b1fee467f 100644 --- a/docs/dev/api/concrete.fhe.internal.utils.md +++ b/docs/dev/api/concrete.fhe.internal.utils.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.internal.utils` Declaration of various functions and constants related to the entire project. @@ -8,7 +8,7 @@ Declaration of various functions and constants related to the entire project. --- - + ## function `assert_that` @@ -33,7 +33,7 @@ Assert a condition. --- - + ## function `unreachable` diff --git a/docs/dev/api/concrete.fhe.md b/docs/dev/api/concrete.fhe.md index 41664f8e97..38b9275236 100644 --- a/docs/dev/api/concrete.fhe.md +++ b/docs/dev/api/concrete.fhe.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe` Concrete. @@ -12,6 +12,7 @@ Concrete. - **values** - **representation** - **tracing** +- **tfhers** - **mlir** - **extensions** - **compilation** diff --git a/docs/dev/api/concrete.fhe.mlir.context.md b/docs/dev/api/concrete.fhe.mlir.context.md index 01be6b659b..734522360f 100644 --- a/docs/dev/api/concrete.fhe.mlir.context.md +++ b/docs/dev/api/concrete.fhe.mlir.context.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.mlir.context` Declaration of `Context` class. @@ -10,16 +10,17 @@ Declaration of `Context` class. - **MAX_EXTRACTABLE_BIT** - **MIN_EXTRACTABLE_BIT** - **MAXIMUM_TLU_BIT_WIDTH** +- **LUT_COSTS_V0_NORM2_0** --- - + ## class `Context` Context class, to perform operations on conversions. - + ### method `__init__` @@ -36,7 +37,7 @@ __init__(context: Context, graph: Graph, configuration: Configuration) --- - + ### method `add` @@ -50,7 +51,7 @@ add(resulting_type: ConversionType, x: Conversion, y: Conversion) → Conversion --- - + ### method `array` @@ -64,16 +65,16 @@ array(resulting_type: ConversionType, elements: List[Conversion]) → Conversion --- - + -### method `assign_static` +### method `assign` ```python -assign_static( +assign( resulting_type: ConversionType, x: Conversion, y: Conversion, - index: Sequence[Union[int, integer, slice]] + index: Sequence[Union[int, integer, slice, ndarray, list, Conversion]] ) ``` @@ -83,7 +84,7 @@ assign_static( --- - + ### method `attribute` @@ -107,7 +108,7 @@ Create an MLIR attribute. --- - + ### method `best_chunk_ranges` @@ -140,7 +141,7 @@ Calculate best chunk ranges for given operands. --- - + ### method `bitwise` @@ -159,7 +160,7 @@ bitwise( --- - + ### method `bitwise_and` @@ -177,7 +178,7 @@ bitwise_and( --- - + ### method `bitwise_or` @@ -195,7 +196,7 @@ bitwise_or( --- - + ### method `bitwise_xor` @@ -213,7 +214,7 @@ bitwise_xor( --- - + ### method `broadcast_to` @@ -227,7 +228,7 @@ broadcast_to(x: Conversion, shape: Tuple[int, ]) --- - + ### method `cast` @@ -241,7 +242,7 @@ cast(resulting_type: ConversionType, x: Conversion) → Conversion --- - + ### method `cast_to_original_bit_width` @@ -253,7 +254,7 @@ Cast a value to its original bit width using multiplication and reinterpretation --- - + ### method `compare_with_subtraction` @@ -269,7 +270,7 @@ Apply the final comparison table and return comparison result. --- - + ### method `comparison` @@ -302,7 +303,7 @@ Compare two encrypted values. --- - + ### method `comparison_with_chunks` @@ -321,7 +322,7 @@ Idea: split x and y into small chunks compare the chunks using table lookups --- - + ### method `comparison_with_chunks_equals` @@ -343,7 +344,7 @@ Check equality of encrypted values using chunks. --- - + ### method `comparison_with_subtraction_trick` @@ -365,7 +366,7 @@ Additional Args: x_minus_y_dtype (Integer): minimal dtype that can be used to --- - + ### method `concatenate` @@ -383,12 +384,55 @@ concatenate( --- - + + +### method `conditional` + +```python +conditional( + resulting_type: Optional[ConversionType], + condition: Conversion, + then_builder: Callable[[], Optional[Conversion]], + else_builder: Optional[Callable[[], Optional[Conversion]]] = None +) → Optional[Conversion] +``` + +Create an if conditional. + + + +**Args:** + resulting_type (Optional[ConversionType]): resulting type of the operation + + condition (Conversion): condition of conditional + + then_builder (Callable[[], Optional[Conversion]]): builder of then block of conditional + + else_builder (Optional[Callable[[], Optional[Conversion]]], default = None): optional builder of else block of conditional + + + +**Returns:** + Optional[Conversion]: None if resulting type is None conversion of the created operation otherwise + + + +**Notes:** + +> - if resulting type is not None both then and else builders need to return a conversion with the same type as resulting type + +--- + + ### method `constant` ```python -constant(resulting_type: ConversionType, data: Any) → Conversion +constant( + resulting_type: ConversionType, + data: Any, + use_cache: bool = True +) → Conversion ``` @@ -397,7 +441,7 @@ constant(resulting_type: ConversionType, data: Any) → Conversion --- - + ### method `conv2d` @@ -420,7 +464,7 @@ conv2d( --- - + ### method `convert_to_chunks_and_map` @@ -465,7 +509,7 @@ Extract the chunks of two values, pack them in a single integer and map the inte --- - + ### method `dot` @@ -479,7 +523,7 @@ dot(resulting_type: ConversionType, x: Conversion, y: Conversion) → Conversion --- - + ### method `dynamic_tlu` @@ -497,7 +541,7 @@ dynamic_tlu( --- - + ### method `eint` @@ -509,7 +553,19 @@ Get encrypted unsigned integer type (e.g., !FHE.eint<3>, !FHE.eint<5>). --- - + + +### method `element_typeof` + +```python +element_typeof(value: Union[Conversion, ConversionType]) → ConversionType +``` + +Get type corresponding to the elements of a tensor type. + +--- + + ### method `encrypt` @@ -523,7 +579,7 @@ encrypt(resulting_type: ConversionType, x: Conversion) → Conversion --- - + ### method `equal` @@ -537,7 +593,7 @@ equal(resulting_type: ConversionType, x: Conversion, y: Conversion) → Conversi --- - + ### method `error` @@ -554,7 +610,7 @@ Fail compilation with an error. --- - + ### method `esint` @@ -566,7 +622,7 @@ Get encrypted signed integer type (e.g., !FHE.esint<3>, !FHE.esint<5>). --- - + ### method `extract_bits` @@ -584,7 +640,7 @@ extract_bits( --- - + ### method `flatten` @@ -598,7 +654,66 @@ flatten(x: Conversion) → Conversion --- - + + +### method `for_loop` + +```python +for_loop( + lower_bound: int, + upper_bound: int, + body: Union[Callable[[Conversion], Optional[Conversion]], Callable[[Conversion, Conversion], Optional[Conversion]]], + output: Optional[Conversion] = None, + step: int = 1 +) → Optional[Conversion] +``` + +Create a for loop. + + + +**Args:** + lower_bound (int): starting position of the for loop + + upper_bound (int): upper bound of the for loop + + body (Union[ Callable[[Conversion], Optional[Conversion]], Callable[[Conversion, Conversion], Optional[Conversion]], ]): body of the for loop + + output (Optional[Conversion], default = None): initial value of the output of the for loop + + step (int, default = 1): step between the iterations of the for loop + + + +**Returns:** + Optional[Conversion]: None if output is None conversion of the created operation otherwise + + + +**Notes:** + +> - if output is None body builder must take a single indexing variable argument - if output is not None body builder must take an indexing variable and output arguments and body must end with an scf yield operation with the updated output + +--- + + + +### method `fork_type` + +```python +fork_type( + type_: ConversionType, + bit_width: Optional[int] = None, + is_signed: Optional[bool] = None, + shape: Optional[Tuple[int, ]] = None +) → ConversionType +``` + +Fork a type with some properties update. + +--- + + ### method `greater` @@ -616,7 +731,7 @@ greater( --- - + ### method `greater_equal` @@ -634,7 +749,7 @@ greater_equal( --- - + ### method `i` @@ -646,7 +761,7 @@ Get clear signless integer type (e.g., i3, i5). --- - + ### method `identity` @@ -660,15 +775,15 @@ identity(resulting_type: ConversionType, x: Conversion) → Conversion --- - + -### method `index_static` +### method `index` ```python -index_static( +index( resulting_type: ConversionType, x: Conversion, - index: Sequence[Union[int, integer, slice, ndarray, list]] + index: Sequence[Union[int, integer, slice, ndarray, list, Conversion]] ) → Conversion ``` @@ -678,37 +793,19 @@ index_static( --- - - -### method `index_static_fancy` - -```python -index_static_fancy( - resulting_type: ConversionType, - x: Conversion, - index: Sequence[Union[int, integer, slice, ndarray, list]] -) → Conversion -``` - - - - - ---- - - + ### method `index_type` ```python -index_type() → Type +index_type() → ConversionType ``` Get index type. --- - + ### method `is_bit_width_compatible` @@ -720,7 +817,7 @@ Check if conversion types are compatible in terms of bit-width. --- - + ### method `less` @@ -734,7 +831,7 @@ less(resulting_type: ConversionType, x: Conversion, y: Conversion) → Conversio --- - + ### method `less_equal` @@ -752,7 +849,7 @@ less_equal( --- - + ### method `location` @@ -764,7 +861,7 @@ Create an MLIR location from the node that is being converted. --- - + ### method `lsb` @@ -778,7 +875,7 @@ lsb(resulting_type: ConversionType, x: Conversion) → Conversion --- - + ### method `matmul` @@ -796,7 +893,7 @@ matmul( --- - + ### method `maximum` @@ -814,7 +911,7 @@ maximum( --- - + ### method `maxpool2d` @@ -834,7 +931,7 @@ maxpool2d( --- - + ### method `minimum` @@ -852,7 +949,7 @@ minimum( --- - + ### method `minimum_maximum_with_chunks` @@ -869,7 +966,7 @@ Calculate minimum or maximum between two encrypted values using chunks. --- - + ### method `minimum_maximum_with_trick` @@ -891,7 +988,7 @@ Additional Args: x_minus_y_dtype (Integer): minimal dtype that can be used to --- - + ### method `mul` @@ -905,7 +1002,7 @@ mul(resulting_type: ConversionType, x: Conversion, y: Conversion) → Conversion --- - + ### method `multi_tlu` @@ -924,7 +1021,7 @@ multi_tlu( --- - + ### method `multiplication_with_boolean` @@ -942,7 +1039,7 @@ Calculate boolean * value using bits. --- - + ### method `multivariate_multi_tlu` @@ -961,7 +1058,7 @@ multivariate_multi_tlu( --- - + ### method `multivariate_tlu` @@ -979,7 +1076,7 @@ multivariate_tlu( --- - + ### method `neg` @@ -993,7 +1090,19 @@ neg(resulting_type: ConversionType, x: Conversion) → Conversion --- - + + +### method `none_type` + +```python +none_type() → ConversionType +``` + +Get none type. + +--- + + ### method `not_equal` @@ -1011,7 +1120,7 @@ not_equal( --- - + ### method `ones` @@ -1025,16 +1134,17 @@ ones(resulting_type: ConversionType) → Conversion --- - + ### method `operation` ```python operation( operation: Callable, - resulting_type: ConversionType, + resulting_type: Optional[ConversionType], *args, original_bit_width: Optional[int] = None, + use_cache: bool = True, **kwargs ) → Conversion ``` @@ -1046,12 +1156,14 @@ Create a conversion from an MLIR operation. **Args:** operation (Callable): MLIR operation to create (e.g., fhe.AddEintOp) - resulting_type (ConversionType): type of the output of the operation + resulting_type (Optional[ConversionType]): optional type of the output of the operation *args (Any): args to pass to the operation original_bit_width (Optional[int], default = None): original bit width of the resulting conversion + use_cache (bool, default = True): whether to use the operation cache or not + *kwargs (Any): kwargs to pass to the operation **Returns:** @@ -1059,7 +1171,7 @@ Create a conversion from an MLIR operation. --- - + ### method `pack_multivariate_inputs` @@ -1081,7 +1193,7 @@ Packs inputs of multivariate table lookups. --- - + ### method `reinterpret` @@ -1099,7 +1211,7 @@ reinterpret( --- - + ### method `relu` @@ -1113,7 +1225,7 @@ relu(resulting_type: ConversionType, x: Conversion) → Conversion --- - + ### method `reshape` @@ -1127,7 +1239,7 @@ reshape(x: Conversion, shape: Tuple[int, ]) → Conversion --- - + ### method `round_bit_pattern` @@ -1147,7 +1259,21 @@ round_bit_pattern( --- - + + +### method `safe_reduce_precision` + +```python +safe_reduce_precision(x: Conversion, bit_width: int) → Conversion +``` + + + + + +--- + + ### method `shift` @@ -1167,7 +1293,21 @@ shift( --- - + + +### method `shift_left_at_constant_precision` + +```python +shift_left_at_constant_precision(x: Conversion, rank: int) → Conversion +``` + + + + + +--- + + ### method `sub` @@ -1181,7 +1321,7 @@ sub(resulting_type: ConversionType, x: Conversion, y: Conversion) → Conversion --- - + ### method `sum` @@ -1200,7 +1340,7 @@ sum( --- - + ### method `tensor` @@ -1212,7 +1352,7 @@ Get tensor type (e.g., tensor<5xi3>, tensor<3x2x!FHE.eint<5>>). --- - + ### method `tensorize` @@ -1226,7 +1366,7 @@ tensorize(x: Conversion) → Conversion --- - + ### method `tlu` @@ -1240,7 +1380,7 @@ tlu(resulting_type: ConversionType, on: Conversion, table: Sequence[int]) --- - + ### method `to_signed` @@ -1254,7 +1394,7 @@ to_signed(x: Conversion) → Conversion --- - + ### method `to_signedness` @@ -1268,7 +1408,7 @@ to_signedness(x: Conversion, of: ConversionType) → Conversion --- - + ### method `to_unsigned` @@ -1282,7 +1422,7 @@ to_unsigned(x: Conversion) → Conversion --- - + ### method `transpose` @@ -1300,7 +1440,7 @@ transpose( --- - + ### method `tree_add` @@ -1314,7 +1454,7 @@ tree_add(resulting_type: ConversionType, xs: List[Conversion]) → Conversion --- - + ### method `truncate_bit_pattern` @@ -1328,7 +1468,7 @@ truncate_bit_pattern(x: Conversion, lsbs_to_remove: int) → Conversion --- - + ### method `try_comparison_with_clipping_trick` @@ -1357,19 +1497,19 @@ Additional Args: smaller_minus_clipped_bigger_dtype (Integer): minimal dtype t --- - + ### method `typeof` ```python -typeof(value: Union[ValueDescription, Node]) → ConversionType +typeof(value: Optional[ValueDescription, Node]) → ConversionType ``` Get type corresponding to a value or a node. --- - + ### method `where` @@ -1388,7 +1528,7 @@ where( --- - + ### method `zeros` diff --git a/docs/dev/api/concrete.fhe.mlir.conversion.md b/docs/dev/api/concrete.fhe.mlir.conversion.md index d83422f607..9d391b84af 100644 --- a/docs/dev/api/concrete.fhe.mlir.conversion.md +++ b/docs/dev/api/concrete.fhe.mlir.conversion.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.mlir.conversion` Declaration of `ConversionType` and `Conversion` classes. @@ -9,12 +9,12 @@ Declaration of `ConversionType` and `Conversion` classes. --- - + ## class `ConversionType` ConversionType class, to make it easier to work with MLIR types. - + ### method `__init__` @@ -64,12 +64,12 @@ __init__(mlir: Type) --- - + ## class `Conversion` Conversion class, to store MLIR operations with additional information. - + ### method `__init__` @@ -158,7 +158,7 @@ If not explicitly set, defaults to the actual bit width. --- - + ### method `set_original_bit_width` diff --git a/docs/dev/api/concrete.fhe.mlir.converter.md b/docs/dev/api/concrete.fhe.mlir.converter.md index 0f55a73492..4263a3a2d7 100644 --- a/docs/dev/api/concrete.fhe.mlir.converter.md +++ b/docs/dev/api/concrete.fhe.mlir.converter.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.mlir.converter` Declaration of `Converter` class. @@ -12,17 +12,20 @@ Declaration of `Converter` class. --- - + ## class `Converter` Converter class, to convert a computation graph to MLIR. - + ### method `__init__` ```python -__init__(configuration: Configuration) +__init__( + configuration: Configuration, + composition_rules: Optional[Iterable[CompositionRule]] = None +) ``` @@ -34,7 +37,7 @@ __init__(configuration: Configuration) --- - + ### method `add` @@ -48,7 +51,7 @@ add(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `array` @@ -62,7 +65,21 @@ array(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + + +### method `assign_dynamic` + +```python +assign_dynamic(ctx: Context, node: Node, preds: List[Conversion]) → Conversion +``` + + + + + +--- + + ### method `assign_static` @@ -76,7 +93,7 @@ assign_static(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `bitwise_and` @@ -90,7 +107,7 @@ bitwise_and(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `bitwise_or` @@ -104,7 +121,7 @@ bitwise_or(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `bitwise_xor` @@ -118,7 +135,7 @@ bitwise_xor(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `broadcast_to` @@ -132,7 +149,7 @@ broadcast_to(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `concatenate` @@ -146,7 +163,7 @@ concatenate(ctx: Context, node: Node, preds: List[Conversion]) --- - + ### method `constant` @@ -160,7 +177,7 @@ constant(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `conv1d` @@ -174,7 +191,7 @@ conv1d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `conv2d` @@ -188,7 +205,7 @@ conv2d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `conv3d` @@ -202,7 +219,7 @@ conv3d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `convert` @@ -229,7 +246,7 @@ Return: MlirModule: In-memory MLIR module corresponding to the graph --- - + ### method `convert_many` @@ -250,7 +267,7 @@ Return: MlirModule: In-memory MLIR module corresponding to the graph --- - + ### method `copy` @@ -264,7 +281,7 @@ copy(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `dot` @@ -278,7 +295,7 @@ dot(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `dynamic_tlu` @@ -292,7 +309,7 @@ dynamic_tlu(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `equal` @@ -306,7 +323,7 @@ equal(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `expand_dims` @@ -320,7 +337,7 @@ expand_dims(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `extract_bit_pattern` @@ -338,7 +355,7 @@ extract_bit_pattern( --- - + ### method `greater` @@ -352,7 +369,7 @@ greater(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `greater_equal` @@ -366,7 +383,7 @@ greater_equal(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `identity` @@ -380,7 +397,21 @@ identity(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + + +### method `index_dynamic` + +```python +index_dynamic(ctx: Context, node: Node, preds: List[Conversion]) → Conversion +``` + + + + + +--- + + ### method `index_static` @@ -394,7 +425,7 @@ index_static(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `left_shift` @@ -408,7 +439,7 @@ left_shift(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `less` @@ -422,7 +453,7 @@ less(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `less_equal` @@ -436,7 +467,7 @@ less_equal(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `matmul` @@ -450,7 +481,7 @@ matmul(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `maximum` @@ -464,7 +495,7 @@ maximum(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `maxpool1d` @@ -478,7 +509,7 @@ maxpool1d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `maxpool2d` @@ -492,7 +523,7 @@ maxpool2d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `maxpool3d` @@ -506,7 +537,7 @@ maxpool3d(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `minimum` @@ -520,7 +551,7 @@ minimum(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `multiply` @@ -534,7 +565,7 @@ multiply(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `negative` @@ -548,7 +579,7 @@ negative(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `node` @@ -571,7 +602,7 @@ Return: Conversion: conversion object corresponding to node --- - + ### method `not_equal` @@ -585,7 +616,7 @@ not_equal(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `ones` @@ -599,7 +630,7 @@ ones(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `process` @@ -616,7 +647,7 @@ Process a computation graph for MLIR conversion. --- - + ### method `relu` @@ -630,7 +661,7 @@ relu(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `reshape` @@ -644,7 +675,7 @@ reshape(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `right_shift` @@ -658,7 +689,7 @@ right_shift(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `round_bit_pattern` @@ -676,7 +707,7 @@ round_bit_pattern( --- - + ### method `simplify_tag` @@ -688,7 +719,7 @@ Keep only `n` higher tag parts. --- - + ### method `squeeze` @@ -702,7 +733,7 @@ squeeze(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `stdout_with_ansi_support` @@ -714,7 +745,7 @@ Detect if ansi characters can be used (e.g. not the case in notebooks). --- - + ### method `subtract` @@ -728,7 +759,7 @@ subtract(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `sum` @@ -742,7 +773,39 @@ sum(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + + +### method `tfhers_from_native` + +```python +tfhers_from_native( + ctx: Context, + node: Node, + preds: List[Conversion] +) → Conversion +``` + + + + + +--- + + + +### method `tfhers_to_native` + +```python +tfhers_to_native(ctx: Context, node: Node, preds: List[Conversion]) → Conversion +``` + + + + + +--- + + ### method `tlu` @@ -756,7 +819,7 @@ tlu(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### classmethod `tlu_adjust` @@ -770,7 +833,7 @@ tlu_adjust(table, variable_input, target_bit_width, clipping, reduce_precision) --- - + ### classmethod `trace_progress` @@ -795,7 +858,7 @@ Add a trace_message for progress. --- - + ### method `transpose` @@ -809,7 +872,7 @@ transpose(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `truncate_bit_pattern` @@ -827,7 +890,7 @@ truncate_bit_pattern( --- - + ### method `where` @@ -841,7 +904,7 @@ where(ctx: Context, node: Node, preds: List[Conversion]) → Conversion --- - + ### method `zeros` diff --git a/docs/dev/api/concrete.fhe.mlir.md b/docs/dev/api/concrete.fhe.mlir.md index 3b04163963..4a2e730ff0 100644 --- a/docs/dev/api/concrete.fhe.mlir.md +++ b/docs/dev/api/concrete.fhe.mlir.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.mlir` Provide `computation graph` to `mlir` functionality. diff --git a/docs/dev/api/concrete.fhe.mlir.processors.assign_bit_widths.md b/docs/dev/api/concrete.fhe.mlir.processors.assign_bit_widths.md index 018237b086..3b8f9d7da8 100644 --- a/docs/dev/api/concrete.fhe.mlir.processors.assign_bit_widths.md +++ b/docs/dev/api/concrete.fhe.mlir.processors.assign_bit_widths.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.mlir.processors.assign_bit_widths` Declaration of `AssignBitWidths` graph processor. @@ -9,7 +9,7 @@ Declaration of `AssignBitWidths` graph processor. --- - + ## class `AssignBitWidths` AssignBitWidths graph processor, to assign proper bit-widths to be compatible with FHE. @@ -21,14 +21,14 @@ There are two modes: There is preference list for comparison strategies. - Strategies will be traversed in order and bit-widths will be assigned according to the first available strategy. - + ### method `__init__` ```python __init__( single_precision: bool, - composable: bool, + composition_rules: List[CompositionRule], comparison_strategy_preference: List[ComparisonStrategy], bitwise_strategy_preference: List[BitwiseStrategy], shifts_with_promotion: bool, @@ -46,7 +46,7 @@ __init__( --- - + ### method `apply_many` @@ -61,12 +61,12 @@ apply_many(graphs: Dict[str, Graph]) --- - + ## class `AdditionalConstraints` AdditionalConstraints class to customize bit-width assignment step easily. - + ### method `__init__` @@ -92,7 +92,7 @@ __init__( --- - + ### method `all_inputs_are_encrypted` @@ -106,7 +106,7 @@ all_inputs_are_encrypted(node: Node, preds: List[Node]) → bool --- - + ### method `bitwise` @@ -120,7 +120,7 @@ bitwise(node: Node, preds: List[Node]) --- - + ### method `comparison` @@ -134,7 +134,7 @@ comparison(node: Node, preds: List[Node]) --- - + ### method `constraint` @@ -148,7 +148,7 @@ constraint(node: Node, constraint: BoolRef) --- - + ### method `generate_for` @@ -167,7 +167,7 @@ Generate additional constraints for a node. --- - + ### method `has_overflow_protection` @@ -181,7 +181,7 @@ has_overflow_protection(node: Node, preds: List[Node]) → bool --- - + ### method `inputs_and_output_share_precision` @@ -195,7 +195,7 @@ inputs_and_output_share_precision(node: Node, preds: List[Node]) --- - + ### method `inputs_require_one_more_bit` @@ -209,7 +209,7 @@ inputs_require_one_more_bit(node: Node, preds: List[Node]) --- - + ### method `inputs_share_precision` @@ -223,7 +223,7 @@ inputs_share_precision(node: Node, preds: List[Node]) --- - + ### method `min_max` @@ -237,7 +237,7 @@ min_max(node: Node, preds: List[Node]) --- - + ### method `multivariate` @@ -251,7 +251,7 @@ multivariate(node: Node, preds: List[Node]) --- - + ### method `some_inputs_are_clear` diff --git a/docs/dev/api/concrete.fhe.mlir.processors.assign_node_ids.md b/docs/dev/api/concrete.fhe.mlir.processors.assign_node_ids.md new file mode 100644 index 0000000000..748d4ee05a --- /dev/null +++ b/docs/dev/api/concrete.fhe.mlir.processors.assign_node_ids.md @@ -0,0 +1,34 @@ + + + + +# module `concrete.fhe.mlir.processors.assign_node_ids` +Declaration of `AssignNodeIds` graph processor. + + + +--- + + + +## class `AssignNodeIds` +AssignNodeIds graph processor, to assign node id (%0, %1, etc.) to node properties. + + + + +--- + + + +### method `apply_many` + +```python +apply_many(graphs: Dict[str, Graph]) +``` + + + + + + diff --git a/docs/dev/api/concrete.fhe.mlir.processors.check_integer_only.md b/docs/dev/api/concrete.fhe.mlir.processors.check_integer_only.md index 8b3cadcade..acb97450b8 100644 --- a/docs/dev/api/concrete.fhe.mlir.processors.check_integer_only.md +++ b/docs/dev/api/concrete.fhe.mlir.processors.check_integer_only.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.mlir.processors.check_integer_only` Declaration of `CheckIntegerOnly` graph processor. @@ -9,7 +9,7 @@ Declaration of `CheckIntegerOnly` graph processor. --- - + ## class `CheckIntegerOnly` CheckIntegerOnly graph processor, to make sure the graph only contains integer nodes. @@ -19,7 +19,7 @@ CheckIntegerOnly graph processor, to make sure the graph only contains integer n --- - + ### method `apply` diff --git a/docs/dev/api/concrete.fhe.mlir.processors.md b/docs/dev/api/concrete.fhe.mlir.processors.md index 1ddc4d03e8..e3796ff2e4 100644 --- a/docs/dev/api/concrete.fhe.mlir.processors.md +++ b/docs/dev/api/concrete.fhe.mlir.processors.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.mlir.processors` All graph processors. @@ -8,6 +8,7 @@ All graph processors. **Global Variables** --------------- - **assign_bit_widths** +- **assign_node_ids** - **check_integer_only** - **process_rounding** diff --git a/docs/dev/api/concrete.fhe.mlir.processors.process_rounding.md b/docs/dev/api/concrete.fhe.mlir.processors.process_rounding.md index af4858577f..767e2386e9 100644 --- a/docs/dev/api/concrete.fhe.mlir.processors.process_rounding.md +++ b/docs/dev/api/concrete.fhe.mlir.processors.process_rounding.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.mlir.processors.process_rounding` Declaration of `ProcessRounding` graph processor. @@ -9,12 +9,12 @@ Declaration of `ProcessRounding` graph processor. --- - + ## class `ProcessRounding` ProcessRounding graph processor, to analyze rounding and support regular operations on it. - + ### method `__init__` @@ -31,7 +31,7 @@ __init__(rounding_exactness: Exactness) --- - + ### method `apply` @@ -45,7 +45,7 @@ apply(graph: Graph) --- - + ### method `process_predecessors` @@ -57,7 +57,7 @@ Process predecessors of the rounding. --- - + ### method `process_successors` @@ -69,7 +69,7 @@ Process successors of the rounding. --- - + ### method `replace_with_tlu` diff --git a/docs/dev/api/concrete.fhe.mlir.utils.md b/docs/dev/api/concrete.fhe.mlir.utils.md index 47f7f87066..94e5ee4c75 100644 --- a/docs/dev/api/concrete.fhe.mlir.utils.md +++ b/docs/dev/api/concrete.fhe.mlir.utils.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.mlir.utils` Declaration of various functions and constants related to MLIR conversion. @@ -11,7 +11,7 @@ Declaration of various functions and constants related to MLIR conversion. --- - + ## function `flood_replace_none_values` @@ -29,7 +29,7 @@ Use flooding algorithm to replace `None` values. --- - + ## function `construct_table_multivariate` @@ -54,7 +54,7 @@ Construct the lookup table for a multivariate node. --- - + ## function `construct_table` @@ -85,7 +85,7 @@ Construct the lookup table for an Operation.Generic node. --- - + ## function `construct_deduplicated_tables` @@ -132,12 +132,12 @@ means the lookup on 3x2 input will result in --- - + ## class `HashableNdarray` HashableNdarray class, to use numpy arrays in dictionaries. - + ### method `__init__` @@ -155,7 +155,7 @@ __init__(array: ndarray) --- - + ## class `Comparison` Comparison enum, to store the result comparison in 2-bits as there are three possible outcomes. diff --git a/docs/dev/api/concrete.fhe.representation.evaluator.md b/docs/dev/api/concrete.fhe.representation.evaluator.md index 97194330a1..ca215a459a 100644 --- a/docs/dev/api/concrete.fhe.representation.evaluator.md +++ b/docs/dev/api/concrete.fhe.representation.evaluator.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.representation.evaluator` Declaration of various `Evaluator` classes, to make graphs picklable. @@ -9,12 +9,12 @@ Declaration of various `Evaluator` classes, to make graphs picklable. --- - + ## class `ConstantEvaluator` ConstantEvaluator class, to evaluate Operation.Constant nodes. - + ### method `__init__` @@ -32,7 +32,7 @@ __init__(properties) --- - + ## class `InputEvaluator` InputEvaluator class, to evaluate Operation.Input nodes. @@ -43,12 +43,12 @@ InputEvaluator class, to evaluate Operation.Input nodes. --- - + ## class `GenericEvaluator` GenericEvaluator class, to evaluate Operation.Generic nodes. - + ### method `__init__` @@ -66,12 +66,12 @@ __init__(operation, properties) --- - + ## class `GenericTupleEvaluator` GenericEvaluator class, to evaluate Operation.Generic nodes where args are packed in a tuple. - + ### method `__init__` diff --git a/docs/dev/api/concrete.fhe.representation.graph.md b/docs/dev/api/concrete.fhe.representation.graph.md index d940c7948b..7794c3d2c8 100644 --- a/docs/dev/api/concrete.fhe.representation.graph.md +++ b/docs/dev/api/concrete.fhe.representation.graph.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.representation.graph` Declaration of `Graph` class. @@ -12,12 +12,12 @@ Declaration of `Graph` class. --- - + ## class `Graph` Graph class, to represent computation graphs. - + ### method `__init__` @@ -36,11 +36,23 @@ __init__( +--- + +#### property inputs_count + +Returns the number of inputs of the graph. + +--- + +#### property outputs_count + +Returns the number of outputs of the graph. + --- - + ### method `draw` @@ -74,7 +86,7 @@ That this function requires the python `pygraphviz` package which itself require --- - + ### method `evaluate` @@ -101,7 +113,7 @@ Perform the computation `Graph` represents and get resulting values for all node --- - + ### method `format` @@ -146,7 +158,7 @@ Get the textual representation of the `Graph`. --- - + ### method `format_bit_width_assignments` @@ -163,7 +175,7 @@ Get the textual representation of bit width assignments of the graph. --- - + ### method `format_bit_width_constraints` @@ -180,7 +192,7 @@ Get the textual representation of bit width constraints of the graph. --- - + ### method `integer_range` @@ -215,7 +227,7 @@ Only nodes after filtering will be used to calculate the result. --- - + ### method `maximum_integer_bit_width` @@ -253,7 +265,7 @@ Only nodes after filtering will be used to calculate the result. --- - + ### method `measure_bounds` @@ -291,7 +303,7 @@ e.g., --- - + ### method `ordered_inputs` @@ -308,7 +320,7 @@ Get the input nodes of the `Graph`, ordered by their indices. --- - + ### method `ordered_outputs` @@ -325,7 +337,7 @@ Get the output nodes of the `Graph`, ordered by their indices. --- - + ### method `ordered_preds_of` @@ -347,7 +359,7 @@ Get predecessors of `node`, ordered by their indices. --- - + ### method `prune_useless_nodes` @@ -359,7 +371,7 @@ Remove unreachable nodes from the graph. --- - + ### method `query_nodes` @@ -397,7 +409,7 @@ Filters work like so: str -> nodes without exact match is skipped List[str] -> --- - + ### method `update_with_bounds` @@ -415,7 +427,7 @@ Update `ValueDescription`s within the `Graph` according to measured bounds. --- - + ## class `GraphProcessor` GraphProcessor base class, to define the API for a graph processing pipeline. @@ -427,7 +439,7 @@ Process a single graph. --- - + ### method `apply` @@ -439,7 +451,7 @@ Process the graph. --- - + ### method `error` @@ -459,7 +471,7 @@ Fail processing with an error. --- - + ## class `MultiGraphProcessor` MultiGraphProcessor base class, to define the API for a multiple graph processing pipeline. @@ -471,7 +483,7 @@ Processes multiple graphs at once. --- - + ### method `apply` @@ -483,7 +495,7 @@ Process a single graph. --- - + ### method `apply_many` @@ -495,7 +507,7 @@ Process a dictionnary of graphs. --- - + ### method `error` diff --git a/docs/dev/api/concrete.fhe.representation.md b/docs/dev/api/concrete.fhe.representation.md index 32d92b74d7..5103c358a4 100644 --- a/docs/dev/api/concrete.fhe.representation.md +++ b/docs/dev/api/concrete.fhe.representation.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.representation` Define structures used to represent computation. diff --git a/docs/dev/api/concrete.fhe.representation.node.md b/docs/dev/api/concrete.fhe.representation.node.md index 1326e437a2..a681f93b50 100644 --- a/docs/dev/api/concrete.fhe.representation.node.md +++ b/docs/dev/api/concrete.fhe.representation.node.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.representation.node` Declaration of `Node` class. @@ -13,12 +13,12 @@ Declaration of `Node` class. --- - + ## class `Node` Node class, to represent computation in a computation graph. - + ### method `__init__` @@ -74,7 +74,7 @@ Get whether the node is can be fused into a table lookup. --- - + ### method `constant` @@ -101,7 +101,7 @@ Create an Operation.Constant node. --- - + ### method `format` @@ -125,7 +125,7 @@ Get the textual representation of the `Node` (dependent to preds). --- - + ### method `generic` @@ -167,7 +167,7 @@ Create an Operation.Generic node. --- - + ### method `input` @@ -191,7 +191,7 @@ Create an Operation.Input node. --- - + ### method `label` diff --git a/docs/dev/api/concrete.fhe.representation.operation.md b/docs/dev/api/concrete.fhe.representation.operation.md index f720a6f13e..53444dc114 100644 --- a/docs/dev/api/concrete.fhe.representation.operation.md +++ b/docs/dev/api/concrete.fhe.representation.operation.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.representation.operation` Declaration of `Operation` enum. @@ -9,7 +9,7 @@ Declaration of `Operation` enum. --- - + ## class `Operation` Operation enum, to distinguish nodes within a computation graph. diff --git a/docs/dev/api/concrete.fhe.representation.utils.md b/docs/dev/api/concrete.fhe.representation.utils.md index a07807aea8..b2b902110d 100644 --- a/docs/dev/api/concrete.fhe.representation.utils.md +++ b/docs/dev/api/concrete.fhe.representation.utils.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.representation.utils` Declaration of various functions and constants related to representation of computation. @@ -13,7 +13,7 @@ Declaration of various functions and constants related to representation of comp --- - + ## function `format_constant` @@ -44,7 +44,7 @@ Get the textual representation of a constant. --- - + ## function `format_indexing_element` diff --git a/docs/dev/api/concrete.fhe.tfhers.dtypes.md b/docs/dev/api/concrete.fhe.tfhers.dtypes.md new file mode 100644 index 0000000000..1c3519a667 --- /dev/null +++ b/docs/dev/api/concrete.fhe.tfhers.dtypes.md @@ -0,0 +1,98 @@ + + + + +# module `concrete.fhe.tfhers.dtypes` +Declaration of `TFHERSIntegerType` class. + +**Global Variables** +--------------- +- **int8_2_2** +- **uint8_2_2** +- **int16_2_2** +- **uint16_2_2** + + +--- + + + +## class `TFHERSIntegerType` +TFHERSIntegerType (Subclass of Integer) to represent tfhers integer types. + + + +### method `__init__` + +```python +__init__(is_signed: bool, bit_width: int, carry_width: int, msg_width: int) +``` + + + + + + + + +--- + + + +### method `decode` + +```python +decode(value: ndarray) → Union[int, ndarray] +``` + +Decode a tfhers-encoded integer (scalar or tensor). + + + +**Args:** + + - `value` (np.ndarray): encoded value + + + +**Raises:** + + - `ValueError`: bad encoding + + + +**Returns:** + + - `Union[int, np.ndarray]`: decoded value + +--- + + + +### method `encode` + +```python +encode(value: Union[int, integer, ndarray]) → ndarray +``` + +Encode a scalar or tensor to tfhers integers. + + + +**Args:** + + - `value` (Union[int, np.ndarray]): scalar or tensor of integer to encode + + + +**Raises:** + + - `TypeError`: wrong value type + + + +**Returns:** + + - `np.ndarray`: encoded scalar or tensor + + diff --git a/docs/dev/api/concrete.fhe.tfhers.md b/docs/dev/api/concrete.fhe.tfhers.md new file mode 100644 index 0000000000..60fe1740ee --- /dev/null +++ b/docs/dev/api/concrete.fhe.tfhers.md @@ -0,0 +1,14 @@ + + + + +# module `concrete.fhe.tfhers` +tfhers module to represent, and compute on tfhers integer values. + +**Global Variables** +--------------- +- **dtypes** +- **values** +- **tracing** + + diff --git a/docs/dev/api/concrete.fhe.tfhers.tracing.md b/docs/dev/api/concrete.fhe.tfhers.tracing.md new file mode 100644 index 0000000000..a23d6d6f13 --- /dev/null +++ b/docs/dev/api/concrete.fhe.tfhers.tracing.md @@ -0,0 +1,69 @@ + + + + +# module `concrete.fhe.tfhers.tracing` +Tracing of tfhers operations. + + +--- + + + +## function `to_native` + +```python +to_native(value: Union[Tracer, TFHERSInteger]) → Union[Tracer, int, ndarray] +``` + +Convert a tfhers integer to the Concrete representation. + + + +**Args:** + + - `value` (Union[Tracer, TFHERSInteger]): tfhers integer + + + +**Raises:** + + - `TypeError`: wrong input type + + + +**Returns:** + + - `Union[Tracer, int, ndarray]`: Tracer if the input is a tracer. int or ndarray otherwise. + + +--- + + + +## function `from_native` + +```python +from_native( + value: Union[Tracer, int, ndarray], + dtype_to: TFHERSIntegerType +) → Union[Tracer, int, ndarray] +``` + +Convert a Concrete integer to the tfhers representation. + +The returned value isn't wrapped in a TFHERSInteger, but should have its representation. + + + +**Args:** + + - `value` (Union[Tracer, int, ndarray]): Concrete value to convert to tfhers + - `dtype_to` (TFHERSIntegerType): tfhers integer type to convert to + + + +**Returns:** + Union[Tracer, int, ndarray] + + diff --git a/docs/dev/api/concrete.fhe.tfhers.values.md b/docs/dev/api/concrete.fhe.tfhers.values.md new file mode 100644 index 0000000000..ea399e063e --- /dev/null +++ b/docs/dev/api/concrete.fhe.tfhers.values.md @@ -0,0 +1,100 @@ + + + + +# module `concrete.fhe.tfhers.values` +Declaration of `TFHERSInteger` which wraps values as being of tfhers types. + + + +--- + + + +## class `TFHERSInteger` +Wrap integer values (scalar or arrays) into typed values, using tfhers types. + + + +### method `__init__` + +```python +__init__(dtype: TFHERSIntegerType, value: Union[List, int, ndarray]) +``` + + + + + + +--- + +#### property dtype + +Get the type of the wrapped value. + + + +**Returns:** + TFHERSIntegerType + +--- + +#### property shape + +Get the shape of the wrapped value. + + + +**Returns:** + + - `tuple`: shape + +--- + +#### property value + +Get the wrapped value. + + + +**Returns:** + Union[int, np.ndarray] + + + +--- + + + +### method `max` + +```python +max() +``` + +Get the maximum value that can be represented by the current type. + + + +**Returns:** + int: maximum value that can be represented by the current type + +--- + + + +### method `min` + +```python +min() +``` + +Get the minimum value that can be represented by the current type. + + + +**Returns:** + int: minimum value that can be represented by the current type + + diff --git a/docs/dev/api/concrete.fhe.tracing.md b/docs/dev/api/concrete.fhe.tracing.md index f82f03566a..7f1743c5a3 100644 --- a/docs/dev/api/concrete.fhe.tracing.md +++ b/docs/dev/api/concrete.fhe.tracing.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.tracing` Provide `function` to `computation graph` functionality. diff --git a/docs/dev/api/concrete.fhe.tracing.tracer.md b/docs/dev/api/concrete.fhe.tracing.tracer.md index 5f119b2f2f..3febee3306 100644 --- a/docs/dev/api/concrete.fhe.tracing.tracer.md +++ b/docs/dev/api/concrete.fhe.tracing.tracer.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.tracing.tracer` Declaration of `Tracer` class. @@ -9,12 +9,12 @@ Declaration of `Tracer` class. --- - + ## class `Tracer` Tracer class, to create computation graphs from python functions. - + ### method `__init__` @@ -55,7 +55,7 @@ Trace numpy.ndarray.size. --- - + ### method `astype` @@ -69,7 +69,7 @@ Trace numpy.ndarray.astype(dtype). --- - + ### method `clip` @@ -81,7 +81,7 @@ Trace numpy.ndarray.clip(). --- - + ### method `dot` @@ -93,7 +93,7 @@ Trace numpy.ndarray.dot(). --- - + ### method `flatten` @@ -105,7 +105,7 @@ Trace numpy.ndarray.flatten(). --- - + ### method `reshape` @@ -117,7 +117,7 @@ Trace numpy.ndarray.reshape(newshape). --- - + ### method `round` @@ -129,7 +129,7 @@ Trace numpy.ndarray.round(). --- - + ### method `sanitize` @@ -151,7 +151,7 @@ Try to create a tracer from a value. --- - + ### method `trace` @@ -184,7 +184,7 @@ Trace `function` and create the `Graph` that represents it. --- - + ### method `transpose` @@ -197,12 +197,12 @@ Trace numpy.ndarray.transpose(). --- - + ## class `Annotation` Base annotation for direct definition. - + ### method `__init__` @@ -243,7 +243,7 @@ Trace numpy.ndarray.size. --- - + ### method `astype` @@ -257,7 +257,7 @@ Trace numpy.ndarray.astype(dtype). --- - + ### method `clip` @@ -269,7 +269,7 @@ Trace numpy.ndarray.clip(). --- - + ### method `dot` @@ -281,7 +281,7 @@ Trace numpy.ndarray.dot(). --- - + ### method `flatten` @@ -293,7 +293,7 @@ Trace numpy.ndarray.flatten(). --- - + ### method `reshape` @@ -305,7 +305,7 @@ Trace numpy.ndarray.reshape(newshape). --- - + ### method `round` @@ -317,7 +317,7 @@ Trace numpy.ndarray.round(). --- - + ### method `sanitize` @@ -339,7 +339,7 @@ Try to create a tracer from a value. --- - + ### method `trace` @@ -372,7 +372,7 @@ Trace `function` and create the `Graph` that represents it. --- - + ### method `transpose` @@ -385,12 +385,12 @@ Trace numpy.ndarray.transpose(). --- - + ## class `ScalarAnnotation` Base scalar annotation for direct definition. - + ### method `__init__` @@ -431,7 +431,7 @@ Trace numpy.ndarray.size. --- - + ### method `astype` @@ -445,7 +445,7 @@ Trace numpy.ndarray.astype(dtype). --- - + ### method `clip` @@ -457,7 +457,7 @@ Trace numpy.ndarray.clip(). --- - + ### method `dot` @@ -469,7 +469,7 @@ Trace numpy.ndarray.dot(). --- - + ### method `flatten` @@ -481,7 +481,7 @@ Trace numpy.ndarray.flatten(). --- - + ### method `reshape` @@ -493,7 +493,7 @@ Trace numpy.ndarray.reshape(newshape). --- - + ### method `round` @@ -505,7 +505,7 @@ Trace numpy.ndarray.round(). --- - + ### method `sanitize` @@ -527,7 +527,7 @@ Try to create a tracer from a value. --- - + ### method `trace` @@ -560,7 +560,7 @@ Trace `function` and create the `Graph` that represents it. --- - + ### method `transpose` @@ -573,12 +573,12 @@ Trace numpy.ndarray.transpose(). --- - + ## class `TensorAnnotation` Base tensor annotation for direct definition. - + ### method `__init__` @@ -619,7 +619,7 @@ Trace numpy.ndarray.size. --- - + ### method `astype` @@ -633,7 +633,7 @@ Trace numpy.ndarray.astype(dtype). --- - + ### method `clip` @@ -645,7 +645,7 @@ Trace numpy.ndarray.clip(). --- - + ### method `dot` @@ -657,7 +657,7 @@ Trace numpy.ndarray.dot(). --- - + ### method `flatten` @@ -669,7 +669,7 @@ Trace numpy.ndarray.flatten(). --- - + ### method `reshape` @@ -681,7 +681,7 @@ Trace numpy.ndarray.reshape(newshape). --- - + ### method `round` @@ -693,7 +693,7 @@ Trace numpy.ndarray.round(). --- - + ### method `sanitize` @@ -715,7 +715,7 @@ Try to create a tracer from a value. --- - + ### method `trace` @@ -748,7 +748,7 @@ Trace `function` and create the `Graph` that represents it. --- - + ### method `transpose` diff --git a/docs/dev/api/concrete.fhe.tracing.typing.md b/docs/dev/api/concrete.fhe.tracing.typing.md index 3ae3c47f57..06551b51b9 100644 --- a/docs/dev/api/concrete.fhe.tracing.typing.md +++ b/docs/dev/api/concrete.fhe.tracing.typing.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.tracing.typing` Declaration of type annotation. @@ -9,7 +9,7 @@ Declaration of type annotation. --- - + ## class `f32` Scalar f32 annotation. @@ -44,7 +44,7 @@ Trace numpy.ndarray.size. --- - + ## class `f64` Scalar f64 annotation. @@ -79,7 +79,7 @@ Trace numpy.ndarray.size. --- - + ## class `int1` Scalar int1 annotation. @@ -114,7 +114,7 @@ Trace numpy.ndarray.size. --- - + ## class `int2` Scalar int2 annotation. @@ -149,7 +149,7 @@ Trace numpy.ndarray.size. --- - + ## class `int3` Scalar int3 annotation. @@ -184,7 +184,7 @@ Trace numpy.ndarray.size. --- - + ## class `int4` Scalar int4 annotation. @@ -219,7 +219,7 @@ Trace numpy.ndarray.size. --- - + ## class `int5` Scalar int5 annotation. @@ -254,7 +254,7 @@ Trace numpy.ndarray.size. --- - + ## class `int6` Scalar int6 annotation. @@ -289,7 +289,7 @@ Trace numpy.ndarray.size. --- - + ## class `int7` Scalar int7 annotation. @@ -324,7 +324,7 @@ Trace numpy.ndarray.size. --- - + ## class `int8` Scalar int8 annotation. @@ -359,7 +359,7 @@ Trace numpy.ndarray.size. --- - + ## class `int9` Scalar int9 annotation. @@ -394,7 +394,7 @@ Trace numpy.ndarray.size. --- - + ## class `int10` Scalar int10 annotation. @@ -429,7 +429,7 @@ Trace numpy.ndarray.size. --- - + ## class `int11` Scalar int11 annotation. @@ -464,7 +464,7 @@ Trace numpy.ndarray.size. --- - + ## class `int12` Scalar int12 annotation. @@ -499,7 +499,7 @@ Trace numpy.ndarray.size. --- - + ## class `int13` Scalar int13 annotation. @@ -534,7 +534,7 @@ Trace numpy.ndarray.size. --- - + ## class `int14` Scalar int14 annotation. @@ -569,7 +569,7 @@ Trace numpy.ndarray.size. --- - + ## class `int15` Scalar int15 annotation. @@ -604,7 +604,7 @@ Trace numpy.ndarray.size. --- - + ## class `int16` Scalar int16 annotation. @@ -639,7 +639,7 @@ Trace numpy.ndarray.size. --- - + ## class `int17` Scalar int17 annotation. @@ -674,7 +674,7 @@ Trace numpy.ndarray.size. --- - + ## class `int18` Scalar int18 annotation. @@ -709,7 +709,7 @@ Trace numpy.ndarray.size. --- - + ## class `int19` Scalar int19 annotation. @@ -744,7 +744,7 @@ Trace numpy.ndarray.size. --- - + ## class `int20` Scalar int20 annotation. @@ -779,7 +779,7 @@ Trace numpy.ndarray.size. --- - + ## class `int21` Scalar int21 annotation. @@ -814,7 +814,7 @@ Trace numpy.ndarray.size. --- - + ## class `int22` Scalar int22 annotation. @@ -849,7 +849,7 @@ Trace numpy.ndarray.size. --- - + ## class `int23` Scalar int23 annotation. @@ -884,7 +884,7 @@ Trace numpy.ndarray.size. --- - + ## class `int24` Scalar int24 annotation. @@ -919,7 +919,7 @@ Trace numpy.ndarray.size. --- - + ## class `int25` Scalar int25 annotation. @@ -954,7 +954,7 @@ Trace numpy.ndarray.size. --- - + ## class `int26` Scalar int26 annotation. @@ -989,7 +989,7 @@ Trace numpy.ndarray.size. --- - + ## class `int27` Scalar int27 annotation. @@ -1024,7 +1024,7 @@ Trace numpy.ndarray.size. --- - + ## class `int28` Scalar int28 annotation. @@ -1059,7 +1059,7 @@ Trace numpy.ndarray.size. --- - + ## class `int29` Scalar int29 annotation. @@ -1094,7 +1094,7 @@ Trace numpy.ndarray.size. --- - + ## class `int30` Scalar int30 annotation. @@ -1129,7 +1129,7 @@ Trace numpy.ndarray.size. --- - + ## class `int31` Scalar int31 annotation. @@ -1164,7 +1164,7 @@ Trace numpy.ndarray.size. --- - + ## class `int32` Scalar int32 annotation. @@ -1199,7 +1199,7 @@ Trace numpy.ndarray.size. --- - + ## class `int33` Scalar int33 annotation. @@ -1234,7 +1234,7 @@ Trace numpy.ndarray.size. --- - + ## class `int34` Scalar int34 annotation. @@ -1269,7 +1269,7 @@ Trace numpy.ndarray.size. --- - + ## class `int35` Scalar int35 annotation. @@ -1304,7 +1304,7 @@ Trace numpy.ndarray.size. --- - + ## class `int36` Scalar int36 annotation. @@ -1339,7 +1339,7 @@ Trace numpy.ndarray.size. --- - + ## class `int37` Scalar int37 annotation. @@ -1374,7 +1374,7 @@ Trace numpy.ndarray.size. --- - + ## class `int38` Scalar int38 annotation. @@ -1409,7 +1409,7 @@ Trace numpy.ndarray.size. --- - + ## class `int39` Scalar int39 annotation. @@ -1444,7 +1444,7 @@ Trace numpy.ndarray.size. --- - + ## class `int40` Scalar int40 annotation. @@ -1479,7 +1479,7 @@ Trace numpy.ndarray.size. --- - + ## class `int41` Scalar int41 annotation. @@ -1514,7 +1514,7 @@ Trace numpy.ndarray.size. --- - + ## class `int42` Scalar int42 annotation. @@ -1549,7 +1549,7 @@ Trace numpy.ndarray.size. --- - + ## class `int43` Scalar int43 annotation. @@ -1584,7 +1584,7 @@ Trace numpy.ndarray.size. --- - + ## class `int44` Scalar int44 annotation. @@ -1619,7 +1619,7 @@ Trace numpy.ndarray.size. --- - + ## class `int45` Scalar int45 annotation. @@ -1654,7 +1654,7 @@ Trace numpy.ndarray.size. --- - + ## class `int46` Scalar int46 annotation. @@ -1689,7 +1689,7 @@ Trace numpy.ndarray.size. --- - + ## class `int47` Scalar int47 annotation. @@ -1724,7 +1724,7 @@ Trace numpy.ndarray.size. --- - + ## class `int48` Scalar int48 annotation. @@ -1759,7 +1759,7 @@ Trace numpy.ndarray.size. --- - + ## class `int49` Scalar int49 annotation. @@ -1794,7 +1794,7 @@ Trace numpy.ndarray.size. --- - + ## class `int50` Scalar int50 annotation. @@ -1829,7 +1829,7 @@ Trace numpy.ndarray.size. --- - + ## class `int51` Scalar int51 annotation. @@ -1864,7 +1864,7 @@ Trace numpy.ndarray.size. --- - + ## class `int52` Scalar int52 annotation. @@ -1899,7 +1899,7 @@ Trace numpy.ndarray.size. --- - + ## class `int53` Scalar int53 annotation. @@ -1934,7 +1934,7 @@ Trace numpy.ndarray.size. --- - + ## class `int54` Scalar int54 annotation. @@ -1969,7 +1969,7 @@ Trace numpy.ndarray.size. --- - + ## class `int55` Scalar int55 annotation. @@ -2004,7 +2004,7 @@ Trace numpy.ndarray.size. --- - + ## class `int56` Scalar int56 annotation. @@ -2039,7 +2039,7 @@ Trace numpy.ndarray.size. --- - + ## class `int57` Scalar int57 annotation. @@ -2074,7 +2074,7 @@ Trace numpy.ndarray.size. --- - + ## class `int58` Scalar int58 annotation. @@ -2109,7 +2109,7 @@ Trace numpy.ndarray.size. --- - + ## class `int59` Scalar int59 annotation. @@ -2144,7 +2144,7 @@ Trace numpy.ndarray.size. --- - + ## class `int60` Scalar int60 annotation. @@ -2179,7 +2179,7 @@ Trace numpy.ndarray.size. --- - + ## class `int61` Scalar int61 annotation. @@ -2214,7 +2214,7 @@ Trace numpy.ndarray.size. --- - + ## class `int62` Scalar int62 annotation. @@ -2249,7 +2249,7 @@ Trace numpy.ndarray.size. --- - + ## class `int63` Scalar int63 annotation. @@ -2284,7 +2284,7 @@ Trace numpy.ndarray.size. --- - + ## class `int64` Scalar int64 annotation. @@ -2319,7 +2319,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint1` Scalar uint1 annotation. @@ -2354,7 +2354,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint2` Scalar uint2 annotation. @@ -2389,7 +2389,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint3` Scalar uint3 annotation. @@ -2424,7 +2424,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint4` Scalar uint4 annotation. @@ -2459,7 +2459,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint5` Scalar uint5 annotation. @@ -2494,7 +2494,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint6` Scalar uint6 annotation. @@ -2529,7 +2529,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint7` Scalar uint7 annotation. @@ -2564,7 +2564,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint8` Scalar uint8 annotation. @@ -2599,7 +2599,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint9` Scalar uint9 annotation. @@ -2634,7 +2634,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint10` Scalar uint10 annotation. @@ -2669,7 +2669,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint11` Scalar uint11 annotation. @@ -2704,7 +2704,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint12` Scalar uint12 annotation. @@ -2739,7 +2739,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint13` Scalar uint13 annotation. @@ -2774,7 +2774,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint14` Scalar uint14 annotation. @@ -2809,7 +2809,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint15` Scalar uint15 annotation. @@ -2844,7 +2844,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint16` Scalar uint16 annotation. @@ -2879,7 +2879,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint17` Scalar uint17 annotation. @@ -2914,7 +2914,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint18` Scalar uint18 annotation. @@ -2949,7 +2949,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint19` Scalar uint19 annotation. @@ -2984,7 +2984,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint20` Scalar uint20 annotation. @@ -3019,7 +3019,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint21` Scalar uint21 annotation. @@ -3054,7 +3054,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint22` Scalar uint22 annotation. @@ -3089,7 +3089,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint23` Scalar uint23 annotation. @@ -3124,7 +3124,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint24` Scalar uint24 annotation. @@ -3159,7 +3159,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint25` Scalar uint25 annotation. @@ -3194,7 +3194,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint26` Scalar uint26 annotation. @@ -3229,7 +3229,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint27` Scalar uint27 annotation. @@ -3264,7 +3264,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint28` Scalar uint28 annotation. @@ -3299,7 +3299,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint29` Scalar uint29 annotation. @@ -3334,7 +3334,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint30` Scalar uint30 annotation. @@ -3369,7 +3369,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint31` Scalar uint31 annotation. @@ -3404,7 +3404,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint32` Scalar uint32 annotation. @@ -3439,7 +3439,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint33` Scalar uint33 annotation. @@ -3474,7 +3474,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint34` Scalar uint34 annotation. @@ -3509,7 +3509,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint35` Scalar uint35 annotation. @@ -3544,7 +3544,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint36` Scalar uint36 annotation. @@ -3579,7 +3579,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint37` Scalar uint37 annotation. @@ -3614,7 +3614,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint38` Scalar uint38 annotation. @@ -3649,7 +3649,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint39` Scalar uint39 annotation. @@ -3684,7 +3684,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint40` Scalar uint40 annotation. @@ -3719,7 +3719,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint41` Scalar uint41 annotation. @@ -3754,7 +3754,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint42` Scalar uint42 annotation. @@ -3789,7 +3789,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint43` Scalar uint43 annotation. @@ -3824,7 +3824,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint44` Scalar uint44 annotation. @@ -3859,7 +3859,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint45` Scalar uint45 annotation. @@ -3894,7 +3894,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint46` Scalar uint46 annotation. @@ -3929,7 +3929,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint47` Scalar uint47 annotation. @@ -3964,7 +3964,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint48` Scalar uint48 annotation. @@ -3999,7 +3999,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint49` Scalar uint49 annotation. @@ -4034,7 +4034,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint50` Scalar uint50 annotation. @@ -4069,7 +4069,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint51` Scalar uint51 annotation. @@ -4104,7 +4104,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint52` Scalar uint52 annotation. @@ -4139,7 +4139,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint53` Scalar uint53 annotation. @@ -4174,7 +4174,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint54` Scalar uint54 annotation. @@ -4209,7 +4209,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint55` Scalar uint55 annotation. @@ -4244,7 +4244,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint56` Scalar uint56 annotation. @@ -4279,7 +4279,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint57` Scalar uint57 annotation. @@ -4314,7 +4314,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint58` Scalar uint58 annotation. @@ -4349,7 +4349,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint59` Scalar uint59 annotation. @@ -4384,7 +4384,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint60` Scalar uint60 annotation. @@ -4419,7 +4419,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint61` Scalar uint61 annotation. @@ -4454,7 +4454,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint62` Scalar uint62 annotation. @@ -4489,7 +4489,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint63` Scalar uint63 annotation. @@ -4524,7 +4524,7 @@ Trace numpy.ndarray.size. --- - + ## class `uint64` Scalar uint64 annotation. @@ -4559,7 +4559,7 @@ Trace numpy.ndarray.size. --- - + ## class `tensor` Tensor annotation. diff --git a/docs/dev/api/concrete.fhe.values.md b/docs/dev/api/concrete.fhe.values.md index ca35526df8..89774aabbb 100644 --- a/docs/dev/api/concrete.fhe.values.md +++ b/docs/dev/api/concrete.fhe.values.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.values` Define the available values and their semantics. diff --git a/docs/dev/api/concrete.fhe.values.scalar.md b/docs/dev/api/concrete.fhe.values.scalar.md index 16627c605e..f7a58a9c78 100644 --- a/docs/dev/api/concrete.fhe.values.scalar.md +++ b/docs/dev/api/concrete.fhe.values.scalar.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.values.scalar` Declaration of `ClearScalar` and `EncryptedScalar` wrappers. @@ -8,7 +8,7 @@ Declaration of `ClearScalar` and `EncryptedScalar` wrappers. --- - + ## function `clear_scalar_builder` @@ -31,7 +31,7 @@ Build a clear scalar value. --- - + ## function `clear_scalar_builder` @@ -54,7 +54,7 @@ Build a clear scalar value. --- - + ## function `encrypted_scalar_builder` @@ -77,7 +77,7 @@ Build an encrypted scalar value. --- - + ## function `encrypted_scalar_builder` diff --git a/docs/dev/api/concrete.fhe.values.tensor.md b/docs/dev/api/concrete.fhe.values.tensor.md index 3e0fee849b..9db6267ce9 100644 --- a/docs/dev/api/concrete.fhe.values.tensor.md +++ b/docs/dev/api/concrete.fhe.values.tensor.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.values.tensor` Declaration of `ClearTensor` and `EncryptedTensor` wrappers. @@ -8,7 +8,7 @@ Declaration of `ClearTensor` and `EncryptedTensor` wrappers. --- - + ## function `clear_tensor_builder` @@ -36,7 +36,7 @@ Build a clear tensor value. --- - + ## function `clear_tensor_builder` @@ -64,7 +64,7 @@ Build a clear tensor value. --- - + ## function `encrypted_tensor_builder` @@ -92,7 +92,7 @@ Build an encrypted tensor value. --- - + ## function `encrypted_tensor_builder` diff --git a/docs/dev/api/concrete.fhe.values.value_description.md b/docs/dev/api/concrete.fhe.values.value_description.md index ffc5cae886..cac729d5c5 100644 --- a/docs/dev/api/concrete.fhe.values.value_description.md +++ b/docs/dev/api/concrete.fhe.values.value_description.md @@ -1,6 +1,6 @@ - + # module `concrete.fhe.values.value_description` Declaration of `ValueDescription` class. @@ -9,12 +9,12 @@ Declaration of `ValueDescription` class. --- - + ## class `ValueDescription` ValueDescription class, to combine data type, shape, and encryption status into a single object. - + ### method `__init__` @@ -75,7 +75,7 @@ Get number of elements in the value. --- - + ### method `of` diff --git a/docs/dev/api/concrete.fhe.version.md b/docs/dev/api/concrete.fhe.version.md index 9bbb3e6d5b..d6b4955cdc 100644 --- a/docs/dev/api/concrete.fhe.version.md +++ b/docs/dev/api/concrete.fhe.version.md @@ -1,11 +1,9 @@ - + # module `concrete.fhe.version` - - - +Version of the project, which is updated automatically by the CI right before releasing.