All Projects → NervanaSystems → He Transformer

NervanaSystems / He Transformer

Licence: apache-2.0
nGraph-HE: Deep learning with Homomorphic Encryption (HE) through Intel nGraph

Projects that are alternatives of or similar to He Transformer

Rubyspeed
Compile ruby functions to C
Stars: ✭ 180 (-7.69%)
Mutual labels:  compiler
Appfairy
A CLI tool to Migrate a Webflow project into a React app
Stars: ✭ 183 (-6.15%)
Mutual labels:  compiler
El Compilador
An SSA-based compiler for Emacs Lisp
Stars: ✭ 187 (-4.1%)
Mutual labels:  compiler
Snapdragon
snapdragon is an extremely pluggable, powerful and easy-to-use parser-renderer factory.
Stars: ✭ 180 (-7.69%)
Mutual labels:  compiler
Tampio
Tampio: An object-oriented programming language made to resemble Finnish
Stars: ✭ 181 (-7.18%)
Mutual labels:  compiler
Mlkit
Standard ML Compiler and Toolkit
Stars: ✭ 183 (-6.15%)
Mutual labels:  compiler
Go.vm
A simple virtual machine - compiler & interpreter - written in golang
Stars: ✭ 178 (-8.72%)
Mutual labels:  compiler
Ape
Ape Programming Language
Stars: ✭ 195 (+0%)
Mutual labels:  compiler
Veriloggen
Veriloggen: A Mixed-Paradigm Hardware Construction Framework
Stars: ✭ 182 (-6.67%)
Mutual labels:  compiler
Faerie
Magical ELF and Mach-o object file writer backend
Stars: ✭ 187 (-4.1%)
Mutual labels:  compiler
Varjo
Lisp to GLSL Language Translator
Stars: ✭ 181 (-7.18%)
Mutual labels:  compiler
Philip2
An Elm to OCaml compiler
Stars: ✭ 182 (-6.67%)
Mutual labels:  compiler
Minijit
A basic x86-64 JIT compiler written from scratch in stock Python
Stars: ✭ 185 (-5.13%)
Mutual labels:  compiler
Llvm Guide Zh
User Guides For those new to the LLVM system.(LLVM系统的新用户指南,中文翻译版)
Stars: ✭ 180 (-7.69%)
Mutual labels:  compiler
Lhc
The LLVM LHC Haskell Optimization System
Stars: ✭ 188 (-3.59%)
Mutual labels:  compiler
Potigol
Linguagem Potigol - Linguagem de programação funcional moderna para iniciantes - A Functional Programming Language for Beginners
Stars: ✭ 179 (-8.21%)
Mutual labels:  compiler
Prototype
(deprecated) The journey continues at ASNEXT: https://github.com/AssemblyScript/assemblyscript
Stars: ✭ 2,114 (+984.1%)
Mutual labels:  compiler
Fast
Find in AST - Search and refactor code directly in Abstract Syntax Tree as you do with grep for strings
Stars: ✭ 194 (-0.51%)
Mutual labels:  compiler
Splash
Simple Programming LAnguage for SHortcuts
Stars: ✭ 192 (-1.54%)
Mutual labels:  compiler
Hybridizer Basic Samples
Examples of C# code compiled to GPU by hybridizer
Stars: ✭ 186 (-4.62%)
Mutual labels:  compiler

HE Transformer for nGraph

This project has moved to https://github.com/IntelAI/he-transformer

The Intel® HE transformer for nGraph™ is a Homomorphic Encryption (HE) backend to the Intel® nGraph Compiler, Intel's graph compiler for Artificial Neural Networks.

Homomorphic encryption is a form of encryption that allows computation on encrypted data, and is an attractive remedy to increasing concerns about data privacy in the field of machine learning. For more information, see our original paper. Our updated paper showcases many of the recent advances in he-transformer.

This project is meant as a proof-of-concept to demonstrate the feasibility of HE on local machines. The goal is to measure performance of various HE schemes for deep learning. This is not intended to be a production-ready product, but rather a research tool.

Currently, we support the CKKS encryption scheme, implemented by the Simple Encrypted Arithmetic Library (SEAL) from Microsoft Research.

Additionally, we integrate with the Intel® nGraph™ Compiler and runtime engine for TensorFlow to allow users to run inference on trained neural networks through Tensorflow.

Examples

The examples folder contains a deep learning example which depends on the Intel® nGraph™ Compiler and runtime engine for TensorFlow.

Building HE Transformer

Dependencies

  • Operating system: Ubuntu 16.04, Ubuntu 18.04.
  • CMake >= 3.12
  • Compiler: g++ version >= 6.0, clang >= 5.0
  • OpenMP is strongly suggested, though not strictly necessary. You may experience slow runtimes without OpenMP
  • python3 and pip3
  • virtualenv v16.1.0
  • bazel v0.25.2

For a full list of dependencies, see the docker containers, which build he-transformer on a reference OS.

The following dependencies are built automatically

To install bazel

    wget https://github.com/bazelbuild/bazel/releases/download/0.25.2/bazel-0.25.2-installer-linux-x86_64.sh
    bash bazel-0.25.2-installer-linux-x86_64.sh --user

Add and source the bin path to your ~/.bashrc file to call bazel

 export PATH=$PATH:~/bin
 source ~/.bashrc

1. Build HE-Transformer

Before building, make sure you deactivate any active virtual environments (i.e. run deactivate)

git clone https://github.com/NervanaSystems/he-transformer.git
cd he-transformer
export HE_TRANSFORMER=$(pwd)
mkdir build
cd $HE_TRANSFORMER/build
cmake .. -DCMAKE_CXX_COMPILER=clang++-6.0
make install
source external/venv-tf-py3/bin/activate

Note, you may need sudo permissions to install he_seal_backend to the default location. To set a custom installation prefix, add the -DCMAKE_INSTALL_PREFIX=~/my_install_prefix flag to the cmake command.

1a. To build documentation

First install doxygen, i.e.

sudo apt-get install doxygen

Then add the following CMake flag

cmake .. -DNGRAPH_HE_DOC_BUILD_ENABLE=ON

and call

make docs

to create doxygen documentation in $HE_TRANSFORMER/build/doc/doxygen.

1b. Python bindings for client

To build a client-server model with python bindings (recommended for running neural networks through TensorFlow):

cd $HE_TRANSFORMER/build
source external/venv-tf-py3/bin/activate
make install python_client

This will create python/dist/pyhe_client-*.whl. Install it using

pip install python/dist/pyhe_client-*.whl

To check the installation worked correctly, run

python3 -c "import pyhe_client"

This should run without errors.

2. Run C++ unit-tests

cd $HE_TRANSFORMER/build
# To run single HE_SEAL unit-test
./test/unit-test --gtest_filter="HE_SEAL.add_2_3_cipher_plain_real_unpacked_unpacked"
# To run all C++ unit-tests
./test/unit-test

3. Run python examples

See examples/README.md for examples of running he-transformer for deep learning inference on encrypted data.

Code formatting

Please run maint/apply-code-format.sh before submitting a pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].