Matrix multiplication in WebGL

79 views
Skip to first unread message

Evgeny Demidov

unread,
Apr 28, 2019, 2:55:26 AM4/28/19
to WebGL Dev List
New GEMMs at "WebGL2-compute vs. WebGL?" 
https://www.ibiblio.org/e-notes/webgl/gpu/mul/sgemm.htm#tex
4x4 sub-matrix multiplication algorithm is used. Inspired by Cedric Nugteren (and Nvidia earlier I think). HGEMM with HALF_FLOAT RGBA textures are almost x2 faster than SGEMM with FLOAT ones on GT 710.

It would be very interesting to test WebGL2 GEMM on Android e.g. in Google Pixel, while WebGL2-compute is not available on Android.

Evgeny

Ken Russell

unread,
Apr 29, 2019, 2:22:27 PM4/29/19
to WebGL Dev List
On a Pixel 2:

RGBA32F textures:
M=512 K=512 N=512
time = 48.6ms GFLOPS=2.76
time = 52.5ms GFLOPS=2.56
time = 50.3ms GFLOPS=2.67

RGBA16F textures:
time=23.2ms GFLOPS=5.79
time=18.5ms GFLOPS=7.26
time=18.3ms GFLOPS=7.33
time=19.6ms GFLOPS=6.85

Nice work Evgeny! Amazing to see mobile devices within a factor of 5 of desktop GPUs!

-Ken

 
Evgeny

--
You received this message because you are subscribed to the Google Groups "WebGL Dev List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-dev-lis...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Evgeny Demidov

unread,
May 2, 2019, 3:27:40 AM5/2/19
to WebGL Dev List
thank you Ken
GEMMs tests on Google Pixel.

and thanks to Jeff Gilbert for help with HALF_FLOAT textures
Demo with HALF_FLOAT RGBA16F textures

Evgeny
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-d...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages