Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
/ doren-bnn Public archive

DOReN-inspired Binary Neural Network architecture.

License

Notifications You must be signed in to change notification settings

wei2912/doren-bnn

Repository files navigation

doren-bnn

PyTorch framework for building, testing and benchmarking Binarised Neural Networks (BNNs), which can be converted into Fully Homomorphic Encryption (FHE) versions to be executed on CONCRETE.

Warning: Much of the code pertaining to FHE is not functional, due to issues with bootstrapping in CONCRETE. Future versions of CONCRETE may address this problem, but would require significant modifications to the code.

Development Setup

Package Building

First install Poetry. Dependencies for the doren_bnn package can now be installed in a virtual environment with the following command:

poetry install

nbdime Setup

To view Jupyter notebooks with nbdime, configure the diff/merge drivers for this repository with the following command:

nbdime config-git --enable

pre-commit Setup

To enable the use of Git pre-commit hooks, install the pre-commit package with the following command:

pre-commit install

CONCRETE Setup

To set up the Concrete library, please follow the instructions at [https://docs.zama.ai/concrete/lib/user/installation.html]. Take note that the library is only supported on macOS and Linux.

Note: Currently, it seems that compilation only works on Nightly Rust and not stable.

Compiling Packages

doren_bnn_concrete

To run the executable in the library, run the following commands from the root directory:

cd doren_bnn_concrete
RUSTCFLAGS="target-cpu=native" cargo run --release

To build and install the Python bindings, run the following commands from the root directory:

cd doren_bnn_concrete
RUSTCFLAGS="target-cpu=native" maturin develop --release

You can now import the package doren_bnn_concrete from the root directory.

About

DOReN-inspired Binary Neural Network architecture.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages