Skip to content
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

[js/webgpu] Adding not operator #16891

Closed
wants to merge 4 commits into from
Closed

[js/webgpu] Adding not operator #16891

wants to merge 4 commits into from

Conversation

jchen351
Copy link
Contributor

Description

Motivation and Context

@jchen351 jchen351 changed the title Adding not operator [js/webgpu] Adding not operator Jul 28, 2023
@jchen351 jchen351 added the ep:WebGPU ort-web webgpu provider label Jul 28, 2023
@jchen351 jchen351 requested a review from fs-eire July 28, 2023 22:53
@@ -92,6 +92,7 @@ class ONNX_OPERATOR_KERNEL_CLASS_NAME(kJsExecutionProvider, kOnnxDomain, 13, Erf
class ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME(kJsExecutionProvider, kOnnxDomain, 6, 12, Sigmoid);
class ONNX_OPERATOR_KERNEL_CLASS_NAME(kJsExecutionProvider, kOnnxDomain, 13, Sigmoid);

class ONNX_OPERATOR_KERNEL_CLASS_NAME(kJsExecutionProvider, kOnnxDomain, 7, Not);
Copy link
Contributor

@satyajandhyala satyajandhyala Jul 28, 2023

Choose a reason for hiding this comment

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

"Not" operator is available since opset version1 unlike Sin, Cos, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the npm test -- op not.jsonc -b=webgpu actually runs CPU kernel because it's not correctly registered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Anything on my size was doing it wrong, or it just something else? @fs-eire

Comment on lines 22 to 26
if (funcCall === 'not') {
expression = '!a';
} else {
expression = `${funcCall}(a)`;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

please do not modify this general function. use the funcCall param instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me try with passing not operator as BuiltinFunctionName instead.

Copy link
Contributor

@fs-eire fs-eire Jul 31, 2023

Choose a reason for hiding this comment

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

no. not is not a built in function so don't use it in BuiltinFunctionName. you can use lambda like (x => `!(${x})`).

@fs-eire
Copy link
Contributor

fs-eire commented Jul 29, 2023

This change may need to wait my work-in-progress change to enable bool data type for webgpu.

@guschmue
Copy link
Contributor

replaced by #17306

@guschmue guschmue closed this Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:WebGPU ort-web webgpu provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants