apache / tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
https://tvm.apache.org/
Apache License 2.0
11.42k stars 3.4k forks source link

[WebGPU] Translate `int8x4` into `u32` #17071

Closed Jiawei-Shao closed 1 month ago

Jiawei-Shao commented 1 month ago

This patch translates an int8x4 into a u32 in WGSL shaders as 8-bit integers are not supported in WebGPU right now and the WGSL built-in function dot4I8Packed() accepts u32 as its inputs and each of the u32 value logically represents a 4-element 8-bit integer vector.

issue: #16627

Jiawei-Shao commented 1 month ago

Hi @tqchen I'd like to submit this part first then work on adding DP4A in TIR. PTAL, thanks!

tqchen commented 1 month ago

thank you @Jiawei-Shao