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
66d5ce80
Commit
66d5ce80
authored
May 11, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix in async
parent
d869aec8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
tensorpack/train/multigpu.py
tensorpack/train/multigpu.py
+5
-4
No files found.
tensorpack/train/multigpu.py
View file @
66d5ce80
...
@@ -27,11 +27,11 @@ __all__ = ['MultiGPUTrainerBase', 'SyncMultiGPUTrainer',
...
@@ -27,11 +27,11 @@ __all__ = ['MultiGPUTrainerBase', 'SyncMultiGPUTrainer',
'SyncMultiGPUTrainerParameterServer'
]
'SyncMultiGPUTrainerParameterServer'
]
def
apply_prefetch_policy
(
config
):
def
apply_prefetch_policy
(
config
,
use_stage
=
True
):
if
config
.
data
is
None
and
config
.
dataflow
is
not
None
:
if
config
.
data
is
None
and
config
.
dataflow
is
not
None
:
config
.
data
=
QueueInput
(
config
.
dataflow
)
config
.
data
=
QueueInput
(
config
.
dataflow
)
config
.
dataflow
=
None
config
.
dataflow
=
None
if
len
(
config
.
tower
)
>
1
:
if
len
(
config
.
tower
)
>
1
and
use_stage
:
assert
tf
.
test
.
is_gpu_available
()
assert
tf
.
test
.
is_gpu_available
()
# seem to only improve on >1 GPUs
# seem to only improve on >1 GPUs
...
@@ -204,10 +204,10 @@ class SyncMultiGPUTrainerReplicated(MultiGPUTrainerBase, SingleCostFeedfreeTrain
...
@@ -204,10 +204,10 @@ class SyncMultiGPUTrainerReplicated(MultiGPUTrainerBase, SingleCostFeedfreeTrain
Data-parallel Multi-GPU trainer where each GPU contains a replicate of the
Data-parallel Multi-GPU trainer where each GPU contains a replicate of the
whole model. Each gradient update is broadcast and synced.
whole model. Each gradient update is broadcast and synced.
"""
"""
def
__init__
(
self
,
config
):
def
__init__
(
self
,
config
):
apply_prefetch_policy
(
config
)
apply_prefetch_policy
(
config
)
self
.
_input_source
=
config
.
data
self
.
_input_source
=
config
.
data
logger
.
warn
(
"Note that SyncMultiGPUTrainerReplicated doesn't support inference."
)
super
(
SyncMultiGPUTrainerReplicated
,
self
)
.
__init__
(
config
)
super
(
SyncMultiGPUTrainerReplicated
,
self
)
.
__init__
(
config
)
@
staticmethod
@
staticmethod
...
@@ -288,7 +288,8 @@ class AsyncMultiGPUTrainer(MultiGPUTrainerBase,
...
@@ -288,7 +288,8 @@ class AsyncMultiGPUTrainer(MultiGPUTrainerBase,
``1.0/nr_tower``, to make Async and Sync Trainer have the same
``1.0/nr_tower``, to make Async and Sync Trainer have the same
effective learning rate.
effective learning rate.
"""
"""
apply_prefetch_policy
(
config
)
apply_prefetch_policy
(
config
,
use_stage
=
False
)
logger
.
warn
(
"Async training hasn't been well optimized. Sync training is even faster"
)
self
.
_input_source
=
config
.
data
self
.
_input_source
=
config
.
data
super
(
AsyncMultiGPUTrainer
,
self
)
.
__init__
(
config
)
super
(
AsyncMultiGPUTrainer
,
self
)
.
__init__
(
config
)
...
...
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