镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[ET-VK][ops] Pass op_type to unary and binary op helpers - #24752

Open
SS-JIA wants to merge 2 commits into
gh/SS-JIA/692/basefrom
gh/SS-JIA/692/head
Open

SS-JIA wants to merge 2 commits into
gh/SS-JIA/692/basefrom
gh/SS-JIA/692/head

Conversation

@SS-JIA

@SS-JIA SS-JIA commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Ulterior Motive

Prepare the unary and binary op helpers for fused ops, which may apply more
than one op and so have no single op_type specialization constant.

Rationale

What: apply_unary_op and apply_binary_op take the op type as their
first argument instead of reading the including shader's op_type
specialization constant.

Why: A fused shader can then pass a different op type to each call.

Details

  • apply_unary_op / apply_binary_op
    • Before: apply_unary_op(X, A, B) and apply_binary_op(X, Y, A) read
      the global op_type, so every including shader had to declare it.

    • After: apply_unary_op(op_type, X, A, B) and
      apply_binary_op(op_type, X, Y, A). Existing shaders pass their
      op_type specialization constant, so drivers still fold the switch.

      // Fused binary + unary, each op selected independently
      vec4 sum = apply_binary_op(binary_op_type, a, b, alpha);
      vec4 out_texel = apply_unary_op(UNARY_OP_RELU, sum, 0.0, 0.0);

Authored with Claude Code.

Differential Revision: D130297301

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ 4 Pending, 2 Unrelated Failures

As of commit 43ee7e4 with merge base 9517b6b (image):

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@github-actions

github-actions Bot commented Nov 6, 2026

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.

[ghstack-poisoned]

This branch was previously deployed

1 inactive deployment
cadence — 43ee7e44 Deployed Nov 7, 2026 by SS-JIA via hifi-op-test / hifi4 #37212
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.

2 participants