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
d3e0a688
Commit
d3e0a688
authored
Dec 16, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename `average_grads
parent
363777e4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
tensorpack/graph_builder/training.py
tensorpack/graph_builder/training.py
+2
-2
tensorpack/graph_builder/utils.py
tensorpack/graph_builder/utils.py
+3
-2
tensorpack/train/trainers.py
tensorpack/train/trainers.py
+1
-1
No files found.
tensorpack/graph_builder/training.py
View file @
d3e0a688
...
@@ -14,7 +14,7 @@ from ..tfutils.gradproc import ScaleGradient
...
@@ -14,7 +14,7 @@ from ..tfutils.gradproc import ScaleGradient
from
.utils
import
(
from
.utils
import
(
LeastLoadedDeviceSetter
,
override_to_local_variable
,
LeastLoadedDeviceSetter
,
override_to_local_variable
,
allreduce_grads
,
average_grads
)
allreduce_grads
,
average_grads
_with_colocation
)
__all__
=
[
'GraphBuilder'
,
__all__
=
[
'GraphBuilder'
,
...
@@ -145,7 +145,7 @@ class SyncMultiGPUParameterServerBuilder(DataParallelBuilder):
...
@@ -145,7 +145,7 @@ class SyncMultiGPUParameterServerBuilder(DataParallelBuilder):
# self.train_op = tf.group(*ops)
# self.train_op = tf.group(*ops)
# return
# return
grads
=
average_grads
(
grad_list
)
grads
=
average_grads
_with_colocation
(
grad_list
)
# grads = grad_list[0]
# grads = grad_list[0]
opt
=
get_opt_fn
()
opt
=
get_opt_fn
()
...
...
tensorpack/graph_builder/utils.py
View file @
d3e0a688
...
@@ -9,7 +9,8 @@ import tensorflow as tf
...
@@ -9,7 +9,8 @@ import tensorflow as tf
__all__
=
[
'LeastLoadedDeviceSetter'
,
'OverrideToLocalVariable'
,
__all__
=
[
'LeastLoadedDeviceSetter'
,
'OverrideToLocalVariable'
,
'override_to_local_variable'
,
'allreduce_grads'
,
'average_grads'
]
'override_to_local_variable'
,
'allreduce_grads'
,
'average_grads_with_colocation'
]
"""
"""
...
@@ -114,7 +115,7 @@ def allreduce_grads(all_grads):
...
@@ -114,7 +115,7 @@ def allreduce_grads(all_grads):
return
ret
return
ret
def
average_grads
(
all_grads
):
def
average_grads
_with_colocation
(
all_grads
):
"""
"""
Average the gradients, on the device of each variable.
Average the gradients, on the device of each variable.
...
...
tensorpack/train/trainers.py
View file @
d3e0a688
...
@@ -95,7 +95,7 @@ def SyncMultiGPUTrainer(gpus):
...
@@ -95,7 +95,7 @@ def SyncMultiGPUTrainer(gpus):
Args:
Args:
gpus (list[int]): list of GPU ids.
gpus (list[int]): list of GPU ids.
"""
"""
return
SyncMultiGPUTrainerParameterServer
(
gpus
,
ps_device
=
'
g
pu'
)
return
SyncMultiGPUTrainerParameterServer
(
gpus
,
ps_device
=
'
c
pu'
)
class
AsyncMultiGPUTrainer
(
SingleCostTrainer
):
class
AsyncMultiGPUTrainer
(
SingleCostTrainer
):
...
...
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