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
chenpangpang
transformers
Commits
98f6e1ee
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "9442b3ce316878cf24d59905184f47c315d3f083"
Unverified
Commit
98f6e1ee
authored
May 26, 2022
by
Sylvain Gugger
Committed by
GitHub
May 26, 2022
Browse files
Fix model parallelism test (#17439)
parent
7535d92e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tests/test_modeling_common.py
tests/test_modeling_common.py
+2
-2
No files found.
tests/test_modeling_common.py
View file @
98f6e1ee
...
@@ -2203,7 +2203,7 @@ class ModelTesterMixin:
...
@@ -2203,7 +2203,7 @@ class ModelTesterMixin:
@
require_torch_gpu
@
require_torch_gpu
def
test_cpu_offload
(
self
):
def
test_cpu_offload
(
self
):
config
,
inputs_dict
=
self
.
model_tester
.
prepare_config_and_inputs_for_common
()
config
,
inputs_dict
=
self
.
model_tester
.
prepare_config_and_inputs_for_common
()
if
config
.
num_hidden_layers
<
5
:
if
isinstance
(
getattr
(
config
,
"num_hidden_layers"
,
None
),
int
)
and
config
.
num_hidden_layers
<
5
:
config
.
num_hidden_layers
=
5
config
.
num_hidden_layers
=
5
for
model_class
in
self
.
all_model_classes
:
for
model_class
in
self
.
all_model_classes
:
...
@@ -2236,7 +2236,7 @@ class ModelTesterMixin:
...
@@ -2236,7 +2236,7 @@ class ModelTesterMixin:
@
require_torch_multi_gpu
@
require_torch_multi_gpu
def
test_model_parallelism
(
self
):
def
test_model_parallelism
(
self
):
config
,
inputs_dict
=
self
.
model_tester
.
prepare_config_and_inputs_for_common
()
config
,
inputs_dict
=
self
.
model_tester
.
prepare_config_and_inputs_for_common
()
if
config
.
num_hidden_layers
<
5
:
if
isinstance
(
getattr
(
config
,
"num_hidden_layers"
,
None
),
int
)
and
config
.
num_hidden_layers
<
5
:
config
.
num_hidden_layers
=
5
config
.
num_hidden_layers
=
5
for
model_class
in
self
.
all_model_classes
:
for
model_class
in
self
.
all_model_classes
:
...
...
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