Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

need webgl support #13

Open
mccoysc opened this issue Mar 24, 2019 · 15 comments
Open

need webgl support #13

mccoysc opened this issue Mar 24, 2019 · 15 comments

Comments

@mccoysc
Copy link

mccoysc commented Mar 24, 2019

cuda/opencl are all needing 3rd-party plugins to installed,only webgl is work natively(no plugins needed) in browser like env:browser,electron and so on.
why not add support for webgl?
@fjarri

@tuxxy
Copy link
Contributor

tuxxy commented Mar 24, 2019

I'm not sure this would be that useful. I'd imagine that WebGL is far slower than what OpenCL or CUDA can achieve.

@mccoysc
Copy link
Author

mccoysc commented Mar 24, 2019

I'm not sure this would be that useful. I'd imagine that WebGL is far slower than what OpenCL or CUDA can achieve.

but if supported,the code can be compiled to wasm by emscripten and run in mobile phoen.
1, as my tested data,the GPU in mobile is powerful enough for computing.
2,usually,no much data needed to be handled in one phone for phone is a private device and only handle some little private data.

@mccoysc
Copy link
Author

mccoysc commented Mar 24, 2019

some times,the mobile phone GPU is more powerful than some PC's

@tuxxy
Copy link
Contributor

tuxxy commented Mar 24, 2019

So, the reason to add WebGL will allow us to compile to WASM? Can we not just do this with extensions to, say, Rust instead of having to add support for another backend?

@mccoysc
Copy link
Author

mccoysc commented Mar 24, 2019

main reason is to support running in browser and mobile env

@mccoysc
Copy link
Author

mccoysc commented Mar 24, 2019

and then many apps can use this feature

@mccoysc
Copy link
Author

mccoysc commented Mar 24, 2019

only server/pc env usage is so limited and more and more private data is in mobile phone.
many people have no server to service self and also they may not have an trusted service provider

@tuxxy
Copy link
Contributor

tuxxy commented Mar 24, 2019

What use cases are you envisioning for mobile-based FHE applications?

@mccoysc
Copy link
Author

mccoysc commented Mar 24, 2019

FHE is to protect privacy.
for modern people,the most privacy is stored and used in mobile phone.
if FHE can not be used in mobile phone, the people should maintain a server to do that?
or people should trust a 3rd-party organize to maintain a server to do that ?

@tuxxy
Copy link
Contributor

tuxxy commented Mar 24, 2019

Right, that's great -- we definitely need more privacy in our devices/applications/etc.

What I want to understand is what exactly you're hoping to accomplish with WebGL here. Is there something you'd like to build on a mobile variant? If so, what is it?

@mccoysc
Copy link
Author

mccoysc commented Mar 24, 2019

I would like to do a job-find and recruit platform.
The platform make matching based on AI using encrypted data and return encrypted result to requestor and requestor share the result though the platform

@mccoysc
Copy link
Author

mccoysc commented Mar 24, 2019

Many people find job on phone and many company find employee on phone

@michwill
Copy link

Actually, you don't need to process encrypted data on the phone. You will certainly need to encrypt and decrypt on the phone (I believe, should be possible to do, yes), but the difficult part is happening on a server without the server knowing anything (and that is the whole point)

@mccoysc
Copy link
Author

mccoysc commented Mar 25, 2019

yes,i don't "PROCESS" it,but i need encrypt/decrypt it using homomorphic encryption

@fjarri
Copy link
Contributor

fjarri commented Mar 25, 2019

Ok, sorry for taking so long to reply, here's my five cents.

  1. "cuda/opencl are all needing 3rd-party plugins to installed" - that's true (if you stretch the definition of "plugin"), but so does webgl - it requires a browser, and some kind of an interface from Python to it. I do not know much about mobile platforms and the current state of running arbitrary code in the browser (e.g. whether it can be accessed from Python, or the other way around).

  2. I am not sure how well WebGL is suited for general purpose computations and not specifically for graphics. If it's anything like OpenGL, as its name suggests, it will be quite hard to do GPGPU on it.

  3. Apparently, OpenCL does support mobile GPUs. Whether it will be faster than using the CPU (for this particular purpose) is uncertain, but will be interesting to test. It also seems to be a more straightforward way to use the GPU (and will require less new code).

Now I just want to ascertain what your goal is, that is, what you want to be able to do, without going into implementation details. If you want to encrypt/decrypt without a GPU, that is quite easy to do: these are just simple inner products that numpy can handle fast enough. If you want to do that in a browser, that may require writing a JS library, which will be more time-consuming (although if it's just encryption and decryption, still pretty straightforward).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants