-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Get rid of pickle for fluid inference #7339
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why do we need to add feed_var_names and fetch_var_names here? The current ProgramDesc, which supports training, should be able to read training data — maybe from some data feeding operators I vaguely remember? If so, it seems that we can reuse these feeding operators, or invent some new operators for data feeding specifically at inference time?
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.
BTW, given the fact that we are moving to use a WhileOp to represent the iteration loop at training time, I don’t expect a ProgramDesc that describes a training program can be shared and reused without any modification at inference time. As we’d need a new ProgramDesc specifically for inference, we can have inference data feeding operators in this new ProgramDesc.
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.
@wangkuiyi This is the approach we have been discussing too here: #7328 . Defining a ProgramDesc for Inference separately that has all Inference specific requirements addressed separately, and that can reuse our already existing ProgramDesc.
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.
Thanks @wangkuiyi for the clarification on ProgramDesc. We are exploring different paths of obtaining a Desc for inference and discussing which one to use. Based on your comment, I think we will follow things the proposal in #7328. @abhinavarora is working on a PR based on that.
Uh oh!
There was an error while loading. Please reload this page.
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.
There is no
feed_oporfetch_opin current train and inferenceProgramDesc. Each time we run a trainProgramDesc, theExecutorwill clone a copy of the trainProgramDescand insertfeed_ops andfetch_ops to the copy of the trainProgramDesc.@wangkuiyi do you mean to insert
feed_opandfetch_opto inferenceProgramDescwhen saving? It is a way to solve this problem.There is a proposal of mine, with no need to modify the current
ProgramDescor define anotherProgramDesc, but I am not sure if it works. @kexinzhao @abhinavarora @kavyasrinetProgramDesc. If the variable is not an output of any operators, we think it is a feed variable. If the variable is not an input of any operators, we think it is a fetch variable.Update:
I find a disadvantage of my proposal. User may specify the output of some middle operator (some operator in the middle position of the network and has output) to the fetch list.