peiji1981 / ppu

Home Page:https://ppu.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PPU: Privacy-Preserving Processing Unit

PPU (Privacy-Preserving Processing Unit) aims to be a provable, measurable secure computation device, which provides computation ability while keep your private data protected.

Project status

Currently, we mainly focus on the provable security. It contains a secure runtime that evaluates XLA-like tensor operations, which use MPC as the underline evaluation engine to protect privacy information.

Contents

Build

Prerequisite

Docker

## start container
docker run -d -it --name ppu-gcc11-dev-$(whoami) \
         --mount type=bind,source="$(pwd)",target=/home/admin/dev/ \
         -w /home/admin/dev \
         --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
         --cap-add=NET_ADMIN \
         registry.hub.docker.com/secretflow/ppu-gcc11-anolis-dev:latest

# attach to build container
docker exec -it ppu-gcc11-dev-$(whoami) bash

Linux

Install gcc>=11.2, cmake>=3.18, ninja, nasm>=2.15, python==3.8, bazel==4.2

python3 -m pip install -r docker/requirements.txt

macOS

# Install Xcode
https://apps.apple.com/us/app/xcode/id497799835?mt=12

# Select Xcode toolchain version
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

# Install homebrew
https://brew.sh/

# Install dependencies
brew install bazel cmake ninja nasm

# Install python dependencies
python3 -m pip install -r docker/requirements.txt

Build & UnitTest

# build as debug
bazel build //... -c dbg

# build as release
bazel build //... -c opt

# test
bazel test //...

# [optional] build & test with ASAN
bazel build //... -c dbg --config=asan
bazel test //... --config=asan -c dbg

Bazel build options

  • --define gperf=on enable gperf
  • --define tracelog=on enable link trace log.

Build docs

# prerequisite
pip install -U sphinx
pip install -U recommonmark

cd docs & make html  # html docs will be in docs/_build/html

FAQ

How can I use PPU?

PPU could be treated as a programmable device, it's not designed to be used directly. Normally we use secretflow framework, which use PPU as the underline privacy-preserving computing device.

Acknowledgement

Thanks for Alibaba Gemini Lab for the security advices.

About

https://ppu.readthedocs.io

License:Apache License 2.0


Languages

Language:C++ 73.4%Language:MLIR 19.7%Language:Starlark 5.3%Language:Python 1.1%Language:C 0.3%Language:Dockerfile 0.1%Language:Shell 0.1%Language:HTML 0.0%