Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does blas available in pyodide's numpy? #1574

Closed
yxdragon opened this issue May 4, 2021 · 2 comments
Closed

does blas available in pyodide's numpy? #1574

yxdragon opened this issue May 4, 2021 · 2 comments

Comments

@yxdragon
Copy link

yxdragon commented May 4, 2021

I try to use Planer in pyodide. which is a cnn framework based on pure numpy.
But I found the pyodide runs 50-500 times slower than the native. I test many operation on both pyodide and native.
the most different is np.dot:

arr = np.zeros((1024,1024), dtype=np.float32)
start = time()
np.dot(arr, arr)
print(time()-start, 'sumcost')

pyodide: 3s, native: 0.005s
So I think the pyodide run without blas.

Is there any plan about supporting blas?

@rth
Copy link
Member

rth commented May 4, 2021

Yes, we are currently not explicitly using a BLAS in numpy. We could use the Netlib BLAS which is built in Pyodide but when no BLAS is specified as far as I can tell CBLAS would already be used, which is equivalent..

See #227 for a discussion on using a high performance BLAS. Closing as a duplicate, please don't hesitate to comment there.

I try to use Planer in pyodide

Just curious what made you try Pyodide as opposed to exporting to ONNX and using ONNX.js for that use case?

@rth rth closed this as completed May 4, 2021
@yxdragon
Copy link
Author

yxdragon commented May 6, 2021

Just curious what made you try Pyodide as opposed to exporting to ONNX and using ONNX.js for that use case?
first of all, I am not very aware of web (js/node/html...) I just use one of my repo (planer) as a demo to try pyodide.
Thanks for your advice, and after brosing onnx.js, I think planer‘s meaning is: a cnn models need pre-after processing, for onnx.js, we need do pre-processing in python, then run net in js, and do after-processing in python. But for planer, we can wrap the pre-net-after as one function, and call it through pyodide. here is some model in planer wrapped as one function.
(planer support numpy/cupy, So planer need a blas for numpy, and is it possible to implement a cupy with webgl?)

We could use the Netlib BLAS which is built in Pyodide
how to use it?

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

No branches or pull requests

2 participants