-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Conversation
@@ -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"); |
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.
fluid.layers.open_files
should do the job, please see test_multi_file_reader.py
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.
Seems open_files_op
can only deal with the normal files.
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.
open_files_op
can deal with RecordIO file. Just make sure that file names end with '.recordio'
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.
Got it, thanks!
as follows: | ||
|
||
```python | ||
reader = paddle.batch(mnist.train(), batch_size=1) |
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.
Need to tell users why batch_size=1
here, and for fix batch_size we can gain performance?
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.
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. |
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.
The above code snippet
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.
Done.
|
||
## Use the RecordIO files in Distributed Training | ||
|
||
1. generate multiple RecordIO files |
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.
The number tags seem not showing correctly when viewing.
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.
Done.
counter += 1 | ||
lines = [] | ||
f_idx += 1 | ||
return counter |
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.
Remove tools/codestyle/docstring_checker.pyc
file please
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.
Done, and add it to gitignore.
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.
LGTM++
Fixed #11024