-
Notifications
You must be signed in to change notification settings - Fork 0
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
Draft of Keras pickle RFC #1
Conversation
I'm sorry that I just saw this and in the meantime made edits to the original. My apologies. I will try to incorporate your version into mine. |
637b72f
to
e6d424d
Compare
Sorry for rewriting the history @stsievert . I incorporated what you wrote into what I had. We can continue working here until we have something more final that we can upstream. |
I think I'd like to also include a monkey patched example for using |
POC for using SaveModel as a backend for pickle is up in the notebook: https://colab.research.google.com/drive/1SEGXDFfNl5i0Cy8a4xvRjWOOjdq3sOOC?authuser=1#scrollTo=VZIkAZyJE1CP |
Anything else you think we need to add @stsievert? |
I think so. I’d like to make some edits to better frame the problem. I’d also like a chance to review the technical content.
…On Thu, Sep 3, 2020, at 10:04 AM, Adrian Garcia Badaracco wrote:
Anything else you think we need to add @stsievert <https://github.com/stsievert>?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAKCMG442XOMKXBKPY3XVFLSD6V7XANCNFSM4QT26NKQ>.
|
Okay, I'll let you do the next round of edits before I make any more changes. |
I made some edits to the motivation and user benefits section. I'd still like to review the technical content. |
Edits look great. And thanks for fixing the line lengths. |
Why implement I'd still like to make a couple more edits to this RFC. I'll try to make the edits later tomorrow. Feel free to make some edits; I revised the technical section. |
Two main reasons:
|
@mrocklin we're proposing to add Pickle support to Tensorflow. Could review our proposal? It's at 20200902-pickle-for-keras.md. I'd appreciate any of your thoughts, including any ideas on other problems Pickle support would solve for Keras. In this, I lifted some wording about ecosystem support from your post "Pickle isn't slow, it's a protocol." Here's the relevant paragraph:
Let me know if I should change anything in that paragraph. |
I'm happy to see this work. I'm a bit slammed at the moment, but maybe instead of reviewing I could try to conscript @jakirkham ? He has been thinking a lot about serialization recently, and I think that it would be good to have someone from the RAPIDS team engaged regardless. |
Would suggest leveraging pickle protocol 5 where possible to avoid copying frames before sending them over the wire. This is something Dask ( dask/distributed#3784 ) is able to leverage for zero-copy transmission. |
Yep, NumPy also supports the Exactly this is why we do that as well. NumPy is a common dependency. So most people have it as well. |
cc @quasiben (for vis) |
Hi folks, let's make a push to get this wrapped up this weekend so we can submit the PR in the TF repo sometime next week and start to get some feedback on that side. Please let me know if you see anything that would be a blocker to this. |
Doesn't the implementation rely on NumPy's Pickle 5 support? So can't I've deleted the metric tests. It's a minimal implementation. I think it's obvious that the tests will pass with |
rfcs/20200902-pickle-for-keras.md
Outdated
from tf.keras.models import load_model | ||
|
||
class Model: | ||
... | ||
class NewModel(Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious as to why the name change? I was envisioning these code blocks as representing "here's a pseudocode of what this would look like if implemented in TF" and not necessarily "here's how users can create a picklable Model" which is the first thought that came to mind when I saw NewModel(Model)
.
I was thinking that, but I wasn't 100% sure and I also had the thought that (1) this is a private ecosystem method, not something users will really be looking at so how nice the name looks doesn't really matter and (2)
👍 |
I'm concerned with maintenance cost. Will some developer waste an hour looking into the difference between
I don't think "more flexibility" is relevant; I think |
I do see you point, but I think there's arguments either way. If you feel strongly about it and are 100% sure that we can use |
I think we are pretty much good to go. @stsievert, do you want me to change |
I think @jakirkham is the right person to ask. I'm pretty sure zero-copy transmission remains possible with
|
Thank you, will wait on their response and then send this out. |
Yeah it shouldn't matter if we are just using NumPy to handle out-of-band pickling. |
Thank you all for your contributions. I'm going to merge this and move this to the TF repo. |
@stsievert can you sign the Google CLA to fix tensorflow#286 (comment) if you want to keep authorship of your commits? |
I don't mind losing Git authorship. Feel free to remove it. |
What does this PR implement?
A draft of the Keras pickle edits. I'm submitting this PR because I want to discuss these changes and don't want add a bunch of unnecessary comments/notifications/reviews that the TF maintainers have to sift through.
This PR should be merged when the first draft is done.
Reference issues/PRs
This is a draft for tensorflow#286