5 ms·
This is awesome! Can you describe how you implemented the WebGL ops a bit more? Did you have to write your own convolution kernel with GLSL for example?
by zan2434 10y ago
This is awesome! Can you describe how you implemented the WebGL ops a bit more? Did you have to write your own convolution kernel with GLSL for example?
- ilaksh 10y agoThey mentioned they used the weblas library/module. See code for example https://github.com/transcranial/keras-js/blob/master/src/Tensor.js https://github.com/transcranial/keras-js/blob/master/src/Ten... or code on weblas github repo.
- transcranial 10y agoThanks! For WebGL, credit goes to https://github.com/waylonflinn/weblas https://github.com/waylonflinn/weblas. I only really use GEMM, but it works quite well. In keras.js, convolution is implemented with the oft-used im2col transformation to turn it into a matrix multiply followed by reshape. Convolution kernels directly GLSL could potentially provide speed gains I'm sure, but I can't even imagine writing it for tensors of arbitrary shape.
- dharma1 10y agoCheck out the Winograd optimisations used in Nervana's neon - very fast https://www.nervanasys.com/winograd-2/ https://www.nervanasys.com/winograd-2/
- deleted 10y ago[deleted]