Skip to content

Commit

Permalink
Merge pull request #719 from FederatedAI/feature-3.0.0-backport
Browse files Browse the repository at this point in the history
fix: add docs and whitelist (#708)
  • Loading branch information
mgqa34 authored Feb 29, 2024
2 parents 1f7c246 + b99d3c9 commit f2d10cc
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 1 deletion.
138 changes: 138 additions & 0 deletions conf/whitelist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"builtins": [
"int",
"list",
"set"
],
"collections": [
"defaultdict",
"OrderedDict"
],
"eggroll.core.transfer_model": [
"ErRollSiteHeader"
],
"eggroll.roll_pair.task.storage": [
"BSS"
],
"federatedml.cipher_compressor.compressor": [
"PackingCipherTensor",
"NormalCipherPackage",
"PackingCipherTensorPackage"
],
"federatedml.ensemble.basic_algorithms.decision_tree.tree_core.feature_histogram": [
"HistogramBag",
"FeatureHistogramWeights"
],
"federatedml.ensemble.basic_algorithms.decision_tree.tree_core.feature_importance": [
"FeatureImportance"
],
"federatedml.ensemble.basic_algorithms.decision_tree.tree_core.g_h_optim": [
"SplitInfoPackage",
"SplitInfoPackage2"
],
"federatedml.ensemble.basic_algorithms.decision_tree.tree_core.node": [
"Node"
],
"federatedml.ensemble.basic_algorithms.decision_tree.tree_core.splitter": [
"SplitInfo"
],
"federatedml.evaluation.performance_recorder": [
"PerformanceRecorder"
],
"federatedml.feature.binning.bin_result": [
"BinColResults"
],
"federatedml.feature.binning.optimal_binning.bucket_info": [
"Bucket"
],
"federatedml.feature.binning.optimal_binning.heap": [
"MinHeap",
"IvHeapNode",
"GiniHeapNode",
"ChiSquareHeapNode"
],
"federatedml.feature.binning.quantile_summaries": [
"SparseQuantileSummaries",
"Stats",
"QuantileSummaries"
],
"federatedml.feature.fate_element_type": [
"NoneType"
],
"federatedml.feature.homo_feature_binning.homo_binning_base": [
"SplitPointNode"
],
"federatedml.feature.instance": [
"Instance"
],
"federatedml.feature.one_hot_encoder": [
"TransferPair"
],
"federatedml.feature.sparse_vector": [
"SparseVector"
],
"federatedml.framework.weights": [
"NumpyWeights",
"TransferableWeights",
"NumericWeights",
"ListWeights",
"DictWeights",
"OrderDictWeights"
],
"federatedml.linear_model.linear_model_weight": [
"LinearModelWeights"
],
"federatedml.secureprotol.fate_paillier": [
"PaillierPublicKey",
"PaillierEncryptedNumber"
],
"federatedml.secureprotol.fixedpoint": [
"FixedPointNumber"
],
"federatedml.secureprotol.number_theory.field.integers_modulo_prime_field": [
"IntegersModuloPrimeElement"
],
"federatedml.secureprotol.number_theory.group.twisted_edwards_curve_group": [
"TwistedEdwardsCurveElement"
],
"federatedml.secureprotol.symmetric_encryption.cryptor_executor": [
"CryptoExecutor"
],
"federatedml.secureprotol.symmetric_encryption.pohlig_hellman_encryption": [
"PohligHellmanCiphertext",
"PohligHellmanCipherKey"
],
"federatedml.statistic.intersect.intersect_preprocess": [
"BitArray"
],
"federatedml.statistic.statics": [
"SummaryStatistics"
],
"gmpy2": [
"from_binary"
],
"numpy": [
"ndarray",
"dtype"
],
"numpy.core.multiarray": [
"scalar",
"_reconstruct"
],
"numpy.core.numeric": [
"_frombuffer"
],
"tensorflow.python.framework.ops": [
"convert_to_tensor"
],
"torch._utils": [
"_rebuild_tensor_v2"
],
"ipcl_python.bindings.ipcl_bindings": [
"ipclPublicKey"
],
"ipcl_python.ipcl_python": [
"PaillierPublicKey",
"PaillierEncryptedNumber"
]
}
5 changes: 5 additions & 0 deletions python/eggroll/backport/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Backport of Eggroll-2.x

This directory contains the backport api of Eggroll-2.x and may be used for FATE-1.x.
For users who use newer version api of Eggroll-3.x,
which is not compatible with FATE-2.x, this directory can be safely deleted.
4 changes: 3 additions & 1 deletion python/eggroll/backport/_serdes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
#

import io
import importlib
from pickle import Unpickler, UnpicklingError
from pickle import dumps as p_dumps
Expand All @@ -38,7 +39,8 @@ def serialize(obj) -> bytes:

@staticmethod
def deserialize(bytes) -> object:
return RestrictedUnpickler(bytes).load()
file = io.BytesIO(bytes)
return RestrictedUnpickler(file).load()


class RestrictedUnpickler(Unpickler):
Expand Down

0 comments on commit f2d10cc

Please sign in to comment.