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

webgpu: Reduce binary ops shader variants #5791

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qjia7
Copy link
Contributor

@qjia7 qjia7 commented Oct 29, 2021

PERF

This PR aims to reduce the warmup time by reducing binary ops shader variants.
It may slightly hurt the inference time, but can greatly improve the warmup time.

bodypix-mobilenet reduced ~300ms in the first pass on CFL.

To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.


This change is Reviewable

@google-cla google-cla bot added the cla: yes label Oct 29, 2021
@qjia7
Copy link
Contributor Author

qjia7 commented Nov 2, 2021

@xhcao @axinging @haoyunfeix @gyagp PTAL, thanks.

@qjia7 qjia7 mentioned this pull request Nov 3, 2021
PERF

This PR aims to reduce the warmup time by reducing binary ops shader variants.
It may slightly hurt the inference time, but can greatly improve the warmup time.

bodypix-mobilenet reduced ~300ms in the first pass on CFL.
const userCode = `
fn binaryOperation(a : f32, b : f32) -> f32 {
${opStr}
${getBinaryOpString(this.op, false)}
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM. Do you have warmup and perf data?
nit, false can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants