Skip to content
A library for encrypted, privacy preserving deep learning
Python Other
  1. Python 99.9%
  2. Other 0.1%
Branch: dev
Clone or download
andrelmfarias and LaRiffle Add QR decomposition for SMPC (#2579)
* Implemented QR decomposition for local and remote tensors (no MPC)

* improved for non-symmetric matrices

* included qr in

* implemented test qr

* included modes and improved docstring

* implem tests for different modes

* fixed conditions with mode

* fix typo

* replaced th. by torch.

* updated tests and added random seed setting

* init qr decomposition in mpc

* implemented norm MPC

* fixed imports after last merged changes

* black

* implemented norm in mpc and qr_mpc

* Added docstring for norm_mpc

* update docstring

* implem test for norm_mpc

* implem efficiency test for mpc norm

* Finalized QR decomposition in MPC

* completed docstring and implemented tests for qr_mpc

* fixed typo on docstring

* integrated the majority of Théo's comments

* send masked tensor to crypto_prov without calling .get() for the local worker

* removed repeated creation of workers in tests
Latest commit 6795f96 Sep 18, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update issue templates May 29, 2019
art Improve the diagram Jul 9, 2019
docker-image delete unecessary package installation, numpy comes already with pysyft Jun 12, 2019
docs bumpversion 0.1.27a1 -> 0.1.28a1 (#2619) Sep 17, 2019
examples Improvements to the Federated Recurrent Neural Network notebook (#2613) Sep 12, 2019
images Add files via upload Jul 16, 2019
syft Add QR decomposition for SMPC (#2579) Sep 18, 2019
test Add QR decomposition for SMPC (#2579) Sep 18, 2019
.flake8 changed ignore to select Apr 18, 2019
.gitbook.yaml added gitbook.yaml Apr 23, 2019
.gitignore Changes to socketio_server worker to allow sync communication with th… Apr 30, 2019
.pre-commit-config.yaml change black repo from ambv-> psf (#2509) Aug 15, 2019
.travis.yml Fixing RNN tests (#2545) Aug 22, 2019 Update (#2449) Aug 13, 2019 Cleanup markdown docs Apr 27, 2019
LICENSE Create LICENSE May 29, 2019
Makefile Fixing RNN tests (#2545) Aug 22, 2019 Fix logo link in Readme (#2538) Aug 21, 2019
pyproject.toml fixed black regex Apr 18, 2019
requirements.txt Fix build issues by downgrading torch (#2491) Aug 12, 2019
requirements_dev.txt Add pyshark to requirements_dev.txt Jul 20, 2019 Generalize and improve implementation (#2591) Sep 9, 2019
setup.cfg bumpversion 0.1.27a1 -> 0.1.28a1 (#2619) Sep 17, 2019 bumpversion 0.1.27a1 -> 0.1.28a1 (#2619) Sep 17, 2019


Binder Build Status Chat on Slack FOSSA Status

PySyft is a Python library for secure, private Deep Learning. PySyft decouples private data from model training, using Federated Learning, Differential Privacy, and Multi-Party Computation (MPC) within PyTorch. Join the movement on Slack.

PySyft in Detail

A more detailed explanation of PySyft can be found in the paper on arxiv

PySyft has also been explained in video form by Siraj Raval


Optionally, we recommend that you install PySyft within the Conda virtual environment. If you are using Windows, I suggest installing Anaconda and using the Anaconda Prompt to work from the command line.

conda create -n pysyft python=3
conda activate pysyft # some older version of conda require "source activate pysyft" instead.
conda install jupyter notebook


PySyft supports Python >= 3.6 and PyTorch 1.1.0

pip install syft

If you have an installation error regarding zstd, run this command and then re-try installing syft.

pip install --upgrade --force-reinstall zstd

If this still doesn't work, and you happen to be on OSX, make sure you have OSX command line tools installed and try again.

You can also install PySyft from source on a variety of operating systems by following this installation guide.

Run Local Notebook Server

All the examples can be played with by running the command

make notebook

and selecting the pysyft kernel

Use the Docker image

Instead of installing all the dependencies on your computer, you can run a notebook server (which comes with Pysyft installed) using Docker. All you will have to do is start the container like this:

$ docker container run openmined/pysyft-notebook

You can use the provided link to access the jupyter notebook (the link is only accessible from your local machine).

NOTE: If you are using Docker Desktop for Mac, the port needs to be forwarded to localhost. In that case run docker with: bash $ docker container run -p 8888:8888 openmined/pysyft-notebook to forward port 8888 from the container's interface to port 8888 on localhost and then access the notebook via

You can also set the directory from which the server will serve notebooks (default is /workspace).

$ docker container run -e WORKSPACE_DIR=/root openmined/pysyft-notebook

You could also build the image on your own and run it locally:

$ cd docker-image
$ docker image build -t pysyft-notebook .
$ docker container run pysyft-notebook

More information about how to use this image can be found on docker hub

Try out the Tutorials

A comprehensive list of tutorials can be found here

These tutorials cover how to perform techniques such as federated learning and differential privacy using PySyft.

High-level Architecture

alt text

Start Contributing

The guide for contributors can be found here. It covers all that you need to know to start contributing code to PySyft in an easy way.

Also join the rapidly growing community of 5000+ on Slack. The slack community is very friendly and great about quickly answering questions about the use and development of PySyft!


We have written an installation example in this colab notebook, you can use it as is to start working with PySyft on the colab cloud, or use this setup to fix your installation locally.

Organizational Contributions

We are very grateful for contributions to PySyft from the following organizations!

Udacity coMind Arkhn Dropout Labs


Do NOT use this code to protect data (private or otherwise) - at present it is very insecure. Come back in a couple months.


Apache License 2.0

FOSSA Status

You can’t perform that action at this time.