Skip to content

Conversation

@JiayiFeng
Copy link
Collaborator

@JiayiFeng JiayiFeng commented Mar 24, 2018

This PR refines C++ readers doc according to @helinwang's comments of #9079:

  1. Rename a section title from CreateReaderOp to Operators That Creates Readers.

  2. Add the introduction of MultiPassReader and how to simplify program configurations with it.

@JiayiFeng JiayiFeng requested review from helinwang and reyoung March 24, 2018 15:09
Copy link
Contributor

@helinwang helinwang left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM after the comments being addressed.

```
while_op {
not_completed = true
pass_count = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

pass_count is a Python variable, not a ProgramDesc Var, does it work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not_completed and pass_count are both ProgramDesc Var. Sorry I didn't make it clear.


### Simplify Configuration by MultiPassReader

The Program configuration mentioned above is somehow complicated. Users need to be very similar to concepts of Program and Block to prevent making mistakes in their code. To make the usage of C++ readers more friendly to beginning users, we introduce `MultiPassReader`.
Copy link
Contributor

Choose a reason for hiding this comment

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

The Program -> The Program (please change two spaces to one space).
similar -> familiar

Copy link
Contributor

Choose a reason for hiding this comment

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

above is somehow complicated -> above is complicated

Copy link
Contributor

Choose a reason for hiding this comment

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

beginning users -> new users

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. Thanks!

The forwarding part of the corresponding `main_program` would be like this:

```
not_completed = true
Copy link
Contributor

Choose a reason for hiding this comment

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

not_completed is a Python variable, not a ProgramDesc Var, does it work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are Fluid Variables. See my above comment.

Copy link
Contributor

@abhinavarora abhinavarora left a comment

Choose a reason for hiding this comment

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

Thank for the PR! Please make the suggested changes before merging the PR

To create and invoke readers, some new ops are introduced:

### CreateReaderOp
### Operators That Creates Readers
Copy link
Contributor

Choose a reason for hiding this comment

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

Creates -> Create


### Simplify Configuration by MultiPassReader

The Program configuration mentioned above is somehow complicated. Users need to be very similar to concepts of Program and Block to prevent making mistakes in their code. To make the usage of C++ readers more friendly to beginning users, we introduce `MultiPassReader`.
Copy link
Contributor

Choose a reason for hiding this comment

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

above is somehow complicated -> above is complicated


### Simplify Configuration by MultiPassReader

The Program configuration mentioned above is somehow complicated. Users need to be very similar to concepts of Program and Block to prevent making mistakes in their code. To make the usage of C++ readers more friendly to beginning users, we introduce `MultiPassReader`.
Copy link
Contributor

Choose a reason for hiding this comment

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

beginning users -> new users


The Program configuration mentioned above is somehow complicated. Users need to be very similar to concepts of Program and Block to prevent making mistakes in their code. To make the usage of C++ readers more friendly to beginning users, we introduce `MultiPassReader`.

`MultiPassReader` is a decorated reader. A multi-pass reader is used to continuously yield data for several pass training. It takes the number of passes to run as one of its attributes('pass_num') and maintains a counter to record how many passes it has completed. Each time its underlying reader reaches the EOF, the multi-pass reader checks whether it has completed the training of given number of pass. If not, the underlying reader will be re-initialized and starts a new pass automatically. Before completing the whole training, the return of MultiPassReader's `HasNext()` will always be `true`.
Copy link
Contributor

Choose a reason for hiding this comment

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

several pass training -> several training passes

@JiayiFeng JiayiFeng merged commit 1a4b0d6 into PaddlePaddle:develop Mar 29, 2018
@JiayiFeng JiayiFeng deleted the doc_update_reader_doc branch March 29, 2018 08:37
blacksheep-Aristotle pushed a commit to blacksheep-Aristotle/Paddle that referenced this pull request Nov 22, 2024
* support optimizer state offload (PaddlePaddle#8715)

* support optimizer offload

* update doc

* [FleetY]offload optimizer state after load optmizer state (PaddlePaddle#9352)

* add offload optimizer

* fix memory

* [FleetY] Add reload/offload for optimizer (PaddlePaddle#9356)

* add reload/offload for optimizer

* fix bug

---------

Co-authored-by: Guoxia Wang <[email protected]>
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.

4 participants