Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
FastMoE
Commits
a12ad553
Commit
a12ad553
authored
Jun 17, 2021
by
Rick Ho
Browse files
fix concat shape
parent
913d7127
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
fmoe/megatron/balance.py
fmoe/megatron/balance.py
+2
-1
No files found.
fmoe/megatron/balance.py
View file @
a12ad553
...
...
@@ -94,7 +94,8 @@ def patch_forward_step(forward_step_func):
if
hasattr
(
model
,
'module'
):
model
=
model
.
module
loss_list
=
[
l
.
mlp
.
gate
.
get_loss
(
clear
=
False
)
for
l
in
model
.
language_model
.
transformer
.
layers
]
loss_list
=
[
l
.
mlp
.
gate
.
get_loss
(
clear
=
False
).
view
(
1
)
for
l
in
model
.
language_model
.
transformer
.
layers
]
(
loss
,
state_dict
),
bal_loss
=
(
output
,
torch
.
cat
(
loss_list
).
mean
()
*
args
.
balance_loss_weight
...
...
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