Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
2bbe988b
Commit
2bbe988b
authored
Aug 12, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update docs
parent
5ff263af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
docs/tutorial/efficient-dataflow.md
docs/tutorial/efficient-dataflow.md
+8
-4
No files found.
docs/tutorial/efficient-dataflow.md
View file @
2bbe988b
...
...
@@ -130,6 +130,9 @@ Let's summarize what the above dataflow does:
3.
Both 1 and 2 happen in one separate process, and the results are sent back to main process through ZeroMQ.
4.
Main process makes batches, and other tensorpack modules will then take care of how they should go into the graph.
Note that in an actual training setup, I used the above multiprocess version for training set since
it's faster to run heavy preprocessing in processes, and use this multithread version only for validation set.
## Sequential Read
Random read may not be a good idea when the data is not on an SSD.
...
...
@@ -212,9 +215,10 @@ Both imdecode and the augmentors can be quite slow. We can parallelize them like
Since we are reading the database sequentially, having multiple forked instances of the
base LMDB reader will result in biased data distribution. Therefore we use
`PrefetchData`
to
launch the base DataFlow in only
**one process**
, and only parallelize the transformations
with another
`PrefetchDataZMQ`
.
with another
`PrefetchDataZMQ`
(Nesting two
`PrefetchDataZMQ`
, however, will result in a different behavior.
These differences are explained in the API documentation in more details.)
These differences are explained in the API documentation in more details.).
Similar to what we did above, you can use
`ThreadedMapData`
to parallelize as well.
Let me summarize what the above DataFlow does:
...
...
@@ -223,8 +227,8 @@ Let me summarize what the above DataFlow does:
send them through ZMQ IPC pipe.
3.
The main process takes data from the pipe, makes batches.
The
above DataFlow can run at a speed of 1k ~ 2k images per second if you have good CPUs, RAM, disks and augmentor
s.
As a reference, tensorpack can train ResNet-18
(a shallow ResNet) at 4.5 batches (1.2k images) per second
on 4 old TitanX.
The
DataFlow mentioned above (both random read and sequential read) can run at a speed of 1k ~ 2k images per second if you have good CPUs, RAM, disk
s.
As a reference, tensorpack can train ResNet-18
at 1.2k images/s
on 4 old TitanX.
A DGX-1 (8 P100) can train ResNet-50 at 1.7k images/s according to the
[
official benchmark
](
https://www.tensorflow.org/performance/benchmarks
)
.
So DataFlow will not be a serious bottleneck if configured properly.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment