Skip to content

WebGPU computer shader seems not working when using float16 type #23125

Open
@csAugust

Description

Version:

deno 1.42.0 (release, x86_64-pc-windows-msvc)
v8 12.3.219.9
typescript 5.4.3

Problem

I tried to run the webgpu demo program (https://github.com/denoland/webgpu-examples/blob/main/hello-compute/mod.ts) using command deno run --unstable-webgpu --allow-read --allow-write mod.ts. The original code works well, but when I try to use float16 in computer shader, I get no output [ "0", "0", "0", "0" ] with no warning or error messages.
The only modification I did was:

const device = await adapter?.requestDevice({
  "requiredFeatures": ['shader-f16'],
});
...
const shaderCode =  `
  enable f16;
  @group(0)
...

I get no output no matter using data type Uint32Array, Float32Array or Float16Array(from https://deno.land/x/[email protected]/src/index.mjs). But in chrome canary, the same code works.

Could anyone please tell me if deno doesn't support f16 in WebGPU currently, or something else goes wrong? Thanks a lot.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featnew feature (which has been agreed to/accepted)upstreamChanges in upstream are required to solve these issueswebgpuWebGPU API

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions