Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-stoian-zama committed Jan 29, 2025
1 parent f05b3f4 commit 81cad15
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 30 deletions.
15 changes: 7 additions & 8 deletions deps_licenses/licenses_linux_user.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ brevitas, 0.10.2, UNKNOWN
certifi, 2024.12.14, Mozilla Public License 2.0 (MPL 2.0)
charset-normalizer, 3.4.1, MIT License
coloredlogs, 15.0.1, MIT License
concrete-ml-extensions, 0.1.4, BSD-3-Clause-Clear
concrete-python, 2.9.0, BSD-3-Clause
concrete-ml-extensions, 0.1.5, BSD-3-Clause-Clear
concrete-python, 2.9.0rc2.dev20250128, BSD-3-Clause
dependencies, 2.0.1, BSD License
dill, 0.3.9, BSD License
filelock, 3.16.1, The Unlicense (Unlicense)
flatbuffers, 24.12.23, Apache Software License
flatbuffers, 25.1.24, Apache Software License
fsspec, 2024.12.0, BSD License
huggingface-hub, 0.27.1, Apache Software License
huggingface-hub, 0.28.0, Apache Software License
humanfriendly, 10.0, MIT License
hummingbird-ml, 0.4.11, MIT License
idna, 3.10, BSD License
Expand All @@ -33,7 +33,7 @@ nvidia-curand-cu12, 10.3.2.106, Other/Proprietary License
nvidia-cusolver-cu12, 11.4.5.107, Other/Proprietary License
nvidia-cusparse-cu12, 12.1.0.106, Other/Proprietary License
nvidia-nccl-cu12, 2.20.5, Other/Proprietary License
nvidia-nvjitlink-cu12, 12.6.85, Other/Proprietary License
nvidia-nvjitlink-cu12, 12.8.61, Other/Proprietary License
nvidia-nvtx-cu12, 12.1.105, Other/Proprietary License
onnx, 1.17.0, Apache License v2.0
onnxconverter-common, 1.13.0, MIT License
Expand All @@ -42,7 +42,7 @@ onnxoptimizer, 0.3.13, Apache License v2.0
onnxruntime, 1.18.0, MIT License
packaging, 24.2, Apache Software License; BSD License
pandas, 2.0.3, BSD License
protobuf, 3.20.3, BSD-3-Clause
protobuf, 5.29.3, 3-Clause BSD License
psutil, 5.9.8, BSD License
python-dateutil, 2.9.0.post0, Apache Software License; BSD License
pytz, 2024.2, MIT License
Expand All @@ -58,9 +58,8 @@ tabulate, 0.8.10, MIT License
threadpoolctl, 3.5.0, BSD License
torch, 2.3.1, BSD License
tqdm, 4.67.1, MIT License; Mozilla Public License 2.0 (MPL 2.0)
triton, 2.3.1, MIT License
typing_extensions, 4.12.2, Python Software Foundation License
tzdata, 2024.2, Apache Software License
tzdata, 2025.1, Apache Software License
unfoldNd, 0.2.3, MIT License
urllib3, 2.2.3, MIT License
xgboost, 1.6.2, Apache Software License
Expand Down
2 changes: 1 addition & 1 deletion deps_licenses/licenses_linux_user.txt.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6c9432ce0ab521acdbdda0c5d449fad4
05f0be957df3f4c282a9ed4378c7ce85
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ python = ">=3.8.1,<3.13"
# source, so we should only use this for Concrete Python's non-public releases
# https://python-poetry.org/docs/1.7/repositories#project-configuration
# concrete-python = {version="==2.7.0", source = "zama-pypi-cpu"}
concrete-ml-extensions = "0.1.4"
concrete-python = {version="==2.9.0", source = "zama-pypi-cpu"}
concrete-ml-extensions = "0.1.5"
concrete-python = {version="==2.9.0rc2.dev20250128", source = "zama-pypi-cpu"}
setuptools = "75.3.0"
skops = {version = "0.5.0"}
xgboost = "1.6.2"
Expand Down
25 changes: 6 additions & 19 deletions src/concrete/ml/sklearn/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,34 +711,18 @@ def encrypt_run_decrypt_tfhers_concrete(self, *inputs):
assert self._tfhers_bridge is not None

input_is_signed = self.input_quantizers[0].is_signed
encrypt_func = (
fhext.encrypt_serialize_i8_radix_2d # pylint: disable=no-member
if input_is_signed
else fhext.encrypt_serialize_u8_radix_2d # pylint: disable=no-member
)

encrypt_dtype = numpy.int8 if input_is_signed else numpy.uint8
output_0 = self.fhe_circuit.graph.ordered_outputs()[0]
output_is_signed = output_0.inputs[0].dtype.is_signed
output_bitwidth = output_0.inputs[0].dtype.bit_width
if output_bitwidth == 16:
decrypt_func = (
fhext.decrypt_serialized_i16_radix_2d # pylint: disable=no-member
if output_is_signed
else fhext.decrypt_serialized_u16_radix_2d # pylint: disable=no-member
)
else:
decrypt_func = (
fhext.decrypt_serialized_i8_radix_2d # pylint: disable=no-member
if output_is_signed
else fhext.decrypt_serialized_u8_radix_2d # pylint: disable=no-member
)

assert self.tfhers_sk is not None

tfhers_x = tuple(
[
self._tfhers_bridge.import_value(
encrypt_func(inputs[idx].astype(encrypt_dtype), self.tfhers_sk),
fhext.encrypt_radix(inputs[idx].astype(encrypt_dtype), self.tfhers_sk),
input_idx=idx,
)
for idx in range(len(inputs))
Expand All @@ -756,7 +740,10 @@ def encrypt_run_decrypt_tfhers_concrete(self, *inputs):
shape = out_shapes[func_name][0]
num_cols = shape[1] if len(shape) > 1 else shape[0]

result_np = decrypt_func(buff, num_cols, self.tfhers_sk)
# The output bitwidth for trees should be the same as the input one
result_np = fhext.decrypt_radix(
buff, (-1, 1), output_bitwidth, output_is_signed, self.tfhers_sk
)
result_np = result_np.reshape(shape)
return result_np

Expand Down

0 comments on commit 81cad15

Please sign in to comment.