Skip to content

[Vulkan] Honor GELU approximate='none' and keep kwargs off inserted views - #23204

Closed
mergennachin wants to merge 1 commit into
mergennachin/vulkan-23156-03-flatbuffer-defaultsfrom
mergennachin/vulkan-23156-04-gelu
Closed

mergennachin wants to merge 1 commit into
mergennachin/vulkan-23156-03-flatbuffer-defaultsfrom
mergennachin/vulkan-23156-04-gelu

Conversation

@mergennachin

@mergennachin mergennachin commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #23243, part 4/15 of the ghstack replacement series. The current integration PR is #23254. This PR is closed in favor of the replacement; its previous description and review history are retained.


The Vulkan gelu kernel always used the tanh approximation, so exact GELU, PyTorch's default, was delegated with a different result. It now evaluates an erf-based form unless approximate='tanh' is requested. SqueezeUnsqueezeInputs copied the original node's kwargs onto the view_copy nodes it inserts, which broke gelu on inputs with singleton dimensions. This also adds test_vulkan_dynamic.py, which lowers with require_dynamic_shapes and runs each program across several input shapes; later changes extend it.

Part 4/15 of the Vulkan transformer and operator-conformance stack. Depends on #23203; review against the selected base branch. Integration PR: #23162.

Validation: 2 passed, 2 warnings in 36.51s. Lintrunner and git diff --check pass. Native tests use MoltenVK with portable CPU kernels; hardware and SwiftShader CI are pending.

Authored with OpenAI Codex; split planned with Claude Code.

cc @SS-JIA @manuelcandales @digantdesai @cbilgin

…iews

The Vulkan gelu kernel always used the tanh approximation, so exact GELU, PyTorch's default, was delegated with a different result. It now evaluates an erf-based form unless approximate='tanh' is requested. SqueezeUnsqueezeInputs copied the original node's kwargs onto the view_copy nodes it inserts, which broke gelu on inputs with singleton dimensions. This also adds test_vulkan_dynamic.py, which lowers with require_dynamic_shapes and runs each program across several input shapes; later changes extend it.

Authored with OpenAI Codex; split planned with Claude Code.
@pytorch-bot pytorch-bot Bot added the module: vulkan Issues related to the Vulkan delegate and code under backends/vulkan/ label Sep 28, 2026
@pytorch-bot

pytorch-bot Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit ba6e7bd with merge base a318382 (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 Sep 28, 2026
mergennachin added a commit that referenced this pull request Oct 3, 2026
…iews (#23243)

The Vulkan gelu kernel always used the tanh approximation, so exact
GELU, PyTorch's default, was delegated with a different result. It now
evaluates an erf-based form unless approximate='tanh' is requested.
SqueezeUnsqueezeInputs copied the original node's kwargs onto the
view_copy nodes it inserts, which broke gelu on inputs with singleton
dimensions. This also adds test_vulkan_dynamic.py, which lowers with
require_dynamic_shapes and runs each program across several input
shapes; later changes extend it.

Part 4 of the original 15-PR Vulkan transformer and operator-conformance
stack. Parts 1–3 (#23240, #23241, and #23242) have landed in main. This
is now the first of the twelve remaining PRs, based on main. Integration
PR: #23254.

Validation: Rebased onto main at `0b3d26d8c1f9` after parts 1–3 landed.
`git range-diff` confirms all twelve remaining patches match their prior
versions. The Release Vulkan/portable runtime rebuilt successfully, and
the complete native regression suite passed **51 tests with one expected
SwiftShader-only skip** on MoltenVK. Coverage includes the dynamic
tests, graph builder, serialization, and PT2E quantized linear with
downcasting disabled. Lintrunner and `git diff --check` passed.

Recreates #23204 through ghstack. Prior review discussion remains on
that PR.

Authored with OpenAI Codex; split planned with Claude Code.

This branch was successfully deployed

1 active deployment
cadence — ba6e7bdd Deployed Sep 28, 2026 by mergennachin via hifi-op-test / hifi4 #30188
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. module: vulkan Issues related to the Vulkan delegate and code under backends/vulkan/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant