Code Monkey home page Code Monkey logo

fedtree's Introduction

Documentation

Overview

FedTree is a federated learning system for tree-based models. It is designed to be highly efficient, effective, and secure. It has the following features currently.

  • Federated training of gradient boosting decision trees.
  • Parallel computing on multi-core CPUs and GPUs.
  • Supporting homomorphic encryption, secure aggregation and differential privacy.
  • Supporting classification and regression.

The overall architecture of FedTree is shown below. FedTree_archi

Getting Started

You can refer to our primary documentation here.

Prerequisites

  • CMake 3.15 or above
  • GMP
  • NTL
  • gRPC 1.50.0 (required for distributed version)

You can follow the following commands to install NTL library.

wget https://libntl.org/ntl-11.5.1.tar.gz
tar -xvf ntl-11.5.1.tar.gz
cd ntl-11.5.1/src
./configure SHARED=on
make
make check
sudo make install

If you install the NTL library at another location, please pass the location to the NTL_PATH when building the library (e.g., cmake .. -DNTL_PATH="PATH_TO_NTL").

For gRPC, please remember to add the local bin folder to your path variable after installation, e.g.,

export PATH="$gRPC_INSTALL_DIR/bin:$PATH"

We suggest you install gPRC 1.50.0, i.e., using -b v1.50.0 when cloning gRPC repo.

If your gRPC version is not 1.50.0, you need to go to src/FedTree/grpc directory and run

protoc -I ./ --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` ./fedtree.proto
protoc -I ./ --cpp_out=. ./fedtree.proto

Clone and Install submodules

git clone https://github.com/Xtra-Computing/FedTree.git
cd FedTree
git submodule init
git submodule update

Standalone Simulation

Build on Linux (Recommended)

# under the directory of FedTree
mkdir build && cd build 
cmake .. -DDISTRIBUTED=OFF
make -j

Build on MacOS

Build with Apple Clang

You need to install libomp for MacOS.

brew install libomp

Install FedTree:

# under the directory of FedTree
mkdir build
cd build
cmake -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" \
  -DOpenMP_C_LIB_NAMES=omp \
  -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" \
  -DOpenMP_CXX_LIB_NAMES=omp \
  -DOpenMP_omp_LIBRARY=/usr/local/opt/libomp/lib/libomp.dylib \
  ..
make -j

Run training

# under 'FedTree' directory
./build/bin/FedTree-train ./examples/vertical_example.conf

Distributed Setting

For each machine that participates in FL, it needs to build the library first. When building the library, passing -DDISTRIBUTED=ON option to cmake.

mkdir build && cd build
cmake .. -DDISTRIBUTED=ON
make -j

Then, write your configuration file where you should specify the ip address of the server machine (ip_address=xxx). Run FedTree-distributed-server in the server machine and run FedTree-distributed-party in the party machines. Here are two examples for horizontal FedTree and vertical FedTree.

Distributed Horizontal FedTree

# under 'FedTree' directory
# under server machine
./build/bin/FedTree-distributed-server ./examples/adult/a9a_horizontal_server.conf
# under party machine 0
./build/bin/FedTree-distributed-party ./examples/adult/a9a_horizontal_p0.conf 0
# under party machine 1
./build/bin/FedTree-distributed-party ./examples/adult/a9a_horizontal_p1.conf 1

Distributed Vertical FedTree

# under 'FedTree' directory
# under server (i.e., the party with label) machine 0
./build/bin/FedTree-distributed-server ./examples/credit/credit_vertical_p0_withlabel.conf
# open a new terminal
./build/bin/FedTree-distributed-party ./examples/credit/credit_vertical_p0_withlabel.conf 0
# Under party machine 1
./build/bin/FedTree-distributed-party ./examples/credit/credit_vertical_p1.conf 1

Other information

FedTree is built based on ThunderGBM, which is a fast GBDTs and Radom Forests training system on GPUs.

Citation

Please cite our paper if you use FedTree in your work.

@inproceedings{fedtree,
  title={FedTree: A Federated Learning System For Trees},
  author={Li, Qinbin and Wu, Zhaomin and Cai, Yanzheng and Han, Yuxuan and Yung, Ching Man and Fu, Tianyuan and He, Bingsheng},
  booktitle={Proceedings of Machine Learning and Systems},
  year={2023}
}

Call for contributions

Our goal is to make FedTree stronger and we're glad if you can contribute to FedTree. If you'd like to contribute to FedTree in-depth and are familiar with C++, kindly send your CV to [email protected].

fedtree's People

Contributors

ftywan avatar hanyuxuanhyx avatar junhui096 avatar liang2kl avatar qinbinli avatar yllekjjirpvul98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fedtree's Issues

Using a pretrained horizontal FL classification model on the Python interface + Local datasets for FLClassifier?

Is it possible to load a pretrained horizontal FL .model file to an FLClassifier object on the Python interface and then use the predict() method to make new predictions, even if the pretrained model was generated via command line interface?

Alternatively, is there a way to use both the standalone build and the Python interface in order to train a horizontal FL model in which the clients supply their own local datasets? From my understanding of fedtree.py and scikit_fedtree.cpp, it appears that FLClassifier can only simulate FL by partitioning a single dataset, rather than importing separate datasets from the local parties. (Is this correct?)


I am trying to train a horizontal FL classification FedTree model using local datasets supplied by each of the individual parties. I can run the CLI Distributed Horizontal FedTree example (as well as classifier_example.py) just fine, but it's not clear to me how I can make new predictions after loading the .model files with the Python API. When I use the predict() method right after creating an FLClassifier object and loading a model via load_model(), my program immediately terminates (unless I have trained a new model with the fit() method, which would defeat the purpose of what I am trying to do).


Any help would be greatly appreciated!

A Problem in Build on Linux

There's an error while Standalone Simulation installation:

cmake ..

-- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
-- Found OpenMP: TRUE
Complie without CUDA
-- Found OpenMP_CXX: -fopenmp
-- Found OpenMP: TRUE found components: CXX
CMake Error at CMakeLists.txt:52 (find_package):
Could not find a package configuration file provided by "Protobuf" with any
of the following names:

ProtobufConfig.cmake
protobuf-config.cmake

Add the installation prefix of "Protobuf" to CMAKE_PREFIX_PATH or set
"Protobuf_DIR" to a directory containing one of the above files. If
"Protobuf" provides a separate development package or SDK, be sure it has
been installed.

-- Configuring incomplete, errors occurred!

How can i fix this ? I can't run the next command 'make -j'

python horizontal 模型训练自动killed问题

请问我使用python训练FLClassifier时,max_tree参数为10时可以跑通,为12时出现训练第一轮时自动killed的情况,请问这大概是什么原因呢?在ubuntu1804虚拟机运行的,内存4g,数据量为20w,特征数18。

Ubuntu crashs during standalone installation.

I'm trying to install FedTree on Ubuntu 22.04.1 LTS. After I run the make -j command my PC freeze and next shows a clear Desktop - it closes the terminal. It crashes around 22% (once it was 22, once 26, once 18). Here are the logs

Sep 21 12:39:16 tk-ASUSPRO-P5440FF kernel: [ 2914.676991] Free swap = 0kB
Sep 21 12:39:16 tk-ASUSPRO-P5440FF kernel: [ 2914.676992] Total swap = 2097148kB
Sep 21 12:39:16 tk-ASUSPRO-P5440FF kernel: [ 2914.676993] 4156245 pages RAM
Sep 21 12:39:16 tk-ASUSPRO-P5440FF kernel: [ 2914.676995] 0 pages HighMem/MovableOnly
Sep 21 12:39:16 tk-ASUSPRO-P5440FF kernel: [ 2914.676996] 98099 pages reserved
Sep 21 12:39:16 tk-ASUSPRO-P5440FF kernel: [ 2914.676998] 0 pages hwpoisoned
Sep 21 12:39:16 tk-ASUSPRO-P5440FF kernel: [ 2914.676999] Tasks state (memory values in pages):
Sep 21 12:39:16 tk-ASUSPRO-P5440FF kernel: [ 2914.677000] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name

It shows that the free swap is 0kB and next it start killing processes. Did any of you experienced similar error?

Error imputing more than 10 different data paths (files - .csv)

Hi,

when running horizontal FL, I set several data files to data as in my previous issue. It would seem, when working with Forest Cover Type data set, that adding more than 10 different paths leads to:

*** stack smashing detected ***, terminated.

Is there a way to scale this beyond 10 different paths or am I mainly limited by my hardware?

Best regards,
W

安装问题

在cmake..的过程中遇到版本问题,我是3.3.2的版本却不符合条件,我尝试更改cmakelist文件,但是TRust中的条件显示只有3.15-3.18.请问是只能用3.15-3.18的版本嘛

Horizontal Federated Random Forest - Errors for Multiclass Classification

Hi,

I am trying to apply Federated Random Forest (horizontal setting) setting the parameter baggingto 1 using several pre-split data sets, as in my previous issue. The data set I am using is Forest Cover Type data set, classification, 54 features and 7 classes.

However, when running this it seems that it only predicts 0s and 1s. Federated GBDTs can make relevant predictions for all classes but not random forests. Is there another parameter I must set so that the random forests can predict all classes for horizontal federated learning?

The error message I get after the the horizontal trainer is done and it is predicting the score is:
FATAL multiclass_metric.cpp:12 : Check failed: [num_class * y.size() == y_p.size()] 7 * 11620 != 11620

Best regards,
W

安装问题

Mac 上安装时,最后一条命令 make -j出错,如下所示。请问各位老师这个怎么解决呢?多谢
fedtree_1
fedtree_2

A question about running vertical FL in standalone simulation

Hi, I am confused about missing_gh variable in function compute_histogram_in_a_level. When using privacy_tech=he, part of the value of missing_gh is in plaintext and the other part is in ciphertext, is this correct?
I printed a plaintext message as follows

missing_gh_data[pid] = -340.000000/757.000000;
nodes_data[nid].sum_gh_pair = -340.000000/757.000000; 
node_gh = 0.000000/0.000000;

Is this a security risk?

Install issue on MacOS

Hi, when I run this command:

cmake -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" \
  -DOpenMP_C_LIB_NAMES=omp \
  -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" \
  -DOpenMP_CXX_LIB_NAMES=omp \
  -DOpenMP_omp_LIBRARY=/usr/local/opt/libomp/lib/libomp.dylib \
  ..

I got this:

CMake Error at CMakeLists.txt:41 (add_subdirectory):
  The source directory

    /Users/myname/Downloads/FedTree/thrust

  does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:42 (find_package):
  By not providing "FindThrust.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Thrust", but
  CMake did not find one.

  Could not find a package configuration file provided by "Thrust" with any
  of the following names:

    ThrustConfig.cmake
    thrust-config.cmake

  Add the installation prefix of "Thrust" to CMAKE_PREFIX_PATH or set
  "Thrust_DIR" to a directory containing one of the above files.  If "Thrust"
  provides a separate development package or SDK, be sure it has been
  installed.

Then I check ~/FedTree/thrust, there is noting indeed. Also I can't find any file named ThrustConfig.cmake. How to fix this?

Python Vertical FL example

Hi, can you provide an example using the Python wrapper for Vertical FL? Currently the examples all make use of Horizontal FL.

Feature Request: add support for "wait-for-ready"

Thank you for your FedTree contribution!

During the recent distributed deployment, we observed that the client does not wait for the server to be ready before initiating communication. Instead, it throws a gRPC failure and go into the progress of "training".

According to gRPC document:

When an RPC is created when the channel has failed to connect to the server, without Wait-for-Ready it will immediately return a failure;

Perhaps it would be beneficial to consider adding the "Wait-for-Ready" feature to the project, as it would enhance its robustness.

Once again, we appreciate your involvement in the project.

Is it an alternative way to install NTL?

Thank you for your great work!

I would like to install NTL on a workstation (I can not get the sudo permission because of the policy), and I just run '''make install''' and got the following error.

'''
mkdir -p -m 755 /usr/local/include
rm -rf /usr/local/include/NTL
mkdir -m 755 /usr/local/include/NTL
mkdir: cannot create directory ‘/usr/local/include/NTL’: Permission denied
make: *** [install] Error 1
'''

I was wondering if it is an alternative way to install NTL, and if NTL is necessary for this library? I would appreciate your help. Thanks!

StrFormat error

I encountered the following error multiple times (for all occurrences of StrFormat) in the "make" stage for FedTree:

/projects/FedTree/build/_deps/grpc-src/src/core/lib/surface/call.cc:  in function ‘void handle_error_parsing_compression_algorithm(grpc_call*)’:
/projects/FedTree/build/_deps/grpc-src/src/core/lib/surface/call.cc:1398:51: ERROR:no matching function for call to ‘StrFormat(const char [71], grpc_stream_compression_algorithm&, grpc_message_compression_algorithm&)’
     call->incoming_message_compression_algorithm);

I searched this error, and followed the suggestions to upgrade gcc to 7.3.1 on CentOS 7. However, the error still exists. Could you please suggest how to fix it? Many thanks!

why does it still require nvidia thrust cuda after set USE_CUDA to OFF

when I cmake FedTree without CUDA:

Complie without CUDA
CMake Deprecation Warning at thrust/CMakeLists.txt:9 (cmake_policy):
  The OLD behavior for policy CMP0104 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Could NOT find libcudacxx (missing: libcudacxx_DIR)
CMake Error at thrust/thrust/cmake/thrust-config.cmake:709 (find_package):
  Could not find a package configuration file provided by "libcudacxx"
  (requested version 1.8.0) with any of the following names:

    libcudacxxConfig.cmake
    libcudacxx-config.cmake

  Add the installation prefix of "libcudacxx" to CMAKE_PREFIX_PATH or set
  "libcudacxx_DIR" to a directory containing one of the above files.  If
  "libcudacxx" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  thrust/cmake/ThrustAddSubdir.cmake:1 (find_package)
  thrust/CMakeLists.txt:59 (include)


-- Configuring incomplete, errors occurred!
make: *** No targets specified and no makefile found.  Stop.

don't we have a CPU only mode?

not working with grpc-1.53.0 & server still waiting after finish training

the documentation mentioned that grpc earlier than 1.50 may not work, I used the latest release 1.53, and making throws error:

[ 20%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/scikit_fedtree.cpp.o
In file included from /usr/local/include/absl/base/config.h:86,
                 from /usr/local/include/absl/base/const_init.h:25,
                 from /usr/local/include/absl/synchronization/mutex.h:67,
                 from /usr/local/include/grpcpp/impl/sync.h:30,
                 from /usr/local/include/grpcpp/impl/codegen/sync.h:25,
                 from /usr/local/include/grpcpp/completion_queue.h:43,
                 from /usr/local/include/grpcpp/channel.h:25,
                 from /usr/local/include/grpcpp/grpcpp.h:52,
                 from /workspace/FedTree/include/FedTree/FL/distributed_party.h:8,
                 from /workspace/FedTree/src/FedTree/FL/distributed_party.cpp:5:
/usr/local/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
   79 | #error "C++ versions less than C++14 are not supported."
      |  ^~~~~
In file included from /usr/local/include/absl/base/config.h:86,
                 from /usr/local/include/absl/base/const_init.h:25,
                 from /usr/local/include/absl/synchronization/mutex.h:67,
                 from /usr/local/include/grpcpp/impl/sync.h:30,
                 from /usr/local/include/grpcpp/impl/codegen/sync.h:25,
                 from /usr/local/include/grpcpp/completion_queue.h:43,
                 from /usr/local/include/grpcpp/channel.h:25,
                 from /usr/local/include/grpcpp/grpcpp.h:52,
                 from /workspace/FedTree/include/FedTree/FL/distributed_server.h:8,
                 from /workspace/FedTree/src/FedTree/FL/distributed_server.cpp:5:
/usr/local/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
   79 | #error "C++ versions less than C++14 are not supported."
      |  ^~~~~
In file included from /usr/local/include/absl/time/time.h:88,
                 from /usr/local/include/absl/time/clock.h:26,
                 from /usr/local/include/absl/synchronization/internal/kernel_timeout.h:35,
                 from /usr/local/include/absl/synchronization/mutex.h:74,
                 from /usr/local/include/grpcpp/impl/sync.h:30,
                 from /usr/local/include/grpcpp/impl/codegen/sync.h:25,
                 from /usr/local/include/grpcpp/completion_queue.h:43,
                 from /usr/local/include/grpcpp/channel.h:25,
                 from /usr/local/include/grpcpp/grpcpp.h:52,
                 from /workspace/FedTree/include/FedTree/FL/distributed_party.h:8,
                 from /workspace/FedTree/src/FedTree/FL/distributed_party.cpp:5:
/usr/local/include/absl/strings/string_view.h: In member function ‘constexpr void absl::lts_20230125::string_view::remove_prefix(absl::lts_20230125::string_view::size_type) const’:
/usr/local/include/absl/strings/string_view.h:340:10: error: assignment of member ‘absl::lts_20230125::string_view::ptr_’ in read-only object
  340 |     ptr_ += n;
      |     ~~~~~^~~~
/usr/local/include/absl/strings/string_view.h:341:13: error: assignment of member ‘absl::lts_20230125::string_view::length_’ in read-only object
  341 |     length_ -= n;
      |     ~~~~~~~~^~~~
/usr/local/include/absl/strings/string_view.h:338:18: error: invalid return type ‘void’ of ‘constexpr’ function ‘constexpr void absl::lts_20230125::string_view::remove_prefix(absl::lts_20230125::string_view::size_type) const’
  338 |   constexpr void remove_prefix(size_type n) {
      |                  ^~~~~~~~~~~~~
/usr/local/include/absl/strings/string_view.h: In member function ‘constexpr void absl::lts_20230125::string_view::remove_suffix(absl::lts_20230125::string_view::size_type) const’:
/usr/local/include/absl/strings/string_view.h:350:13: error: assignment of member ‘absl::lts_20230125::string_view::length_’ in read-only object
  350 |     length_ -= n;
      |     ~~~~~~~~^~~~
/usr/local/include/absl/strings/string_view.h:348:18: error: invalid return type ‘void’ of ‘constexpr’ function ‘constexpr void absl::lts_20230125::string_view::remove_suffix(absl::lts_20230125::string_view::size_type) const’
  348 |   constexpr void remove_suffix(size_type n) {
      |                  ^~~~~~~~~~~~~
/usr/local/include/absl/strings/string_view.h: In member function ‘constexpr void absl::lts_20230125::string_view::swap(absl::lts_20230125::string_view&) const’:
/usr/local/include/absl/strings/string_view.h:358:13: error: passing ‘const absl::lts_20230125::string_view’ as ‘this’ argument discards qualifiers [-fpermissive]
  358 |     *this = s;
      |             ^
/usr/local/include/absl/strings/string_view.h:161:7: note:   in call to ‘absl::lts_20230125::string_view& absl::lts_20230125::string_view::operator=(const absl::lts_20230125::string_view&)’
  161 | class string_view {
      |       ^~~~~~~~~~~
/usr/local/include/absl/strings/string_view.h:356:18: error: invalid return type ‘void’ of ‘constexpr’ function ‘constexpr void absl::lts_20230125::string_view::swap(absl::lts_20230125::string_view&) const’
  356 |   constexpr void swap(string_view& s) noexcept {
      |                  ^~~~
In file included from /usr/local/include/absl/time/time.h:88,
                 from /usr/local/include/absl/time/clock.h:26,
                 from /usr/local/include/absl/synchronization/internal/kernel_timeout.h:35,
                 from /usr/local/include/absl/synchronization/mutex.h:74,
                 from /usr/local/include/grpcpp/impl/sync.h:30,
                 from /usr/local/include/grpcpp/impl/codegen/sync.h:25,
                 from /usr/local/include/grpcpp/completion_queue.h:43,
                 from /usr/local/include/grpcpp/channel.h:25,
                 from /usr/local/include/grpcpp/grpcpp.h:52,
                 from /workspace/FedTree/include/FedTree/FL/distributed_server.h:8,
                 from /workspace/FedTree/src/FedTree/FL/distributed_server.cpp:5:
/usr/local/include/absl/strings/string_view.h: In member function ‘constexpr void absl::lts_20230125::string_view::remove_prefix(absl::lts_20230125::string_view::size_type) const’:
/usr/local/include/absl/strings/string_view.h:340:10: error: assignment of member ‘absl::lts_20230125::string_view::ptr_’ in read-only object
  340 |     ptr_ += n;
      |     ~~~~~^~~~
/usr/local/include/absl/strings/string_view.h:341:13: error: assignment of member ‘absl::lts_20230125::string_view::length_’ in read-only object
  341 |     length_ -= n;
      |     ~~~~~~~~^~~~
/usr/local/include/absl/strings/string_view.h:338:18: error: invalid return type ‘void’ of ‘constexpr’ function ‘constexpr void absl::lts_20230125::string_view::remove_prefix(absl::lts_20230125::string_view::size_type) const’
  338 |   constexpr void remove_prefix(size_type n) {
      |                  ^~~~~~~~~~~~~
/usr/local/include/absl/strings/string_view.h: In member function ‘constexpr void absl::lts_20230125::string_view::remove_suffix(absl::lts_20230125::string_view::size_type) const’:
/usr/local/include/absl/strings/string_view.h:350:13: error: assignment of member ‘absl::lts_20230125::string_view::length_’ in read-only object
  350 |     length_ -= n;
      |     ~~~~~~~~^~~~
/usr/local/include/absl/strings/string_view.h:348:18: error: invalid return type ‘void’ of ‘constexpr’ function ‘constexpr void absl::lts_20230125::string_view::remove_suffix(absl::lts_20230125::string_view::size_type) const’
  348 |   constexpr void remove_suffix(size_type n) {
      |                  ^~~~~~~~~~~~~
/usr/local/include/absl/strings/string_view.h: In member function ‘constexpr void absl::lts_20230125::string_view::swap(absl::lts_20230125::string_view&) const’:
/usr/local/include/absl/strings/string_view.h:358:13: error: passing ‘const absl::lts_20230125::string_view’ as ‘this’ argument discards qualifiers [-fpermissive]
  358 |     *this = s;
      |             ^
/usr/local/include/absl/strings/string_view.h:161:7: note:   in call to ‘absl::lts_20230125::string_view& absl::lts_20230125::string_view::operator=(const absl::lts_20230125::string_view&)’
  161 | class string_view {
      |       ^~~~~~~~~~~
/usr/local/include/absl/strings/string_view.h:356:18: error: invalid return type ‘void’ of ‘constexpr’ function ‘constexpr void absl::lts_20230125::string_view::swap(absl::lts_20230125::string_view&) const’
  356 |   constexpr void swap(string_view& s) noexcept {
      |                  ^~~~
[ 21%] Linking CXX shared library ../../lib/libFedTree.so
make[2]: *** [src/FedTree/CMakeFiles/FedTree_DIST.dir/build.make:146: src/FedTree/CMakeFiles/FedTree_DIST.dir/FL/distributed_party.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/usr/bin/ld: /usr/local/lib/libntl.a(ZZ.o): relocation R_X86_64_TPOFF32 against `_ZN3NTLL8iodigitsE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libntl.a(fileio.o): relocation R_X86_64_TPOFF32 against `_ZZN3NTL8UniqueIDB5cxx11EvE37_ntl_hidden_variable_tls_local_ptr_ID' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libntl.a(lip.o): relocation R_X86_64_TPOFF32 against `_ZZ10_ntl_gswapPP17_ntl_gbigint_bodyS1_E36_ntl_hidden_variable_tls_local_ptr_t' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libntl.a(tools.o): relocation R_X86_64_TPOFF32 against symbol `_ZN3NTL16ErrorMsgCallbackE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libntl.a(thread.o): relocation R_X86_64_TPOFF32 against `_ZZN3NTL15CurrentThreadIDB5cxx11EvE37_ntl_hidden_variable_tls_local_ptr_ID' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libntl.a(BasicThreadPool.o): relocation R_X86_64_TPOFF32 against `_ZZN3NTLL49_ntl_hidden_function_tls_access_NTLThreadPool_stgEvE52_ntl_hidden_variable_tls_local_ptr_NTLThreadPool_stg' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libntl.a(lip.o): warning: relocation against `_ZTV21_ntl_tmp_vec_crt_fast' in read-only section `.text'
collect2: error: ld returned 1 exit status
make[2]: *** [src/FedTree/CMakeFiles/FedTree.dir/build.make:551: lib/libFedTree.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:154: src/FedTree/CMakeFiles/FedTree.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [src/FedTree/CMakeFiles/FedTree_DIST.dir/build.make:160: src/FedTree/CMakeFiles/FedTree_DIST.dir/FL/distributed_server.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:232: src/FedTree/CMakeFiles/FedTree_DIST.dir/all] Error 2
[ 23%] Linking CXX static library ../../lib/libft_grpc_proto.a
[ 24%] Built target ft_grpc_proto
make: *** [Makefile:91: all] Error 2
seems that it came from the latest absl.

Multi-class classification problem

I am using 3 clients to train a model using the following parameters in the clients:

data=./mydata1.csv
test_data=./mytest_data.csv
model_path=mymodel.model
n_parties=3
data_format=csv
n_features=11
objective=multi:softmax
mode=horizontal
partition=0
learning_rate=0.1
max_depth=6
n_trees=50
ip_address=192...

Everything in the training is working but when I am trying to predict, the model predicts only 0.0 while the labels are (0,1,2). I also tried with objective=multi:softprob but the same happened. Also, I tried both the python .predict function and the terminal i.e. /build/bin/FedTree-predict ./predict.conf but I am getting exactly the same results (only 0).

Stack smashing when handling multiple csv files.

I wanted to thank you for your contribution to the FedTree project. However, I noticed an issue with the code that I would like to bring to your attention.

As mentioned in issue #58, there seems to be an undefined behavior in the code related to stack smashing. While the commit(376c7de) you made may have mitigated the problem, it did not solve it completely.

TL;DR

The name and val were not initialized to zero causing unauthorized memory access.

Details

After some debugging of the code, I found that the issue is located in parser.cpp:81.

char name[256], val[2048];

where the arrays name and val are not initialized to zero, and thus contain garbage information (in some OS). This causes unauthorized memory access when the string str_name(name);
string str_name(name);
constructor of the std::string class seeks characters until it meets a \0 character. I appreciate your contribution to the project and hope this information helps to fix the issue.

I hope this information helps you to fix the issue. Thank you again for your contribution to the project.

Specify Data Partition in Horizontal Federated Tree Training

Hi,

first, thank you for this project!

I am running FedTree on one computer and would like to assign each party (currently 2) one data set (sample of whole data set) to train on. I am running the python code and see that in fedtree.py there is a variable path, however it doesn't seem to be doing anything. How can I achieve this in stand-alone simulation? Is there another way to assign each party their local data set?

Best regards,
W

prediction issue on vertical federated learning with he

Hello,
I'm experiencing an issue with vertical federated learning with the HE on the prediction part; I can train the model as below and see the predicted accuracy at the end. However, I can not generate predictions (getting Segmentation Fault) while I'm able to see without HE.

Homomorphic Encryption Based

conf
data=./dataset/nict/TWO-OS/train_two_groups_BC.csv,./dataset/nict/TWO-OS/train_two_groups_D.csv
test_data=./dataset/nict/TWO-OS/test_two_groups_BC.csv,./dataset/nict/TWO-OS/test_two_groups_D.csv
model_path=fedtree_two_os_he.model
n_parties=2
data_format=csv
mode=vertical
privacy_tech=he
objective=multi:softmax
n_trees=40
depth=6
learning_rate=0.3
partition=0
num_class=3
n_features=36

prediction_conf
data=/home/user/FedTree/dataset/nict/TWO-OS/test_two_groups_BC.csv,/home/user/FedTree/dataset/nict/TWO-OS/test_two_groups_D.csv
model_path=fedtree_two_os_he.model
n_parties=2
mode=vertical
data_format=csv
privacy_tech=he

training
2024-08-30 17:35:15,039 INFO FLtrainer.cpp:819 : multi-class accuracy = 0.999961
2024-08-30 17:35:15,040 INFO FLtrainer.cpp:508 : Training round 38 start
2024-08-30 17:35:32,411 INFO FLtrainer.cpp:819 : multi-class accuracy = 0.999961
2024-08-30 17:35:32,411 INFO FLtrainer.cpp:508 : Training round 39 start
2024-08-30 17:35:49,079 INFO FLtrainer.cpp:819 : multi-class accuracy = 0.999961
2024-08-30 17:35:49,080 INFO FLtrainer.cpp:827 : training time = 805.391s
2024-08-30 17:35:49,080 INFO FLtrainer.cpp:829 : HE time (encryption and decryption) 262.275(165.447/96.8277)
2024-08-30 17:35:49,080 INFO FLtrainer.cpp:833 : end of training
2024-08-30 17:35:49,132 INFO gbdt.cpp:182 : multi-class accuracy = 0.819619

prediction
024-08-30 17:41:07,167 INFO dataset.cpp:396 : loading csv dataset from file ## /home/user/FedTree/dataset/nict/TWO-OS/test_two_groups_BC.csv ##
2024-08-30 17:41:07,185 INFO dataset.cpp:567 : #instances = 6453, #features = 24
2024-08-30 17:41:07,185 INFO dataset.cpp:581 : Load dataset using time: 0.0183452 s
2024-08-30 17:41:07,185 INFO dataset.cpp:396 : loading csv dataset from file ## /home/user/FedTree/dataset/nict/TWO-OS/test_two_groups_D.csv ##
2024-08-30 17:41:07,192 INFO dataset.cpp:567 : #instances = 6453, #features = 12
2024-08-30 17:41:07,192 INFO dataset.cpp:581 : Load dataset using time: 0.00639177 s
Segmentation fault
Thread 2 "FedTree-predict" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff718c640 (LWP 98040)]
0x00007ffff787632e in _ntl_gcopy (a=0x563ede7fef30, bb=0x7ffff718abe0) at lip.cpp:1503
1503 if (!a || (sa = SIZE(a)) == 0) {

Privacy Tech : None

conf
data=./dataset/nict/TWO-OS/train_two_groups_BC.csv,./dataset/nict/TWO-OS/train_two_groups_D.csv
test_data=./dataset/nict/TWO-OS/test_two_groups_BC.csv,./dataset/nict/TWO-OS/test_two_groups_D.csv
model_path=fedtree_two_os.model
n_parties=2
data_format=csv
mode=vertical
privacy_tech=none
objective=multi:softmax
n_trees=40
depth=6
learning_rate=0.3
partition=0
num_class=3
n_features=36

prediction_conf
data=/home/user/FedTree/dataset/nict/TWO-OS/test_two_groups_BC.csv,/home/user/FedTree/dataset/nict/TWO-OS/test_two_groups_D.csv
model_path=fedtree_two_os.model
n_parties=2
mode=vertical
data_format=csv
privacy_tech=none

training
2024-08-30 18:14:51,869 INFO FLtrainer.cpp:508 : Training round 38 start
2024-08-30 18:14:52,074 INFO FLtrainer.cpp:819 : multi-class accuracy = 0.999961
2024-08-30 18:14:52,074 INFO FLtrainer.cpp:508 : Training round 39 start
2024-08-30 18:14:52,284 INFO FLtrainer.cpp:819 : multi-class accuracy = 0.999961
2024-08-30 18:14:52,284 INFO FLtrainer.cpp:827 : training time = 9.15472s
2024-08-30 18:14:52,284 INFO FLtrainer.cpp:833 : end of training
2024-08-30 18:14:52,306 INFO gbdt.cpp:182 : multi-class accuracy = 0.821168
prediction
2024-08-30 18:15:39,438 INFO dataset.cpp:396 : loading csv dataset from file ## /home/user/FedTree/dataset/nict/TWO-OS/test_two_groups_BC.csv ##
2024-08-30 18:15:39,448 INFO dataset.cpp:567 : #instances = 6453, #features = 24
2024-08-30 18:15:39,448 INFO dataset.cpp:581 : Load dataset using time: 0.0102731 s
2024-08-30 18:15:39,448 INFO dataset.cpp:396 : loading csv dataset from file ## /home/user/FedTree/dataset/nict/TWO-OS/test_two_groups_D.csv ##
2024-08-30 18:15:39,451 INFO dataset.cpp:567 : #instances = 6453, #features = 12
2024-08-30 18:15:39,451 INFO dataset.cpp:581 : Load dataset using time: 0.00239889 s
2024-08-30 18:15:39,479 INFO fedtree_predict.cpp:61 : multi-class accuracy = 0.821168

Unsupported CSV format

Hello,

For some reason I am getting unsupported CSV format, is there anything I might have missed? I am trying to run the first of the 4 distributed parties. My test dataset and my train partitions share the same format, so I don't know what might be happening:

henry:FedTree$ ./build/bin/FedTree-distributed-server ./examples/henry/fd001_server.conf
2022-08-02 15:57:33,024 INFO distributed_server.cpp:1616 : server init completed.

in another terminal tab:
henry:FedTree$ ./build/bin/FedTree-distributed-party ./examples/henry/fd001_party0.conf 0
unsupported csv format


CSV files:

test.csv
id y x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11
0 112 642.58 1581.22 1398.91 554.42 2388.08 47.23 521.79 2388.06 8.4024 393 38.81 23.3552
1 98 642.55 1586.59 1410.83 553.52 2388.1 47.67 521.74 2388.09 8.4505 391 38.81 23.2618
2 69 642.88 1589.75 1418.89 552.59 2388.16 47.88 520.83 2388.14 8.4119 395 38.93 23.274
3 82 642.78 1594.53 1406.88 552.64 2388.13 47.65 521.88 2388.11 8.4634 395 38.58 23.2581
4 91 642.27 1589.94 1419.36 553.29 2388.1 47.46 521.0 2388.15 8.4362 394 38.75 23.4117
5 93 643.05 1586.94 1404.49 553.73 2388.14 47.51 521.56 2388.15 8.4452 393 38.91 23.3269
6 91 642.1 1589.59 1413.57 553.42 2388.04 47.32 522.32 2388.07 8.4028 393 38.91 23.2763

party0.csv
id y x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11
479 178 642.04 1584.2 1398.13 553.96 2388.06 47.14 522.24 2388.0 8.4207 391 38.96 23.3205
480 177 642.66 1587.04 1398.62 554.76 2388.05 47.35 522.03 2388.01 8.3949 390 39.07 23.4369
481 176 642.07 1580.75 1401.1 554.51 2388.03 46.94 522.16 2388.01 8.382 393 39.03 23.3162
482 175 642.5 1580.12 1395.76 554.48 2388.07 47.44 522.31 2388.07 8.394 391 38.94 23.4901
483 174 641.97 1581.48 1394.05 554.14 2388.01 47.16 522.0 2388.03 8.4233 391 38.9 23.419
484 173 642.65 1581.26 1397.98 554.86 2388.08 47.12 522.58 2388.08 8.4126 392 39.04 23.4656
485 172 642.62 1583.68 1405.76 554.29 2388.06 47.26 522.08 2388.01 8.4369 393 39.03 23.4051

Error_when building with -DDISTRIBUTED=ON

Hi. Even though everything works fine when I do the build with -DDISTRIBUTED=OFF when I am running:
cmake .. -DDISTRIBUTED=ON
make -j
I am getting the following error

(base) fps@fps:~/Documents/FL/FedTree/build$ make -j
Scanning dependencies of target FedTree_DIST
Scanning dependencies of target ft_grpc_proto
Scanning dependencies of target FedTree
[ 1%] Building CXX object src/FedTree/CMakeFiles/ft_grpc_proto.dir/grpc/fedtree.grpc.pb.cc.o
[ 2%] Building CXX object src/FedTree/CMakeFiles/ft_grpc_proto.dir/grpc/fedtree.pb.cc.o
In file included from /home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.pb.cc:4:
/home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
17 | #error This file was generated by an older version of protoc which is
| ^~~~~
In file included from /home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.grpc.pb.cc:5:
/home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
17 | #error This file was generated by an older version of protoc which is
| ^~~~~
/home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
18 | #error incompatible with your Protocol Buffer headers. Please
| ^~~~~
/home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
18 | #error incompatible with your Protocol Buffer headers. Please
| ^~~~~
/home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
19 | #error regenerate this file with a newer version of protoc.
| ^~~~~
/home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
19 | #error regenerate this file with a newer version of protoc.
| ^~~~~
In file included from /home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.grpc.pb.cc:5:
/home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.pb.h:26:10: fatal error: google/protobuf/generated_message_table_driven.h: No such file or directory
26 | #include <google/protobuf/generated_message_table_driven.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.pb.cc:4:
/home/fps/Documents/FL/FedTree/src/FedTree/grpc/fedtree.pb.h:26:10: fatal error: google/protobuf/generated_message_table_driven.h: No such file or directory
26 | #include <google/protobuf/generated_message_table_driven.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
make[2]: *** [src/FedTree/CMakeFiles/ft_grpc_proto.dir/build.make:82: src/FedTree/CMakeFiles/ft_grpc_proto.dir/grpc/fedtree.grpc.pb.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/FedTree/CMakeFiles/ft_grpc_proto.dir/build.make:95: src/FedTree/CMakeFiles/ft_grpc_proto.dir/grpc/fedtree.pb.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:173: src/FedTree/CMakeFiles/ft_grpc_proto.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 4%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/DP/differential_privacy.cpp.o
[ 5%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/Encryption/diffie_hellman.cpp.o
[ 6%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/Encryption/paillier.cpp.o
[ 8%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/Encryption/paillier_gmp.cpp.o
[ 10%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/FL/partition.cpp.o
[ 10%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/FL/FLtrainer.cpp.o
[ 12%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/FL/party.cpp.o
[ 13%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/FL/server.cpp.o
[ 15%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/Tree/gbdt.cpp.o
[ 16%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/Tree/function_builder.cpp.o
[ 17%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/DP/differential_privacy.cpp.o
[ 19%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/Encryption/diffie_hellman.cpp.o
[ 20%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/Encryption/paillier.cpp.o
[ 21%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/Tree/hist_cut.cpp.o
[ 23%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/Tree/hist_tree_builder.cpp.o
[ 24%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/Encryption/paillier_gmp.cpp.o
[ 26%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/Tree/tree.cpp.o
[ 27%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/FL/FLtrainer.cpp.o
[ 28%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/FL/distributed_party.cpp.o
[ 30%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/Tree/tree_builder.cpp.o
[ 31%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/booster.cpp.o
[ 32%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/dataset.cpp.o
[ 34%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/FL/distributed_server.cpp.o
[ 35%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/FL/party.cpp.o
[ 36%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/FL/partition.cpp.o
[ 38%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/metric/metric.cpp.o
[ 39%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/metric/multiclass_metric.cpp.o
[ 41%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/metric/pointwise_metric.cpp.o
[ 43%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/FL/server.cpp.o
[ 43%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/Tree/function_builder.cpp.o
[ 45%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/Tree/gbdt.cpp.o
[ 46%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/metric/rank_metric.cpp.o
[ 47%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/Tree/hist_cut.cpp.o
[ 49%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/objective/multiclass_obj.cpp.o
[ 50%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/objective/objective_function.cpp.o
[ 52%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/objective/ranking_obj.cpp.o
[ 53%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/parser.cpp.o
[ 54%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/Tree/hist_tree_builder.cpp.o
[ 56%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/predictor.cpp.o
[ 57%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/Tree/tree.cpp.o
[ 58%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/Tree/tree_builder.cpp.o
[ 60%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/booster.cpp.o
[ 61%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/scikit_fedtree.cpp.o
In file included from /home/fps/.local/include/absl/base/config.h:86,
from /home/fps/.local/include/absl/base/const_init.h:25,
from /home/fps/.local/include/absl/synchronization/mutex.h:67,
from /home/fps/.local/include/grpcpp/impl/sync.h:30,
from /home/fps/.local/include/grpcpp/impl/codegen/sync.h:25,
from /home/fps/.local/include/grpcpp/completion_queue.h:43,
from /home/fps/.local/include/grpcpp/channel.h:25,
from /home/fps/.local/include/grpcpp/grpcpp.h:52,
from /home/fps/Documents/FL/FedTree/include/FedTree/FL/distributed_party.h:8,
from /home/fps/Documents/FL/FedTree/src/FedTree/FL/distributed_party.cpp:5:
/home/fps/.local/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
79 | #error "C++ versions less than C++14 are not supported."
| ^~~~~
[ 63%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/syncmem.cpp.o
[ 64%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/dataset.cpp.o
[ 65%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/util/common.cpp.o
[ 67%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/metric/metric.cpp.o
[ 68%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/metric/multiclass_metric.cpp.o
[ 69%] Building CXX object src/FedTree/CMakeFiles/FedTree.dir/util/log.cpp.o
[ 71%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/metric/pointwise_metric.cpp.o
In file included from /home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.grpc.pb.h:7,
from /home/fps/Documents/FL/FedTree/include/FedTree/FL/distributed_party.h:14,
from /home/fps/Documents/FL/FedTree/src/FedTree/FL/distributed_party.cpp:5:
/home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
17 | #error This file was generated by an older version of protoc which is
| ^~~~~
/home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
18 | #error incompatible with your Protocol Buffer headers. Please
| ^~~~~
/home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
19 | #error regenerate this file with a newer version of protoc.
| ^~~~~
[ 72%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/metric/rank_metric.cpp.o
[ 73%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/objective/multiclass_obj.cpp.o
In file included from /home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.grpc.pb.h:7,
from /home/fps/Documents/FL/FedTree/include/FedTree/FL/distributed_party.h:14,
from /home/fps/Documents/FL/FedTree/src/FedTree/FL/distributed_party.cpp:5:
/home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.pb.h:26:10: fatal error: google/protobuf/generated_message_table_driven.h: No such file or directory
26 | #include <google/protobuf/generated_message_table_driven.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[ 75%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/objective/objective_function.cpp.o
make[2]: *** [src/FedTree/CMakeFiles/FedTree_DIST.dir/build.make:147: src/FedTree/CMakeFiles/FedTree_DIST.dir/FL/distributed_party.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 76%] Building CXX object src/FedTree/CMakeFiles/FedTree_DIST.dir/objective/ranking_obj.cpp.o
In file included from /home/fps/.local/include/absl/base/config.h:86,
from /home/fps/.local/include/absl/base/const_init.h:25,
from /home/fps/.local/include/absl/synchronization/mutex.h:67,
from /home/fps/.local/include/grpcpp/impl/sync.h:30,
from /home/fps/.local/include/grpcpp/impl/codegen/sync.h:25,
from /home/fps/.local/include/grpcpp/completion_queue.h:43,
from /home/fps/.local/include/grpcpp/channel.h:25,
from /home/fps/.local/include/grpcpp/grpcpp.h:52,
from /home/fps/Documents/FL/FedTree/include/FedTree/FL/distributed_server.h:8,
from /home/fps/Documents/FL/FedTree/src/FedTree/FL/distributed_server.cpp:5:
/home/fps/.local/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
79 | #error "C++ versions less than C++14 are not supported."
| ^~~~~
In file included from /home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.grpc.pb.h:7,
from /home/fps/Documents/FL/FedTree/include/FedTree/FL/distributed_server.h:25,
from /home/fps/Documents/FL/FedTree/src/FedTree/FL/distributed_server.cpp:5:
/home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
17 | #error This file was generated by an older version of protoc which is
| ^~~~~
/home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
18 | #error incompatible with your Protocol Buffer headers. Please
| ^~~~~
/home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
19 | #error regenerate this file with a newer version of protoc.
| ^~~~~
In file included from /home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.grpc.pb.h:7,
from /home/fps/Documents/FL/FedTree/include/FedTree/FL/distributed_server.h:25,
from /home/fps/Documents/FL/FedTree/src/FedTree/FL/distributed_server.cpp:5:
/home/fps/Documents/FL/FedTree/include/FedTree/FL/../../../src/FedTree/grpc/fedtree.pb.h:26:10: fatal error: google/protobuf/generated_message_table_driven.h: No such file or directory
26 | #include <google/protobuf/generated_message_table_driven.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/FedTree/CMakeFiles/FedTree_DIST.dir/build.make:160: src/FedTree/CMakeFiles/FedTree_DIST.dir/FL/distributed_server.cpp.o] Error 1
[ 78%] Linking CXX shared library ../../lib/libFedTree.so
make[1]: *** [CMakeFiles/Makefile2:146: src/FedTree/CMakeFiles/FedTree_DIST.dir/all] Error 2
[ 78%] Built target FedTree
make: *** [Makefile:103: all] Error 2

Installation error

Hi,

I am trying to install the FedTree and I face following error after running make - j:

[ 99%] Linking CXX shared library ../../lib/libft_grpc_proto.so
[ 99%] Built target ft_grpc_proto
[ 99%] Linking CXX shared library ../../lib/libFedTree.so
/usr/bin/ld: /usr/local/lib/libntl.a(ZZ.o): relocation R_X86_64_TPOFF32 against _ZN3NTLL8iodigitsE' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libntl.a(fileio.o): relocation R_X86_64_TPOFF32 against _ZZN3NTL8UniqueIDB5cxx11EvE37_ntl_hidden_variable_tls_local_ptr_ID' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libntl.a(lip.o): relocation R_X86_64_TPOFF32 against _ZZ10_ntl_gswapPP17_ntl_gbigint_bodyS1_E36_ntl_hidden_variable_tls_local_ptr_t' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libntl.a(tools.o): relocation R_X86_64_TPOFF32 against symbol _ZN3NTL16ErrorMsgCallbackE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libntl.a(thread.o): relocation R_X86_64_TPOFF32 against _ZZN3NTL15CurrentThreadIDB5cxx11EvE37_ntl_hidden_variable_tls_local_ptr_ID' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libntl.a(BasicThreadPool.o): relocation R_X86_64_TPOFF32 against _ZZN3NTLL49_ntl_hidden_function_tls_access_NTLThreadPool_stgEvE52_ntl_hidden_variable_tls_local_ptr_NTLThreadPool_stg' can not be used when making a shared object; recompile with -fPIC
collect2: error: ld returned 1 exit status
make[2]: *** [src/FedTree/CMakeFiles/FedTree.dir/build.make:510: lib/libFedTree.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:5489: src/FedTree/CMakeFiles/FedTree.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I will appreciate it if you could help me to solve the problem

python horizontal FL

Hi, I want to run some code script within each communication round of the federated algorithm. Is there a method to run the client update, server update, and the aggregating algorithm at any point separately using the python horizontal classifier?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.