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
ColossalAI
Commits
193d6293
Unverified
Commit
193d6293
authored
May 06, 2022
by
Ziyue Jiang
Committed by
GitHub
May 06, 2022
Browse files
update pytest.mark.parametrize in tensor tests (#913)
parent
1cf7fb3c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
tests/test_tensor/test_embedding_tp.py
tests/test_tensor/test_embedding_tp.py
+2
-2
tests/test_tensor/test_linear_tp.py
tests/test_tensor/test_linear_tp.py
+2
-2
No files found.
tests/test_tensor/test_embedding_tp.py
View file @
193d6293
...
@@ -8,7 +8,7 @@ import colossalai
...
@@ -8,7 +8,7 @@ import colossalai
import
pytest
import
pytest
import
torch
import
torch
import
torch.multiprocessing
as
mp
import
torch.multiprocessing
as
mp
from
colossalai.testing
import
parameterize
,
rerun_if_address_is_in_use
from
colossalai.testing
import
rerun_if_address_is_in_use
from
colossalai.utils.cuda
import
get_current_device
from
colossalai.utils.cuda
import
get_current_device
from
colossalai.utils
import
free_port
from
colossalai.utils
import
free_port
from
colossalai.core
import
global_context
as
gpc
from
colossalai.core
import
global_context
as
gpc
...
@@ -121,7 +121,7 @@ def run_dist(rank, world_size, port):
...
@@ -121,7 +121,7 @@ def run_dist(rank, world_size, port):
run_embedding_tp1d_row_test
()
run_embedding_tp1d_row_test
()
@
pytest
.
mark
.
dist
@
pytest
.
mark
.
dist
@
paramet
e
rize
(
'world_size'
,
[
1
,
4
])
@
pytest
.
mark
.
parametrize
(
'world_size'
,
[
1
,
4
])
@
rerun_if_address_is_in_use
()
@
rerun_if_address_is_in_use
()
def
test_embedding_1d
(
world_size
):
def
test_embedding_1d
(
world_size
):
run_func
=
partial
(
run_dist
,
world_size
=
world_size
,
port
=
free_port
())
run_func
=
partial
(
run_dist
,
world_size
=
world_size
,
port
=
free_port
())
...
...
tests/test_tensor/test_linear_tp.py
View file @
193d6293
...
@@ -8,7 +8,7 @@ import colossalai
...
@@ -8,7 +8,7 @@ import colossalai
import
pytest
import
pytest
import
torch
import
torch
import
torch.multiprocessing
as
mp
import
torch.multiprocessing
as
mp
from
colossalai.testing
import
parameterize
,
rerun_if_address_is_in_use
from
colossalai.testing
import
rerun_if_address_is_in_use
from
colossalai.utils.cuda
import
get_current_device
from
colossalai.utils.cuda
import
get_current_device
from
colossalai.utils
import
free_port
from
colossalai.utils
import
free_port
from
colossalai.core
import
global_context
as
gpc
from
colossalai.core
import
global_context
as
gpc
...
@@ -149,7 +149,7 @@ def run_dist(rank, world_size, port):
...
@@ -149,7 +149,7 @@ def run_dist(rank, world_size, port):
run_linear_tp1d_col_test
()
run_linear_tp1d_col_test
()
@
pytest
.
mark
.
dist
@
pytest
.
mark
.
dist
@
paramet
e
rize
(
'world_size'
,
[
1
,
4
])
@
pytest
.
mark
.
parametrize
(
'world_size'
,
[
1
,
4
])
@
rerun_if_address_is_in_use
()
@
rerun_if_address_is_in_use
()
def
test_linear_1d
(
world_size
):
def
test_linear_1d
(
world_size
):
run_func
=
partial
(
run_dist
,
world_size
=
world_size
,
port
=
free_port
())
run_func
=
partial
(
run_dist
,
world_size
=
world_size
,
port
=
free_port
())
...
...
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