Skip to content

WebGPU compilation errors: "function parameter of pointer type cannot be in 'storage' address space" #10906

Open

Description

@ScottTodd

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/:

  • clamp.mlir
  • compare.mlir
  • convert.mlir
  • finite.mlir
  • maximum.mlir
  • minimum.mlir

From tests/e2e/tosa_ops/:

  • equal.mlir
  • greater.mlir
  • greater_equal.mlir
  • max_pool.mlir
  • table.mlir

The error message from Tint is:

Tint reported 1 error(s) for a SPIR-V program, see diagnostics:
error: function parameter of pointer type cannot be in 'storage' address space

Steps to reproduce your issue

Either add a test suite to tests/e2e/xla_ops/ or tests/e2e/tosa_ops/ with

  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.

iree-compile --iree-hal-target-backends=webgpu \
  --iree-input-type=mhlo tests/e2e/xla_ops/clamp.mlir \
  --iree-hal-dump-executable-sources-to=/tmp/iree/webgpu_clamp/ \
  --iree-hal-dump-executable-intermediates-to=/tmp/iree/webgpu_clamp/ \
  --iree-hal-dump-executable-binaries-to=/tmp/iree/webgpu_clamp/ \
  -o /dev/null \

Version information

Tip of tree, 29b1e88

Additional context

At least some of these tests successfully compile when they are modified to only use i32 and f32 types, and not i8 or i16.

This gist has the .spvasm that IREE feeds to Tint for i8 (fails) and for i32 (succeeds): https://gist.github.com/ScottTodd/c01f1591d8ff2ed38896adcd609ddd65

Activity

  1. added
    bug 🐞
    codegen/spirv
    platform/web 🌐
    on Oct 25, 2022
  2. self-assigned this
    on Oct 25, 2022
  3. ScottTodd commented on Nov 28, 2022

    @ScottTodd
    MemberAuthor

    I'm still seeing this issue after updating Tint. I've only seen it affect unit tests (and not full programs) so far though.

  4. added a commit that references this issue on Mar 6, 2023
  5. added a commit that references this issue on Apr 2, 2023
  6. moved this from Not Started to Backlog in (Deprecated) IREEon Apr 28, 2023
  7. added a commit that references this issue on May 1, 2023
  8. added a commit that references this issue on May 2, 2023
  9. dneto0 commented on May 25, 2023

    @dneto0

    I'm still seeing this issue after updating Tint. I've only seen it affect unit tests (and not full programs) so far though.

    Currently WGSL does not allow passing pointer-to-storage-buffer or pointer-to-uniform-buffer into user-declared helper functions.

    But this is planned as an enhancement "soon", because @ben-clayton worked out a transform that would lower more general pointer parameters to something we could compile to all backends.
    See gpuweb/gpuweb#3546

  10. added a commit that references this issue on Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug 🐞codegen/spirvplatform/web 🌐

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions