Add WebGPU sigmoid operator#20504
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20504
Note: Links to docs will display an error until the docs builds have been completed. ❗ 2 Active SEVsThere are 2 currently active SEVs. If your PR is affected, please view them below:
|
|
Hi @iamorlando! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
@pytorchbot label "release notes: ops & kernels" |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary
Adds WebGPU runtime support for
aten.sigmoid.defaultto expand the Llama-oriented operator coverage in the WebGPU backend.This includes:
The op follows the existing WebGPU runtime path: models are lowered through the existing
VulkanBackenddelegate serialization, and the WebGPU runtime consumes that delegate graph.Test plan
.venv/bin/python backends/webgpu/scripts/gen_wgsl_headers.py --checkgit diff HEAD --checkPYTHONPYCACHEPREFIX=/tmp/executorch_pycache .venv/bin/python -m py_compile backends/webgpu/test/tester.py backends/webgpu/test/op_tests/cases.py backends/webgpu/test/op_tests/generate_op_tests.py backends/webgpu/test/op_tests/test_generator.py backends/webgpu/test/op_tests/test_schema.py backends/webgpu/test/ops/sigmoid/test_sigmoid.py.venv/bin/lintrunner --force-color <changed files> --skip MYPY(no lint issues).venv/bin/python -m pytest backends/webgpu/test/ops/sigmoid/test_sigmoid.py -vv(4 passed).venv/bin/python -m pytest backends/webgpu/test/op_tests/test_schema.py backends/webgpu/test/op_tests/test_generator.py -vv(11 passed).venv/bin/python -m executorch.backends.webgpu.test.op_tests.generate_op_tests --output /tmp/webgpu_op_tests_allwebgpu_scratch_buffer_test,webgpu_op_test_util_test, andwebgpu_op_test/tmp/build/backends/webgpu/webgpu_scratch_buffer_test(passed)/tmp/build/backends/webgpu/webgpu_op_test_util_test(3 passed)/tmp/build/backends/webgpu/webgpu_op_test --manifest /artifacts/manifest.json(25 passed, including 5OpTest_sigmoidcases)torch.sigmoid(x)Python model to ExecuTorch.ptewebgpu_backendandemdawnwebgpu[-8, -4, -1, 0, 1, 4, 8, 12, -12]backends=["VulkanBackend"],numInstructions=1requestAdapter=1,requestDevice=1,createShaderModule=1,createComputePipeline=1,dispatchWorkgroups=1,queueSubmit=1maxAbsError=2.9103830456733704e-11