Skip to content

Commit 09dd6e4

Browse files
Prepare release 1.7.0 (#897)
Co-authored-by: andrei-stoian-zama <95410270+andrei-stoian-zama@users.noreply.github.com>
1 parent 384317a commit 09dd6e4

28 files changed

+1318
-553
lines changed

docs/references/api/README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
- [`concrete.ml.torch`](./concrete.ml.torch.md#module-concretemltorch): Modules for torch to numpy conversion.
5353
- [`concrete.ml.torch.compile`](./concrete.ml.torch.compile.md#module-concretemltorchcompile): torch compilation function.
5454
- [`concrete.ml.torch.hybrid_model`](./concrete.ml.torch.hybrid_model.md#module-concretemltorchhybrid_model): Implement the conversion of a torch model to a hybrid fhe/torch inference.
55+
- [`concrete.ml.torch.lora`](./concrete.ml.torch.lora.md#module-concretemltorchlora): This module contains classes for LoRA (Low-Rank Adaptation) training and custom layers.
5556
- [`concrete.ml.torch.numpy_module`](./concrete.ml.torch.numpy_module.md#module-concretemltorchnumpy_module): A torch to numpy module.
5657
- [`concrete.ml.version`](./concrete.ml.version.md#module-concretemlversion): File to manage the version of the package.
5758

@@ -79,6 +80,7 @@
7980
- [`torch_models.ConcatFancyIndexing`](./concrete.ml.pytest.torch_models.md#class-concatfancyindexing): Concat with fancy indexing.
8081
- [`torch_models.Conv1dModel`](./concrete.ml.pytest.torch_models.md#class-conv1dmodel): Small model that uses a 1D convolution operator.
8182
- [`torch_models.DoubleQuantQATMixNet`](./concrete.ml.pytest.torch_models.md#class-doublequantqatmixnet): Torch model that with two different quantizers on the input.
83+
- [`torch_models.EmbeddingModel`](./concrete.ml.pytest.torch_models.md#class-embeddingmodel): A torch model with an embedding layer.
8284
- [`torch_models.EncryptedMatrixMultiplicationModel`](./concrete.ml.pytest.torch_models.md#class-encryptedmatrixmultiplicationmodel): PyTorch module for performing matrix multiplication between two encrypted values.
8385
- [`torch_models.ExpandModel`](./concrete.ml.pytest.torch_models.md#class-expandmodel): Minimalist network that expands the input tensor to a larger size.
8486
- [`torch_models.FC`](./concrete.ml.pytest.torch_models.md#class-fc): Torch model for the tests.
@@ -108,6 +110,8 @@
108110
- [`torch_models.TinyCNN`](./concrete.ml.pytest.torch_models.md#class-tinycnn): A very small CNN.
109111
- [`torch_models.TinyQATCNN`](./concrete.ml.pytest.torch_models.md#class-tinyqatcnn): A very small QAT CNN to classify the sklearn digits data-set.
110112
- [`torch_models.TorchCustomModel`](./concrete.ml.pytest.torch_models.md#class-torchcustommodel): A small network with Brevitas, trained on make_classification.
113+
- [`torch_models.TorchDivide`](./concrete.ml.pytest.torch_models.md#class-torchdivide): Torch model that performs a encrypted division between two inputs.
114+
- [`torch_models.TorchMultiply`](./concrete.ml.pytest.torch_models.md#class-torchmultiply): Torch model that performs a encrypted multiplication between two inputs.
111115
- [`torch_models.TorchSum`](./concrete.ml.pytest.torch_models.md#class-torchsum): Torch model to test the ReduceSum ONNX operator in a leveled circuit.
112116
- [`torch_models.UnivariateModule`](./concrete.ml.pytest.torch_models.md#class-univariatemodule): Torch model that calls univariate and shape functions of torch.
113117
- [`base_quantized_op.QuantizedMixingOp`](./concrete.ml.quantization.base_quantized_op.md#class-quantizedmixingop): An operator that mixes (adds or multiplies) together encrypted inputs.
@@ -132,7 +136,7 @@
132136
- [`quantized_ops.QuantizedClip`](./concrete.ml.quantization.quantized_ops.md#class-quantizedclip): Quantized clip op.
133137
- [`quantized_ops.QuantizedConcat`](./concrete.ml.quantization.quantized_ops.md#class-quantizedconcat): Concatenate operator.
134138
- [`quantized_ops.QuantizedConv`](./concrete.ml.quantization.quantized_ops.md#class-quantizedconv): Quantized Conv op.
135-
- [`quantized_ops.QuantizedDiv`](./concrete.ml.quantization.quantized_ops.md#class-quantizeddiv): Div operator /.
139+
- [`quantized_ops.QuantizedDiv`](./concrete.ml.quantization.quantized_ops.md#class-quantizeddiv): Quantized Division operator.
136140
- [`quantized_ops.QuantizedElu`](./concrete.ml.quantization.quantized_ops.md#class-quantizedelu): Quantized Elu op.
137141
- [`quantized_ops.QuantizedEqual`](./concrete.ml.quantization.quantized_ops.md#class-quantizedequal): Comparison operator ==.
138142
- [`quantized_ops.QuantizedErf`](./concrete.ml.quantization.quantized_ops.md#class-quantizederf): Quantized erf op.
@@ -154,7 +158,7 @@
154158
- [`quantized_ops.QuantizedMax`](./concrete.ml.quantization.quantized_ops.md#class-quantizedmax): Quantized Max op.
155159
- [`quantized_ops.QuantizedMaxPool`](./concrete.ml.quantization.quantized_ops.md#class-quantizedmaxpool): Quantized Max Pooling op.
156160
- [`quantized_ops.QuantizedMin`](./concrete.ml.quantization.quantized_ops.md#class-quantizedmin): Quantized Min op.
157-
- [`quantized_ops.QuantizedMul`](./concrete.ml.quantization.quantized_ops.md#class-quantizedmul): Multiplication operator.
161+
- [`quantized_ops.QuantizedMul`](./concrete.ml.quantization.quantized_ops.md#class-quantizedmul): Quantized Multiplication operator.
158162
- [`quantized_ops.QuantizedNeg`](./concrete.ml.quantization.quantized_ops.md#class-quantizedneg): Quantized Neg op.
159163
- [`quantized_ops.QuantizedNot`](./concrete.ml.quantization.quantized_ops.md#class-quantizednot): Quantized Not op.
160164
- [`quantized_ops.QuantizedOr`](./concrete.ml.quantization.quantized_ops.md#class-quantizedor): Or operator ||.
@@ -222,6 +226,11 @@
222226
- [`hybrid_model.HybridFHEModelServer`](./concrete.ml.torch.hybrid_model.md#class-hybridfhemodelserver): Hybrid FHE Model Server.
223227
- [`hybrid_model.LoggerStub`](./concrete.ml.torch.hybrid_model.md#class-loggerstub): Placeholder type for a typical logger like the one from loguru.
224228
- [`hybrid_model.RemoteModule`](./concrete.ml.torch.hybrid_model.md#class-remotemodule): A wrapper class for the modules to be evaluated remotely with FHE.
229+
- [`lora.BackwardModuleLinear`](./concrete.ml.torch.lora.md#class-backwardmodulelinear): Backward module for linear layers.
230+
- [`lora.CustomLinear`](./concrete.ml.torch.lora.md#class-customlinear): Custom linear module.
231+
- [`lora.ForwardBackwardModule`](./concrete.ml.torch.lora.md#class-forwardbackwardmodule): Custom autograd function for forward and backward passes.
232+
- [`lora.ForwardModuleLinear`](./concrete.ml.torch.lora.md#class-forwardmodulelinear): Forward module for linear layers.
233+
- [`lora.LoraTraining`](./concrete.ml.torch.lora.md#class-loratraining): LoraTraining module for fine-tuning with LoRA in a hybrid model setting.
225234
- [`numpy_module.NumpyModule`](./concrete.ml.torch.numpy_module.md#class-numpymodule): General interface to transform a torch.nn.Module to numpy module.
226235

227236
## Functions
@@ -242,7 +251,10 @@
242251
- [`utils.all_values_are_integers`](./concrete.ml.common.utils.md#function-all_values_are_integers): Indicate if all unpacked values are of a supported integer dtype.
243252
- [`utils.all_values_are_of_dtype`](./concrete.ml.common.utils.md#function-all_values_are_of_dtype): Indicate if all unpacked values are of the specified dtype(s).
244253
- [`utils.array_allclose_and_same_shape`](./concrete.ml.common.utils.md#function-array_allclose_and_same_shape): Check if two numpy arrays are equal within a tolerances and have the same shape.
254+
- [`utils.check_compilation_device_is_valid_and_is_cuda`](./concrete.ml.common.utils.md#function-check_compilation_device_is_valid_and_is_cuda): Check whether the device string for compilation or FHE execution is CUDA or CPU.
255+
- [`utils.check_device_is_valid`](./concrete.ml.common.utils.md#function-check_device_is_valid): Check whether the device string is valid or raise an exception.
245256
- [`utils.check_dtype_and_cast`](./concrete.ml.common.utils.md#function-check_dtype_and_cast): Convert any allowed type into an array and cast it if required.
257+
- [`utils.check_execution_device_is_valid_and_is_cuda`](./concrete.ml.common.utils.md#function-check_execution_device_is_valid_and_is_cuda): Check whether the circuit can be executed on the required device.
246258
- [`utils.check_there_is_no_p_error_options_in_configuration`](./concrete.ml.common.utils.md#function-check_there_is_no_p_error_options_in_configuration): Check the user did not set p_error or global_p_error in configuration.
247259
- [`utils.compute_bits_precision`](./concrete.ml.common.utils.md#function-compute_bits_precision): Compute the number of bits required to represent x.
248260
- [`utils.generate_proxy_function`](./concrete.ml.common.utils.md#function-generate_proxy_function): Generate a proxy function for a function accepting only \*args type arguments.
@@ -265,19 +277,21 @@
265277
- [`convert.get_equivalent_numpy_forward_from_onnx`](./concrete.ml.onnx.convert.md#function-get_equivalent_numpy_forward_from_onnx): Get the numpy equivalent forward of the provided ONNX model.
266278
- [`convert.get_equivalent_numpy_forward_from_onnx_tree`](./concrete.ml.onnx.convert.md#function-get_equivalent_numpy_forward_from_onnx_tree): Get the numpy equivalent forward of the provided ONNX model for tree-based models only.
267279
- [`convert.get_equivalent_numpy_forward_from_torch`](./concrete.ml.onnx.convert.md#function-get_equivalent_numpy_forward_from_torch): Get the numpy equivalent forward of the provided torch Module.
268-
- [`convert.preprocess_onnx_model`](./concrete.ml.onnx.convert.md#function-preprocess_onnx_model): Get the numpy equivalent forward of the provided ONNX model.
280+
- [`convert.preprocess_onnx_model`](./concrete.ml.onnx.convert.md#function-preprocess_onnx_model): Preprocess the ONNX model to be used for numpy execution.
269281
- [`onnx_impl_utils.compute_conv_output_dims`](./concrete.ml.onnx.onnx_impl_utils.md#function-compute_conv_output_dims): Compute the output shape of a pool or conv operation.
270282
- [`onnx_impl_utils.compute_onnx_pool_padding`](./concrete.ml.onnx.onnx_impl_utils.md#function-compute_onnx_pool_padding): Compute any additional padding needed to compute pooling layers.
271283
- [`onnx_impl_utils.numpy_onnx_pad`](./concrete.ml.onnx.onnx_impl_utils.md#function-numpy_onnx_pad): Pad a tensor according to ONNX spec, using an optional custom pad value.
272284
- [`onnx_impl_utils.onnx_avgpool_compute_norm_const`](./concrete.ml.onnx.onnx_impl_utils.md#function-onnx_avgpool_compute_norm_const): Compute the average pooling normalization constant.
273285
- [`onnx_impl_utils.rounded_comparison`](./concrete.ml.onnx.onnx_impl_utils.md#function-rounded_comparison): Comparison operation using `round_bit_pattern` function.
274286
- [`onnx_model_manipulations.clean_graph_after_node_op_type`](./concrete.ml.onnx.onnx_model_manipulations.md#function-clean_graph_after_node_op_type): Remove the nodes following first node matching node_op_type from the ONNX graph.
275287
- [`onnx_model_manipulations.clean_graph_at_node_op_type`](./concrete.ml.onnx.onnx_model_manipulations.md#function-clean_graph_at_node_op_type): Remove the first node matching node_op_type and its following nodes from the ONNX graph.
288+
- [`onnx_model_manipulations.convert_first_gather_to_matmul`](./concrete.ml.onnx.onnx_model_manipulations.md#function-convert_first_gather_to_matmul): Convert the first Gather node to a matrix multiplication node.
276289
- [`onnx_model_manipulations.keep_following_outputs_discard_others`](./concrete.ml.onnx.onnx_model_manipulations.md#function-keep_following_outputs_discard_others): Keep the outputs given in outputs_to_keep and remove the others from the model.
277290
- [`onnx_model_manipulations.remove_identity_nodes`](./concrete.ml.onnx.onnx_model_manipulations.md#function-remove_identity_nodes): Remove identity nodes from a model.
278291
- [`onnx_model_manipulations.remove_node_types`](./concrete.ml.onnx.onnx_model_manipulations.md#function-remove_node_types): Remove unnecessary nodes from the ONNX graph.
279292
- [`onnx_model_manipulations.remove_unused_constant_nodes`](./concrete.ml.onnx.onnx_model_manipulations.md#function-remove_unused_constant_nodes): Remove unused Constant nodes in the provided onnx model.
280293
- [`onnx_model_manipulations.simplify_onnx_model`](./concrete.ml.onnx.onnx_model_manipulations.md#function-simplify_onnx_model): Simplify an ONNX model, removes unused Constant nodes and Identity nodes.
294+
- [`onnx_utils.check_onnx_model`](./concrete.ml.onnx.onnx_utils.md#function-check_onnx_model): Check an ONNX model, handling large models (>2GB) by using external data.
281295
- [`onnx_utils.execute_onnx_with_numpy`](./concrete.ml.onnx.onnx_utils.md#function-execute_onnx_with_numpy): Execute the provided ONNX graph on the given inputs.
282296
- [`onnx_utils.execute_onnx_with_numpy_trees`](./concrete.ml.onnx.onnx_utils.md#function-execute_onnx_with_numpy_trees): Execute the provided ONNX graph on the given inputs for tree-based models only.
283297
- [`onnx_utils.get_attribute`](./concrete.ml.onnx.onnx_utils.md#function-get_attribute): Get the attribute from an ONNX AttributeProto.
@@ -390,3 +404,4 @@
390404
- [`hybrid_model.convert_conv1d_to_linear`](./concrete.ml.torch.hybrid_model.md#function-convert_conv1d_to_linear): Convert all Conv1D layers in a module or a Conv1D layer itself to nn.Linear.
391405
- [`hybrid_model.tuple_to_underscore_str`](./concrete.ml.torch.hybrid_model.md#function-tuple_to_underscore_str): Convert a tuple to a string representation.
392406
- [`hybrid_model.underscore_str_to_tuple`](./concrete.ml.torch.hybrid_model.md#function-underscore_str_to_tuple): Convert a a string representation of a tuple to a tuple.
407+
- [`lora.get_remote_names`](./concrete.ml.torch.lora.md#function-get_remote_names): Get names of modules to be executed remotely.

docs/references/api/concrete.ml.common.serialization.decoder.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Custom decoder for serialization.
1616

1717
______________________________________________________________________
1818

19-
<a href="../../../src/concrete/ml/common/serialization/decoder.py#L104"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
19+
<a href="../../../src/concrete/ml/common/serialization/decoder.py#L105"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
2020

2121
## <kbd>function</kbd> `object_hook`
2222

@@ -42,13 +42,13 @@ If the input's type is non-native, then we expect it to have the following forma
4242

4343
______________________________________________________________________
4444

45-
<a href="../../../src/concrete/ml/common/serialization/decoder.py#L225"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
45+
<a href="../../../src/concrete/ml/common/serialization/decoder.py#L229"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
4646

4747
## <kbd>class</kbd> `ConcreteDecoder`
4848

4949
Custom json decoder to handle non-native types found in serialized Concrete ML objects.
5050

51-
<a href="../../../src/concrete/ml/common/serialization/decoder.py#L228"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
51+
<a href="../../../src/concrete/ml/common/serialization/decoder.py#L232"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
5252

5353
### <kbd>method</kbd> `__init__`
5454

docs/references/api/concrete.ml.common.serialization.encoder.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Custom encoder for serialization.
1313

1414
______________________________________________________________________
1515

16-
<a href="../../../src/concrete/ml/common/serialization/encoder.py#L33"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
16+
<a href="../../../src/concrete/ml/common/serialization/encoder.py#L34"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
1717

1818
## <kbd>function</kbd> `dump_name_and_value`
1919

@@ -35,7 +35,7 @@ Dump the value into a custom dict format.
3535

3636
______________________________________________________________________
3737

38-
<a href="../../../src/concrete/ml/common/serialization/encoder.py#L58"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
38+
<a href="../../../src/concrete/ml/common/serialization/encoder.py#L59"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
3939

4040
## <kbd>class</kbd> `ConcreteEncoder`
4141

@@ -49,7 +49,7 @@ The ConcreteEncoder is only meant to encode Concrete-ML's built-in models and th
4949

5050
______________________________________________________________________
5151

52-
<a href="../../../src/concrete/ml/common/serialization/encoder.py#L177"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
52+
<a href="../../../src/concrete/ml/common/serialization/encoder.py#L178"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
5353

5454
### <kbd>method</kbd> `default`
5555

@@ -73,7 +73,7 @@ Define a custom default method that enables dumping any supported serialized val
7373

7474
______________________________________________________________________
7575

76-
<a href="../../../src/concrete/ml/common/serialization/encoder.py#L76"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
76+
<a href="../../../src/concrete/ml/common/serialization/encoder.py#L77"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
7777

7878
### <kbd>method</kbd> `isinstance`
7979

@@ -96,7 +96,7 @@ Natively, among other types, the JSONENcoder handles integers, floating points a
9696

9797
______________________________________________________________________
9898

99-
<a href="../../../src/concrete/ml/common/serialization/encoder.py#L111"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
99+
<a href="../../../src/concrete/ml/common/serialization/encoder.py#L112"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
100100

101101
### <kbd>method</kbd> `iterencode`
102102

0 commit comments

Comments
 (0)