You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ET-VK][ops] Pass op_type to unary and binary op helpers - #24752
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 independentlyvec4 sum = apply_binary_op(binary_op_type, a, b, alpha);
vec4 out_texel = apply_unary_op(UNARY_OP_RELU, sum, 0.0, 0.0);
This comment was automatically generated by Dr. CI and updates every 15 minutes.
meta-claBot
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 6, 2026
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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.meta-exported
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_typespecialization constant.Rationale
What:
apply_unary_opandapply_binary_optake the op type as theirfirst argument instead of reading the including shader's
op_typespecialization constant.
Why: A fused shader can then pass a different op type to each call.
Details
apply_unary_op/apply_binary_opBefore:
apply_unary_op(X, A, B)andapply_binary_op(X, Y, A)readthe global
op_type, so every including shader had to declare it.After:
apply_unary_op(op_type, X, A, B)andapply_binary_op(op_type, X, Y, A). Existing shaders pass theirop_typespecialization constant, so drivers still fold the switch.Authored with Claude Code.
Differential Revision: D130297301