Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Beacon]Get errors when compile logistic model #184

Open
deadlywing opened this issue Jun 29, 2023 · 2 comments
Open

[Beacon]Get errors when compile logistic model #184

deadlywing opened this issue Jun 29, 2023 · 2 comments

Comments

@deadlywing
Copy link

When I follow the instruction in Beacon and want to compile the logistic model with compile_networks.py, I find some error happens in compilation time.

I check the generated logistic.cpp, and find the headers seem to be wrong(lots of auto).
image

PS: the command I use:

(mpc_venv) root@8d3d49437847:/ezpc_dir/EzPC/Beacon# python3 compile_networks.py Logistic 128 1 0.1 CE no
Logistic
EzPC file dumped
Read file Logistic.ezpc ...
Parsed file Logistic.ezpc ...
Running the inference pass ...
Inferred binop labels and coercions ...
Typechecked the program ...
Applied 3-address code transformation ...
Partition: inlined function calls ... ...
Partition: unrolled loops ... ...
Split the program into 1 partition(s), generating .cpp files ...
Output(s) written to file(s) Logistic(n).cpp, n = 0, ... ...
-- Source of Randomness: rdseed
-- GMP libs: /usr/lib/x86_64-linux-gnu/libgmp.so /usr/lib/x86_64-linux-gnu/libgmpxx.so
-- Microsoft SEAL -> Version 3.3.2 detected
-- Microsoft SEAL -> Library build type: Static_PIC
-- Configuring done
-- Generating done
-- Build files have been written to: /ezpc_dir/EzPC/Beacon/build
Scanning dependencies of target Logistic_beacon
Scanning dependencies of target Logistic_secfloat
[ 25%] Building CXX object CMakeFiles/Logistic_beacon.dir/Logistic.cpp.o
[ 50%] Building CXX object CMakeFiles/Logistic_secfloat.dir/Logistic.cpp.o
/ezpc_dir/EzPC/Beacon/Logistic.cpp:932:15: error: conflicting declaration ‘const int32_t BATCH’
  932 | const int32_t BATCH = 128;
      |               ^~~~~
In file included from /ezpc_dir/EzPC/Beacon/Logistic.cpp:8:
/ezpc_dir/EzPC/SCI/build/install/include/library_float.h:49:12: note: previous declaration as ‘int BATCH’
   49 | extern int BATCH;
      |            ^~~~~
/ezpc_dir/EzPC/Beacon/Logistic.cpp:932:15: error: conflicting declaration ‘const int32_t BATCH’
  932 | const int32_t BATCH = 128;
      |               ^~~~~
In file included from /ezpc_dir/EzPC/Beacon/Logistic.cpp:8:
/ezpc_dir/EzPC/SCI/build/install/include/library_float.h:49:12: note: previous declaration as ‘int BATCH’
   49 | extern int BATCH;
      |            ^~~~~
CMakeFiles/Logistic_secfloat.dir/build.make:62: recipe for target 'CMakeFiles/Logistic_secfloat.dir/Logistic.cpp.o' failed
make[2]: *** [CMakeFiles/Logistic_secfloat.dir/Logistic.cpp.o] Error 1
CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/Logistic_secfloat.dir/all' failed
make[1]: *** [CMakeFiles/Logistic_secfloat.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/Logistic_beacon.dir/build.make:62: recipe for target 'CMakeFiles/Logistic_beacon.dir/Logistic.cpp.o' failed
make[2]: *** [CMakeFiles/Logistic_beacon.dir/Logistic.cpp.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/Logistic_beacon.dir/all' failed
make[1]: *** [CMakeFiles/Logistic_beacon.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
cp: cannot stat 'build/*_secfloat': No such file or directory
cp: cannot stat 'build/*_beacon': No such file or directory
@deevashwer
Copy link
Collaborator

Hi,

Thanks for bringing this to our notice. The Beacon frontend needs to be updated to accommodate the changes to the backend. For now, you can use the network files already committed here or make changes to the file output by the Beacon frontend so that it's consistent with the committed files.

@deadlywing
Copy link
Author

Hi,

Thanks for bringing this to our notice. The Beacon frontend needs to be updated to accommodate the changes to the backend. For now, you can use the network files already committed here or make changes to the file output by the Beacon frontend so that it's consistent with the committed files.

Thanks for replying.
But when I use the committed network files in the repo, I get a core dump error. It seems some bug exists in backward function. However, when I run lenet128, it runs well. The only(I find) difference between two network is that hinet use PoolProp in backward, but the lenet doesn't use this method.

client

(mpc_venv) root@8d3d49437847:/ezpc_dir/EzPC/Beacon# cat ../SCI/networks/inputs/hinet_input4.inp ../SCI/networks/inputs/hinet_labels4.inp | ./../SCI/build/bin/hinet4_beacon r=2 mbits=7 ebits=8
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
Input inp:
Input target:
Value of __tac_var209 : 0
Segmentation fault (core dumped)

server

(mpc_venv) root@8d3d49437847:/ezpc_dir/EzPC/Beacon# ./../SCI/build/bin/hinet4_beacon r=1 mbits=7 ebits=8 < ./../SCI/networks/inputs/hinet_weights.inp
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
connected
Input layer1W:
Input layer1b:
Input layer2W:
Input layer2b:
Input layer3W:
Input layer3b:
Input layer4W:
Input layer4b:
Value of __tac_var209 : 0
Segmentation fault (core dumped)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants