Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
fairscale
Commits
177151e0
Unverified
Commit
177151e0
authored
Oct 09, 2020
by
Benjamin Lefaudeux
Committed by
GitHub
Oct 09, 2020
Browse files
[bugfix] OSS no reduce loss (#133)
* bugfix * adjust default non-regression loss, not all_reduced now
parent
5220f89b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
5 deletions
+1
-5
.circleci/config.yml
.circleci/config.yml
+1
-1
benchmarks/oss.py
benchmarks/oss.py
+0
-2
docs/source/tutorials/oss.rst
docs/source/tutorials/oss.rst
+0
-2
No files found.
.circleci/config.yml
View file @
177151e0
...
...
@@ -100,7 +100,7 @@ run_oss_benchmark: &run_oss_benchmark
-
run
:
name
:
Run OSS Benchmark
command
:
|
python benchmarks/oss.py --check_regression --world_size 4 --reference_speed 13.7 --reference_memory 4390 --reference_loss 0.
595
python benchmarks/oss.py --check_regression --world_size 4 --reference_speed 13.7 --reference_memory 4390 --reference_loss 0.
152
run_oss_gloo
:
&run_oss_gloo
-
run
:
...
...
benchmarks/oss.py
View file @
177151e0
...
...
@@ -124,8 +124,6 @@ def train(
loss
/=
world_size
loss
.
backward
()
dist
.
all_reduce
(
loss
,
op
=
dist
.
ReduceOp
.
SUM
)
if
use_sdp
:
ddp
.
reduce
()
# Send the gradients to the appropriate shards
...
...
docs/source/tutorials/oss.rst
View file @
177151e0
...
...
@@ -42,7 +42,6 @@ Let's suppose that your trainer looks like
loss = loss_fn(outputs, target)
loss /= world_size
loss.backward()
torch.distributed.all_reduce(loss, op=torch.distributed.ReduceOp.SUM)
optimizer.step()
...
...
@@ -90,7 +89,6 @@ Then sharding the optimizer state is merely a matter of wrapping your optimizer
loss = loss_fn(outputs, target)
loss /= world_size
loss.backward()
torch.distributed.all_reduce(loss, op=torch.distributed.ReduceOp.SUM)
optimizer.step()
...
...
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