Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Add SGX doc
Browse files Browse the repository at this point in the history
Signed-off-by: Pei Wang <[email protected]>
  • Loading branch information
uraj committed Jul 12, 2019
1 parent dd3eb67 commit 7ae0051
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ Please refer to our [release announcement](https://github.com/PaddlePaddle/Anaki
- Assembly level optimization. Saber is a underlying DNN library for Anakin, which
is deeply optimized at assembly level.

- **Security**

Anakin now supports Intel Software Guard Extensions
([SGX](https://software.intel.com/en-us/sgx)). SGX is a set of instructions
that can set up a extremely secure execution enironment that prevents other
software from inspecting the execution state of your application. Even
privileged code like OS and VMM cannot pry into or tamper with the data and
code of Anakin. To learn more about Anakin for SGX, refer to the
[tutorial](docs/Manual/run_on_sgx.md).

## NV GPU Benchmark
### Machine And Enviornment
> CPU: `Intel(R) Xeon(R) CPU 5117 @ 2.0GHz`
Expand Down
41 changes: 41 additions & 0 deletions docs/Manual/run_on_sgx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Compile Anakin for Intel SGX
Currently, only Linux is supported. You can either use Ubuntu or Cent OS, with
the versions supported by Intel SGX Linux driver. Check out the latest versions
of SGX software stack [here](https://01.org/intel-software-guard-extensions/downloads).

## Steps

Follow these steps to build and run Anakin in an SGX secure enclave.

1. Check out if your CPU and motherboard support SGX. Boot into your BIOS
and see if there is an option controlling the availability of SGX. If
there is such an option, turn it on.
2. Download and Install Intel SGX SDK and driver. The software packages and
documentation can be found at [Intel Open
Source](https://01.org/intel-software-guard-extensions/downloads).
3. Download and Install Intel MKL (not MKL-ML or MKL-DNN). You will need
MKL 2019 Update 3. Older versions of MKL may cause problems like memory
leak.
4. Run the [SGX build script](../../tools/sgx_build.sh).
5. If the build succeeds, you will find an executable called `anakin_app`
under the `sgx_build/sgx` directory. The executable provides basic
interfaces to help you quickly deploy a model and run some inference tasks.
However, if you really need to use Anakin for SGX in production, you have to
customize the ECALL/OCALL interfaces your self. the corresponding code can be
found at [here](../../sgx).

## Support

SGX can be a complicated concept to understand for beginners. Feel free to
submit any issues if you are interested in extra security but new to SGX. In
case you are a systems developer and are knowledgeable about Intel chip
technology, you may find this [paper](https://eprint.iacr.org/2016/086.pdf)
helpful.

## Disclaimer

Anakin for SGX is still experimental and under active development. It is not
extensively tested as on other platforms. Some operators and models may not be
supported. Also, due to the limitations of the hardware, you will likely suffer
from some performance degradation. You can report considerably slow cases to us
to help improve Anakin for SGX.

0 comments on commit 7ae0051

Please sign in to comment.