Skip to content

Add an aten.erf kernel (#24908) - #24908

Merged
psiddh merged 1 commit into
pytorch:mainfrom
psiddh:export-D129036503
Nov 13, 2026
Merged

psiddh merged 1 commit into
pytorch:mainfrom
psiddh:export-D129036503

Conversation

@psiddh

@psiddh psiddh commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

aten.erf had no WebGPU kernel, so models with a hand-written exact GELU (x * 0.5 * (1 + erf(x / sqrt(2)))) split into many delegates around CPU erf nodes.
This adds a one-dispatch erf (rational fit; NaN passes through, +-inf gives +-1) with a resize hook, and the WebGPU partitioner delegates it.
Use case: unmodified Hugging Face ESM-2 and BERT-style models, including dynamic sequence length.

Reviewed By: SS-JIA

Differential Revision: D129036503

Copilot AI balanced review requested due to automatic review settings November 11, 2026 19:34
@pytorch-bot

pytorch-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24908

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 714474e with merge base e48f2b5 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@meta-codesync

meta-codesync Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@psiddh has exported this pull request. If you are a Meta employee, you can view the originating Diff in D129036503.

@SS-JIA SS-JIA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Summary:
Pull Request resolved: pytorch#24908

aten.erf had no WebGPU kernel, so models with a hand-written exact GELU (x * 0.5 * (1 + erf(x / sqrt(2)))) split into many delegates around CPU erf nodes.
This adds a one-dispatch erf (rational fit; NaN passes through, +-inf gives +-1) with a resize hook, and the WebGPU partitioner delegates it.
Use case: unmodified Hugging Face ESM-2 and BERT-style models, including dynamic sequence length.

Reviewed By: SS-JIA

Differential Revision: D129036503
@meta-codesync meta-codesync Bot changed the title Add an aten.erf kernel Add an aten.erf kernel (#24908) Nov 13, 2026
Copilot AI balanced review requested due to automatic review settings November 13, 2026 00:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@psiddh
psiddh merged commit 0b776dd into pytorch:main Nov 13, 2026
203 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants