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 gather zero #6166

Merged
merged 9 commits into from
Mar 28, 2022
Merged

Webgpu gather zero #6166

merged 9 commits into from
Mar 28, 2022

Conversation

haoyunfeix
Copy link
Contributor

@haoyunfeix haoyunfeix commented Feb 18, 2022

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


This change is Reviewable

@haoyunfeix
Copy link
Contributor Author

Similar with #5984, GatherV2 fill out of range values with zero.
@qjia7 @axinging @xhcao @gyagp PTAL

const userCode = `
${getMainHeaderAndGlobalIndexString()}
if (index < uniforms.size) {
let resRC = getCoordsFromIndex(index);
setOutputAtIndex(index, getA(${sourceCoords}));
let indexZ = i32(getIndices(resRC.x, resRC.z));
let inBounds = select(0.0, 1.0, indexZ >= 0 && indexZ < ${this.aShape[2]});
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you directly use indexZ < aShape[2] instead of indexZ < ${this.aShape[2]}? I think aShape is already a uniform value. In this case, you don't need to change the shaderKey.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Done.

Copy link
Contributor

@qjia7 qjia7 left a comment

Choose a reason for hiding this comment

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

LGTM for the webgpu part.

@lina128 Can you take a look whether it's ok to put the common gpu test to tfjs-core?

@qjia7 qjia7 requested a review from lina128 February 24, 2022 01:08
@haoyunfeix
Copy link
Contributor Author

Copy link
Collaborator

@lina128 lina128 left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @qjia7)

@qjia7 qjia7 merged commit d8dbcd5 into tensorflow:master Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants