Giter Club home page Giter Club logo

Comments (4)

dimakuv avatar dimakuv commented on June 23, 2024

transmit tensors between SGX and the untrusted environment

Please expand on this. What do you mean by "transmit"? In which direction? In which format? Can you use regular files for this transmission (that's the typical way of sharing something between the untrusted host and the SGX enclave)?

from graphene.

ziqi-zhang avatar ziqi-zhang commented on June 23, 2024

Thanks for your quick apply! I want to perform some tensor computation inside the SGX and other computations in the untrusted environment. This requires to transmit variables in and out the SGX in both directions.

The format is pytorch tensor. Regular files are viable options but I'm afraid the file operation is slow. Is it possible to use some shared memory between SGX and the untrusted environment?

This repo implements a similar feature using TensorFlow. However, because I'm not very familiar with SGX, currently I don't know how it implements this feature.

from graphene.

dimakuv avatar dimakuv commented on June 23, 2024

I want to perform some tensor computation inside the SGX and other computations in the untrusted environment.

Gramine is a generic SGX runtime, and it doesn't allow for splitting the process in trusted and untrusted parts. The whole process must be shifted inside Gramine (and thus to inside the SGX enclave). So I'm afraid that without significant refactoring of your original PyTorch program, you won't be able to achieve your goal.

Is it possible to use some shared memory between SGX and the untrusted environment?

No, Gramine doesn't support this. Maybe in the future we'll add such support, but currently there is none.

This repo implements a similar feature using TensorFlow.

The Slalom (https://github.com/ftramer/slalom) work is definitely interesting, but Gramine has different purposes, design, and implementation. Thus, Gramine cannot do similar things as Slalom.

The only thing you can try to do with Gramine is something like this:

  • Split your original PyTorch application such that it runs two processes
  • One process will do the tensor computations inside the SGX enclave
  • Another process will do other computations in the untrusted environment
  • Make these two processes communicate with each other using regular files or for example TCP/IP sockets; make sure to use proper encryption schemes on these files/sockets to protect data transmitted between the trusted and the untrusted processes

Now you can shift the first process in the SGX enclave using Gramine. And the second process just runs outside.

from graphene.

ziqi-zhang avatar ziqi-zhang commented on June 23, 2024

Thanks!

from graphene.

Related Issues (20)

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.