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
e61ffc77
Unverified
Commit
e61ffc77
authored
Jun 09, 2023
by
digger yu
Committed by
GitHub
Jun 09, 2023
Browse files
fix typo tests/ (#3936)
parent
bd2c7c32
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
tests/kit/model_zoo/registry.py
tests/kit/model_zoo/registry.py
+2
-2
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_batch_norm_handler.py
...tensor_shard/test_node_handler/test_batch_norm_handler.py
+1
-1
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_output_handler.py
...est_tensor_shard/test_node_handler/test_output_handler.py
+4
-4
tests/test_tensor/test_dtensor/test_layout_converter.py
tests/test_tensor/test_dtensor/test_layout_converter.py
+1
-1
No files found.
tests/kit/model_zoo/registry.py
View file @
e61ffc77
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
from
typing
import
Callable
from
typing
import
Callable
__all__
=
[
'ModelZooRegistry'
,
'ModelAttribute
m
'
,
'model_zoo'
]
__all__
=
[
'ModelZooRegistry'
,
'ModelAttribute'
,
'model_zoo'
]
@
dataclass
@
dataclass
...
@@ -37,7 +37,7 @@ class ModelZooRegistry(dict):
...
@@ -37,7 +37,7 @@ class ModelZooRegistry(dict):
>>> model_zoo = ModelZooRegistry()
>>> model_zoo = ModelZooRegistry()
>>> model_zoo.register('resnet18', resnet18, resnet18_data_gen)
>>> model_zoo.register('resnet18', resnet18, resnet18_data_gen)
>>> # Run the model
>>> # Run the model
>>> data =
resn
resnet18_data_gen() # do not input any argument
>>> data = resnet18_data_gen() # do not input any argument
>>> model = resnet18() # do not input any argument
>>> model = resnet18() # do not input any argument
>>> out = model(**data)
>>> out = model(**data)
...
...
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_batch_norm_handler.py
View file @
e61ffc77
...
@@ -27,7 +27,7 @@ def check_bn_module_handler(rank, world_size, port):
...
@@ -27,7 +27,7 @@ def check_bn_module_handler(rank, world_size, port):
# the index of bn node in computation graph
# the index of bn node in computation graph
node_index
=
1
node_index
=
1
# the total number of bn strategies without sync bn mode
# the total number of bn strategies without sync bn mode
# TODO: add sync bn stategies after related passes ready
# TODO: add sync bn st
r
ategies after related passes ready
strategy_number
=
4
strategy_number
=
4
numerical_test_for_node_strategy
(
model
=
model
,
numerical_test_for_node_strategy
(
model
=
model
,
device_mesh
=
device_mesh
,
device_mesh
=
device_mesh
,
...
...
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_output_handler.py
View file @
e61ffc77
...
@@ -43,14 +43,14 @@ def test_output_handler(output_option):
...
@@ -43,14 +43,14 @@ def test_output_handler(output_option):
output_strategies_vector
=
StrategiesVector
(
output_node
)
output_strategies_vector
=
StrategiesVector
(
output_node
)
# build handler
# build handler
o
t
uput_handler
=
OutputHandler
(
node
=
output_node
,
ou
t
put_handler
=
OutputHandler
(
node
=
output_node
,
device_mesh
=
device_mesh
,
device_mesh
=
device_mesh
,
strategies_vector
=
output_strategies_vector
,
strategies_vector
=
output_strategies_vector
,
output_option
=
output_option
)
output_option
=
output_option
)
o
t
uput_handler
.
register_strategy
(
compute_resharding_cost
=
False
)
ou
t
put_handler
.
register_strategy
(
compute_resharding_cost
=
False
)
# check operation data mapping
# check operation data mapping
mapping
=
o
t
uput_handler
.
get_operation_data_mapping
()
mapping
=
ou
t
put_handler
.
get_operation_data_mapping
()
for
name
,
op_data
in
mapping
.
items
():
for
name
,
op_data
in
mapping
.
items
():
op_data
:
OperationData
op_data
:
OperationData
...
@@ -59,7 +59,7 @@ def test_output_handler(output_option):
...
@@ -59,7 +59,7 @@ def test_output_handler(output_option):
assert
mapping
[
'output'
].
name
==
"output"
assert
mapping
[
'output'
].
name
==
"output"
assert
mapping
[
'output'
].
type
==
OperationDataType
.
OUTPUT
assert
mapping
[
'output'
].
type
==
OperationDataType
.
OUTPUT
strategy_name_list
=
[
val
.
name
for
val
in
o
t
uput_handler
.
strategies_vector
]
strategy_name_list
=
[
val
.
name
for
val
in
ou
t
put_handler
.
strategies_vector
]
if
output_option
==
'distributed'
:
if
output_option
==
'distributed'
:
assert
"Distributed Output"
in
strategy_name_list
assert
"Distributed Output"
in
strategy_name_list
else
:
else
:
...
...
tests/test_tensor/test_dtensor/test_layout_converter.py
View file @
e61ffc77
...
@@ -137,7 +137,7 @@ def check_layout_converting(rank, world_size, port):
...
@@ -137,7 +137,7 @@ def check_layout_converting(rank, world_size, port):
assert
comm_action_sequence
[
2
].
shard_dim
==
0
assert
comm_action_sequence
[
2
].
shard_dim
==
0
assert
comm_action_sequence
[
2
].
logical_process_axis
==
1
assert
comm_action_sequence
[
2
].
logical_process_axis
==
1
# checkout c
h
ached_spec_pairs_transform_path
# checkout cached_spec_pairs_transform_path
assert
layout_converter
.
cached_solution
[(
'[R, S01, R]'
,
'[S01, R, R]'
)][
0
]
==
transform_path
assert
layout_converter
.
cached_solution
[(
'[R, S01, R]'
,
'[S01, R, R]'
)][
0
]
==
transform_path
assert
layout_converter
.
cached_solution
[(
'[R, S01, R]'
,
'[S01, R, R]'
)][
1
]
==
comm_action_sequence
assert
layout_converter
.
cached_solution
[(
'[R, S01, R]'
,
'[S01, R, R]'
)][
1
]
==
comm_action_sequence
...
...
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