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

support recordio in dist train #11066

Merged
merged 7 commits into from
Jun 4, 2018

Conversation

Yancey1989
Copy link
Contributor

Fixed #11024

@@ -65,20 +65,22 @@ class CreateRecordIOReaderOp : public framework::OperatorBase {
static_cast<int>(shape_concat.size()),
"The accumulate of all ranks should be equal to the "
"shape concat's length.");
std::string filename = Attr<std::string>("filename");
auto filenames = Attr<std::vector<std::string>>("filenames");
Copy link
Contributor

Choose a reason for hiding this comment

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

fluid.layers.open_files should do the job, please see test_multi_file_reader.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems open_files_op can only deal with the normal files.

Copy link
Collaborator

@JiayiFeng JiayiFeng May 31, 2018

Choose a reason for hiding this comment

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

open_files_op can deal with RecordIO file. Just make sure that file names end with '.recordio'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, thanks!

as follows:

```python
reader = paddle.batch(mnist.train(), batch_size=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to tell users why batch_size=1 here, and for fix batch_size we can gain performance?

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.

fluid.recordio_writer.convert_reader_to_recordio_file('./mnist.recordio', reader, feeder)
```

The above codes would generate a RecordIO `./mnist.recordio` on your host.
Copy link
Contributor

Choose a reason for hiding this comment

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

The above code snippet

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.


## Use the RecordIO files in Distributed Training

1. generate multiple RecordIO files
Copy link
Contributor

Choose a reason for hiding this comment

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

The number tags seem not showing correctly when viewing.

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.

counter += 1
lines = []
f_idx += 1
return counter
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove tools/codestyle/docstring_checker.pyc file please

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, and add it to gitignore.

Copy link
Contributor

@typhoonzero typhoonzero left a comment

Choose a reason for hiding this comment

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

LGTM++

@Yancey1989 Yancey1989 merged commit 2a5cb2e into PaddlePaddle:develop Jun 4, 2018
@Yancey1989 Yancey1989 deleted the dist_recordio branch June 4, 2018 09:47
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.

None yet

3 participants