Git Product home page Git Product logo

6fj / spu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from secretflow/spu

0.0 0.0 0.0 3.33 MB

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

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

License: Apache License 2.0

Shell 0.10% C++ 70.03% Python 4.27% C 0.13% Dockerfile 0.18% MLIR 20.93% Starlark 4.36%

spu's Introduction

SPU: Secure Processing Unit

CircleCI

SPU (Secure Processing Unit) aims to be a provable, measurable secure computation device, which provides computation ability while keeping your private data protected.

Project status

Currently, we mainly focus on 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 spu-gcc11-anolis-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 \
         --privileged=true \
         registry.hub.docker.com/secretflow/spu-gcc11-anolis-dev:latest

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

Linux

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

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

macOS

# macOS >= 11, Xcode >=13.0

# 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 or UBSAN, for macOS users please use configs with macOS prefix
bazel test //... --config=[macos-]asan
bazel test //... --config=[macos-]ubsan

Build docs

# prerequisite
pip install -U sphinx

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

FAQ

How can I use SPU?

SPU could be treated as a programmable device, it's not designed to be used directly. Normally we use SecretFlow framework, which use SPU as the underline secure computing device.

SPU python package also contains a simple distributed module to demo SPU usage, but it's NOT designed for production due to system security and performance concerns, please DO NOT use it directly in production.

Acknowledgement

We thank the significant contributions made by Alibaba Gemini Lab.

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.