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

Refactor SparseApplyFtrl CPU kernel into class #43868

Conversation

benbarsdell
Copy link
Contributor

@benbarsdell benbarsdell commented Oct 8, 2020

This is in preparation for adding a GPU implementation.

(This is the second split of #43299).

cc @nluehr @sanjoy

Edit: This PR makes no functional change except for the indexing error message (which is changed to match that of SparseApplyKerasMomentumOp which has the same code structure).

- This is in preparation for adding a GPU implementation.
@google-ml-butler google-ml-butler bot added the size:L CL Change Size: Large label Oct 8, 2020
@google-cla google-cla bot added the cla: yes label Oct 8, 2020
@gbaned gbaned self-assigned this Oct 8, 2020
@gbaned gbaned added the comp:core issues related to core part of tensorflow label Oct 8, 2020
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Oct 8, 2020
@gbaned gbaned requested a review from sanjoy October 8, 2020 08:06
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Oct 11, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Oct 11, 2020
Copy link
Contributor

@sanjoy sanjoy left a comment

Choose a reason for hiding this comment

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

Minor comment inline.

I'm assuming this PR is NFC (no functional change); if yes then please change the description to say so, if not, please say that as well.

tensorflow/core/kernels/training_ops.cc Outdated Show resolved Hide resolved
PR Queue automation moved this from Assigned Reviewer to Reviewer Requested Changes Oct 11, 2020
@benbarsdell
Copy link
Contributor Author

Description edited to describe NFC.

@gbaned gbaned removed the ready to pull PR ready for merge process label Oct 12, 2020
Copy link
Contributor

@sanjoy sanjoy left a comment

Choose a reason for hiding this comment

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

Minor comment inline, lgtm other than that.

Comment on lines 2823 to 2827
OP_REQUIRES(
ctx, bad_i < 0,
errors::InvalidArgument(
"indices", SliceDebugString(indices.shape(), bad_i), " = ",
indices_vec(bad_i), " is not in [0, ", var.dim_size(0), ")"));
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO making this non local is harder to understand. Can you have operatior() return a Status (OK or InvalidArgument) and use OP_REQUIRES_OK here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@gbaned gbaned requested a review from sanjoy October 14, 2020 10:00
Copy link
Contributor

@sanjoy sanjoy left a comment

Choose a reason for hiding this comment

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

lgtm

PR Queue automation moved this from Reviewer Requested Changes to Approved by Reviewer Oct 16, 2020
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Oct 16, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Oct 16, 2020
@gbaned gbaned added ready to pull PR ready for merge process and removed ready to pull PR ready for merge process labels Oct 16, 2020
@copybara-service copybara-service bot merged commit 6607979 into tensorflow:master Oct 16, 2020
PR Queue automation moved this from Approved by Reviewer to Merged Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:core issues related to core part of tensorflow ready to pull PR ready for merge process size:L CL Change Size: Large
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

4 participants