1 4 : 3 5 P M — 1 5 : 1 0 P M C r y p Te n : A M L f r a m e w o r k b a s e d o n s e c u r e c o m p u t i n g t e c h n i q u e s Shubho Sengupta Facebook
import crypten import torch crypten.init() # sets up # communication x = torch.tensor([1.0, 2.0, 3.0]) x_enc = crypten.cryptensor(x) # encrypts tensor Why is CrypTen the way it is? x_dec = x_enc.get_plain_text() # decrypts tensor assert torch.all_close(x_dec, x) # this passes! y_enc = crypten.cryptensor([2.0, 3.0, 4.0]) xy_enc = x_enc + y_enc # adds encrypted # tensors xy_dec = xy_enc.get_plain_text() assert torch.all_close(xy_dec, x + y) # this passes!
Expose the Machine Learning Community to Secure Computing Techniques
ML Centric Interface
ML Centric Interface Explainable Performance
ML Centric Interface Explainable Performance Debuggability
ML Centric Interface Explainable Performance Debuggability Interoperability
Honest but curious ML Centric Interface Explainable Performance Debuggability Interoperability
What makes an ML framework?
Tensor What makes an ML framework?
Tensor Operators What makes an ML framework?
Tensor Operators What makes an ML framework? Computation graph
Tensor Operators What makes an ML framework? Computation graph Gradients
Mul
Mul
Mul
Mul BMul
AccumGrad AccumGrad Mul BMul
AccumGrad AccumGrad Mul BMul
CrypTensor
CrypTensor MPCTensor
CrypTensor MPCTensor ArithmeticShared Tensor
CrypTensor MPCTensor ArithmeticShared BinaryShared Tensor Tensor
CrypTensor MPCTensor ArithmeticShared BinaryShared Tensor Tensor LongTensor
CrypTensor MPCTensor ArithmeticShared BinaryShared Tensor Tensor LongTensor
CrypTensor MPCTensor ArithmeticShared BinaryShared Tensor Tensor LongTensor PyTorch
CrypTensor Interface filters up MPCTensor ArithmeticShared BinaryShared Tensor Tensor LongTensor PyTorch
CrypTensor Interface filters up MPCTensor Performance is linked ArithmeticShared BinaryShared Tensor Tensor LongTensor PyTorch
CrypTensor Interface filters up MPCTensor Performance is linked ArithmeticShared BinaryShared Communication libraries Tensor Tensor LongTensor PyTorch
What operations do we need for Machine Learning training?
matmul() , conv2d() What operations do we need for Machine Learning training?
matmul() , conv2d() log() , exp() What operations do we need for Machine Learning training?
matmul() , conv2d() log() , exp() What operations do we div() need for Machine Learning training?
matmul() , conv2d() log() , exp() What operations do we div() need for Machine Learning training? pow() , sqrt()
matmul() , conv2d() log() , exp() What operations do we div() need for Machine Learning training? pow() , sqrt() relu() , max() , argmax()
CrypTensor MPCTensor ArithmeticShared BinaryShared Tensor Tensor LongTensor PyTorch
CrypTensor
CrypTensor
AutogradCrypTensor CrypTensor
Module AutogradCrypTensor CrypTensor
Module Compatibility AutogradCrypTensor CrypTensor
Module Compatibility AutogradCrypTensor Use pre-trained models CrypTensor
Module Compatibility AutogradCrypTensor Use pre-trained models Train models from scratch CrypTensor
AllReduce
Open to all AllReduce
Open to all AllReduce Reduce
Open to all AllReduce Open to one Reduce
Open to all AllReduce Open to one Reduce Broadcast
Open to all AllReduce Open to one Reduce Trusted dealer to parties Broadcast
PyTorch CrypTen
PyTorch CrypTen import torch x = torch.tensor([1.0, 2.0, 3.0]) y = torch.tensor([2.0, 3.0, 4.0]) xy = x + y
PyTorch CrypTen import crypten import torch crypten.init() # sets up # communication x_enc = crypten.cryptensor([1.0, 2.0, 3.0]) x = torch.tensor([1.0, 2.0, 3.0]) y_enc = crypten.cryptensor([2.0, 3.0, 4.0]) y = torch.tensor([2.0, 3.0, 4.0]) xy_enc = x_enc + y_enc xy = x + y
PyTorch CrypTen pt = torch.tensor([1.0, 2.0, 3.0]) pt = torch.tensor([1.0, 2.0, 3.0]) ct = AutogradCrypTensor(crypten.cryptensor(pt)) ct_loss = ct.cross_entropy() pt_loss = pt.cross_entropy() ct_loss.backward() pt_loss.backward()
How do we work with real model and datasets?
import crypten import torchvision.datasets as datasets import torchvision.models as models crypten.init() How do we work with real model and datasets?
import crypten import torchvision.datasets as datasets import torchvision.models as models crypten.init() # download and set up ImageNet dataset: transform = transforms.Compose([ transforms.Resize(256), How do we work with transforms.CenterCrop(224), transforms.ToTensor(), transforms.Normalize(mean=[0.48, 0.45, 0.41], std=[0.23, 0.22, 0.23]), real model and datasets? ]) dataset = datasets.ImageNet(imagenet_folder, transform=transform)
import crypten import torchvision.datasets as datasets import torchvision.models as models crypten.init() # download and set up ImageNet dataset: transform = transforms.Compose([ transforms.Resize(256), How do we work with transforms.CenterCrop(224), transforms.ToTensor(), transforms.Normalize(mean=[0.48, 0.45, 0.41], std=[0.23, 0.22, 0.23]), real model and datasets? ]) dataset = datasets.ImageNet(imagenet_folder, transform=transform) # download pre-trained ResNet-18 model and encrypt it: model = models.resnet18(pretrained=True) encrypted_model = crypten.nn.from_pytorch(model, dataset[0])
import crypten import torchvision.datasets as datasets import torchvision.models as models crypten.init() # download and set up ImageNet dataset: transform = transforms.Compose([ transforms.Resize(256), How do we work with transforms.CenterCrop(224), transforms.ToTensor(), transforms.Normalize(mean=[0.48, 0.45, 0.41], std=[0.23, 0.22, 0.23]), real model and datasets? ]) dataset = datasets.ImageNet(imagenet_folder, transform=transform) # download pre-trained ResNet-18 model and encrypt it: model = models.resnet18(pretrained=True) encrypted_model = crypten.nn.from_pytorch(model, dataset[0]) # do inference on encrypted images with encrypted model: encrypted_image = crypten.cryptensor(dataset[1]) encrypted_output = encrypted_model(encrypted_image)
import crypten import torchvision.datasets as datasets import torchvision.models as models crypten.init() # download and set up ImageNet dataset: transform = transforms.Compose([ transforms.Resize(256), How do we work with transforms.CenterCrop(224), transforms.ToTensor(), transforms.Normalize(mean=[0.48, 0.45, 0.41], std=[0.23, 0.22, 0.23]), real model and datasets? ]) dataset = datasets.ImageNet(imagenet_folder, transform=transform) # download pre-trained ResNet-18 model and encrypt it: model = models.resnet18(pretrained=True) encrypted_model = crypten.nn.from_pytorch(model, dataset[0]) # do inference on encrypted images with encrypted model: encrypted_image = crypten.cryptensor(dataset[1]) encrypted_output = encrypted_model(encrypted_image) output = encrypted_output.get_plain_text() # this works!
Improving Performance
Improving Performance More Secure TTP
Support for other Improving Performance techniques? More Secure TTP
Support for other Improving Performance techniques? More Secure TTP Quantifying information leakage?
ILSVRC Challenge
ILSVRC Challenge Train on a million images
ILSVRC Challenge Train on a million images Classify with high accuracy
ILSVRC Challenge Train on a million images Classify with high accuracy Done in minutes
ILSVRC Challenge Question? Train on a million images Classify with high accuracy Done in minutes
ILSVRC Challenge Question? Train on a million images Train on a million encrypted images Classify with high accuracy Done in minutes
ILSVRC Challenge Question? Train on a million images Train on a million encrypted images Classify with high accuracy Classify with high accuracy Done in minutes
ILSVRC Challenge Question? Train on a million images Train on a million encrypted images Classify with high accuracy Classify with high accuracy Done in minutes Done in a week
CrypTen Team at Facebook
Awni CrypTen Team at Facebook
Awni Brian CrypTen Team at Facebook
Awni Brian Laurens CrypTen Team at Facebook
Awni Brian Laurens CrypTen Team at Mark Facebook
Awni Brian Laurens CrypTen Team at Mark Facebook Shobha
Awni Brian Laurens CrypTen Team at Mark Facebook Shobha Shubho
Awni Brian Laurens CrypTen Team at Mark Facebook Shobha Shubho Vini
Recommend
More recommend