### What happened? Several of our tests are failing to compile using the WebGPU compiler target, during compilation from SPIR-V to WGSL using Tint. From [`tests/e2e/xla_ops/`](https://github.com/iree-org/iree/tree/main/tests/e2e/xla_ops): * reverse.mlir * scatter.mlir * sort.mlir ### Steps to reproduce your issue Either add a test suite to `tests/e2e/xla_ops/` or `tests/e2e/tosa_ops/` with ```cmake TARGET_BACKEND "webgpu" # Only test compilation for now, the WebGPU driver is not stable/tested yet. # DRIVER # "webgpu" ``` OR just run the compiler on one of those files directly, e.g. ```shell iree-compile --iree-hal-target-backends=webgpu \ --iree-input-type=mhlo tests/e2e/xla_ops/sort.mlir \ --iree-hal-dump-executable-sources-to=/tmp/iree/webgpu_sort/ \ --iree-hal-dump-executable-intermediates-to=/tmp/iree/webgpu_sort/ \ --iree-hal-dump-executable-binaries-to=/tmp/iree/webgpu_sort/ \ -o /dev/null \ ``` ### What component(s) does this issue relate to? Compiler ### Version information Tip of tree, https://github.com/iree-org/iree/commit/29b1e8832fd87080716545b0337276e0b3aed636 ### Additional context From https://registry.khronos.org/SPIR-V/specs/1.0/SPIRV.html#_a_id_builtin_a_builtin, Builtin 24 is: > **NumWorkgroups** Number of workgroups in **GLCompute** or **Kernel** [Execution Models](https://registry.khronos.org/SPIR-V/specs/1.0/SPIRV.html#Execution_Model). See OpenCL, Vulkan, or OpenGL API specifications for more detail. See also `SpvBuiltInNumWorkgroups = 24,` [in spirv-headers](https://github.com/KhronosGroup/SPIRV-Headers/blob/85a1ed200d50660786c1a88d9166e871123cce39/include/spirv/1.2/spirv.h#L428). Tint's [`reader/spirv/enum_converter.cc`](https://dawn.googlesource.com/tint/+/refs/heads/main/src/tint/reader/spirv/enum_converter.cc) does not (yet?) have a case for `SpvBuiltInNumWorkgroups`: , but [`ast/builtin_value.h`](https://dawn.googlesource.com/tint/+/refs/heads/main/src/tint/ast/builtin_value.h) _does_ have `kNumWorkgroups`. This gist has the .spvasm that IREE feeds to Tint for sort.mlir: https://gist.github.com/ScottTodd/266a1d152ced378bd2f600da57f803d8
Activity
ScottTodd commentedon Oct 25, 2022
These Tint bugs look relevant:
antiagainst commentedon Oct 26, 2022
Yeah. Should be a simple fix to just add an entry in the
enum_converter.ccfor this builtin?antiagainst commentedon Nov 3, 2022
@dneto0 as FYI.
dneto0 commentedon Nov 15, 2022
The issue is now fixed upstream as of today. Dawn will have to be rolled into Chromium, and then it will appear in Canary.
ScottTodd commentedon Nov 18, 2022
Thanks, @dneto0 ! How frequently are changes from Dawn imported into Tint? I don't see the fix in https://dawn.googlesource.com/tint yet.
Bump Tint, spirv_headers, and spirv-tools to latest. (#11318)