Skip to content

common: postops: add post-ops support for binary select op #2900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 23, 2025

Conversation

avmanerikar
Copy link
Contributor

@avmanerikar avmanerikar commented Mar 17, 2025

Description

The PR adds updates post-ops implementations so that they support binary select operation as a post-op:

$dst[i] = cond[i]\quad?\quad src_0[i] \quad:\quad src_1[i]$

The updates account for the third conditional input that the select op requires for computation.

Implements MFDNN-12883.

This also introduces a new benchdnn format for providing arguments to multiple src tensors for a single post-op:

--attr-post-ops=select:DT[.S1_MASK_INPUT[.S1_TAG]][:S2_MASK_INPUT[.S2_TAG]]

Testcase:

./benchdnn --matmul --attr-post-ops=select:f32.per_tensor.ab:per_tensor.ab 5x10:10x5

(Currently, there is no broadcasting support for the conditional src2 tensor. The data type, mask policy and tag for the src2 tensor are fixed as s8, common and any respectively).

@avmanerikar avmanerikar requested review from a team as code owners March 17, 2025 16:07
@github-actions github-actions bot added documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc platform:cpu-x64 Intel64/AMD64 processors. Codeowner: @oneapi-src/onednn-cpu-x64 platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel platform:gpu-generic Codeowner: @oneapi-src/onednn-gpu-generic component:api Codeowner: @oneapi-src/onednn-arch component:tests Codeowner: @oneapi-src/onednn-arch labels Mar 17, 2025
@avmanerikar avmanerikar changed the title cpu: binary: add post-ops support for binary select op common: postops: add post-ops support for binary select op Mar 17, 2025
@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch from 20dff17 to 7edca7d Compare March 21, 2025 23:28
@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch from 7edca7d to 43a333b Compare March 31, 2025 15:43
@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch 2 times, most recently from 5dc4c66 to 9a186cc Compare April 2, 2025 20:06
@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch 2 times, most recently from 4430430 to 6b34aa8 Compare April 3, 2025 21:08
@avmanerikar avmanerikar requested a review from a team as a code owner April 3, 2025 21:08
@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch from 6b34aa8 to 4dad525 Compare April 5, 2025 01:26
@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch from 4dad525 to b87f40b Compare April 7, 2025 08:10
Copy link
Contributor

@ranukund ranukund left a comment

Choose a reason for hiding this comment

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

Minor comments suggested, please incorporate as you see fit, thanks!

@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch from e0d8380 to c655684 Compare May 9, 2025 18:45
@avmanerikar avmanerikar requested a review from a team as a code owner May 9, 2025 18:45
@github-actions github-actions bot added the component:graph-api Codeowner: @oneapi-src/onednn-graph label May 9, 2025
@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch 2 times, most recently from a901389 to 61cd635 Compare May 9, 2025 18:57
@github-actions github-actions bot removed the component:graph-api Codeowner: @oneapi-src/onednn-graph label May 9, 2025
@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch from 61cd635 to 0cfdd68 Compare May 12, 2025 19:49
@avmanerikar
Copy link
Contributor Author

make test
set test_scope=NIGHTLY
disable test_device_gpu

@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch from 0cfdd68 to 72c46fe Compare May 21, 2025 20:57
@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch from 72c46fe to 1be63b7 Compare May 21, 2025 23:09
@avmanerikar
Copy link
Contributor Author

make test
set test_scope=NIGHTLY
disable test_device_gpu

Copy link
Contributor

@dzarukin dzarukin left a comment

Choose a reason for hiding this comment

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

One last comment to address. I'm fine with the rest.

@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch from 1be63b7 to a527e26 Compare May 23, 2025 07:38
@avmanerikar avmanerikar requested a review from dzarukin May 23, 2025 07:41
@avmanerikar avmanerikar force-pushed the amanerik/main/binary-select-postop-ext branch from a527e26 to bfaa38b Compare May 23, 2025 07:46
@avmanerikar
Copy link
Contributor Author

make test
set test_scope=NIGHTLY
disable test_device_gpu

@avmanerikar avmanerikar merged commit fe299f1 into main May 23, 2025
23 of 24 checks passed
@avmanerikar avmanerikar deleted the amanerik/main/binary-select-postop-ext branch May 23, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:api Codeowner: @oneapi-src/onednn-arch component:common component:tests Codeowner: @oneapi-src/onednn-arch documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc platform:cpu-x64 Intel64/AMD64 processors. Codeowner: @oneapi-src/onednn-cpu-x64 platform:gpu-generic Codeowner: @oneapi-src/onednn-gpu-generic platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants