keras-js icon indicating copy to clipboard operation
keras-js copied to clipboard

explore potential speedups using WebGL 2.0

Open transcranial opened this issue 7 years ago • 3 comments

WebGL2 is here, and there are a number of features worth exploring:

  • direct texel lookups
  • texture arrays
  • non-power-of-2 textures

Will see if they offer any significant speedups.

https://webgl2fundamentals.org/webgl/lessons/webgl2-whats-new.html https://blog.chromium.org/2017/03/faster-3d-rendering-with-webgl-20.html

transcranial avatar Mar 17 '17 13:03 transcranial

Thanks for this awesome work! Regarding optimization, one potential issue is browser compatibility as the various browsers get on board over the coming months or (gasp!) years. Currently WebGL2 is available in about 1/4 of browsers ( http://caniuse.com/#feat=webgl2 ). To increase browser compatibility, it would be useful to turn off webgl entirely in keras-js. I couldn't find that option, however. If there is what is it?

Right now wayoflinn's weblas does not work on iOS devices: eg. https://github.com/waylonflinn/weblas/issues/39

I don't see much activity in his main branch now so having the option to turn off webgl would be useful until that gets settled.

goodmansasha avatar May 25 '17 22:05 goodmansasha

My hope is that WebGL 2.0 will resolve the issues with weblas on mobile.

My understanding is that the problems occur only in pipeline mode and that this is caused by lack of support for rendering to floating point textures on most mobile devices. The Khronos Group WebGL 2.0 Announcement (more specifically, pages 8 and 14) seems to indicate that rendering to floating point textures is no longer an extension to the spec, but now required.

I'd appreciate correction if I've misunderstood or if tests indicate that this isn't the case.

waylonflinn avatar May 31 '17 18:05 waylonflinn

Well I guess there is a 'gpu: false' setting . Didn't see that before :)

goodmansasha avatar May 31 '17 19:05 goodmansasha