Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/upgrade to wgpu 0.13.1 #119

Merged
merged 8 commits into from
Jul 5, 2022
Merged

Fix/upgrade to wgpu 0.13.1 #119

merged 8 commits into from
Jul 5, 2022

Conversation

pixelspark
Copy link
Collaborator

This PR upgrades wgsl from v0.12.0 to v.0.13.1. This is a long awaited update that (among other things) updates the WGSL syntax to follow the latest standard (which e.g. Google Chrome (Tint) currently uses as well).

Tests pass on my machine and all examples work. Will do some more testing, there may be some edge cases here and there (in particular for ops where scalar_type is an integer - we can't use matrixes anymore for these because WGSL now only supports float-based matrixes).

In particular, attribute syntax has changed (e.g. [[stage(compute)]] becomes @compute, Scalar(x) construction is not supported anymore, matrixes of integers are not supported anymore, and some more specific changes)
@pixelspark pixelspark mentioned this pull request Jul 3, 2022
@pixelspark
Copy link
Collaborator Author

And with the last few commits, WASM works again (at least on Chrome - for some reason Firefox says it cannot find a GPU given preferences on my machine, YMMV)

@pixelspark
Copy link
Collaborator Author

On Firefox (Nightly 104.0a1 (2022-07-03) (64-bit)) the demo errors with:

Uncaught (in promise) TypeError: GPUDevice.createComputePipeline: 'layout' member of GPUPipelineDescriptorBase is not an object.

Passing None as layout to create_compute_pipeline is perfectly fine and should probably translate to layout: "auto" in the actual WebGPU call. Possibly Firefox has not implemented this option yet. This problem should solve itself (nothing we can do now).

wonnx/src/gpu.rs Outdated Show resolved Hide resolved
Co-authored-by: Xavier Tao <tao.xavier@outlook.com>
@pixelspark pixelspark requested a review from haixuanTao July 4, 2022 20:32
@pixelspark pixelspark merged commit 0c2a413 into master Jul 5, 2022
@pixelspark pixelspark deleted the fix/upgrade-to-wgpu-0.13.1 branch July 5, 2022 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update WGSL syntax when wgpu ships naga 0.9
2 participants