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
82dbd5d8
Unverified
Commit
82dbd5d8
authored
Oct 08, 2020
by
ngoyal2707
Committed by
GitHub
Oct 08, 2020
Browse files
[fix] megatron + oss (#127)
authored-by:
Naman Goyal
<
namangoyal@learnfair0755.h2.fair
>
parent
6658be22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
fairscale/optim/oss.py
fairscale/optim/oss.py
+2
-2
No files found.
fairscale/optim/oss.py
View file @
82dbd5d8
...
...
@@ -434,14 +434,14 @@ class OSS(Optimizer):
# Since all the parameters are already sorted per increasing size, we only need to consider the first ones.
while
i_bucketed
<
len
(
params
)
and
offset
+
params
[
i_bucketed
].
numel
()
<
buffer_size
:
end
=
offset
+
params
[
i_bucketed
].
numel
()
if
rank
==
self_rank
:
if
global_
rank
==
self_rank
:
buffer
[
offset
:
end
].
copy_
(
params
[
i_bucketed
].
data
.
view
(
-
1
))
# type: ignore
offset
=
end
i_bucketed
+=
1
if
i_bucketed
>
0
:
future
=
dist
.
broadcast
(
tensor
=
buffer
,
src
=
global_rank
,
group
=
group
,
async_op
=
True
)
if
rank
!=
self_rank
:
if
global_
rank
!=
self_rank
:
# This request will need to be unrolled
bucket_requests
.
append
((
future
,
rank
))
...
...
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