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
e4293e50
Unverified
Commit
e4293e50
authored
Dec 02, 2022
by
YuliangLiu0306
Committed by
GitHub
Dec 02, 2022
Browse files
[hotfix] update test for latest version (#2060)
parent
19438ea0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
14 deletions
+15
-14
colossalai/auto_parallel/passes/runtime_preparation_pass.py
colossalai/auto_parallel/passes/runtime_preparation_pass.py
+3
-2
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_bias_linear_module_node.py
...r_shard/test_node_handler/test_bias_linear_module_node.py
+4
-4
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_linear_handler.py
...est_tensor_shard/test_node_handler/test_linear_handler.py
+8
-8
No files found.
colossalai/auto_parallel/passes/runtime_preparation_pass.py
View file @
e4293e50
...
...
@@ -126,12 +126,13 @@ def _node_args_converting(gm: torch.fx.GraphModule, device_mesh: DeviceMesh):
if
method
in
(
torch
.
Tensor
.
view
,
torch
.
Tensor
.
reshape
):
for
arg
in
node
.
args
:
if
isinstance
(
arg
,
Node
):
if
isinstance
(
arg
.
_meta_data
,
int
):
if
isinstance
(
arg
.
_meta_data
,
(
int
,
tuple
,
list
)
):
new_args
.
append
(
arg
.
_meta_data
)
else
:
new_args
.
append
(
arg
)
else
:
assert
isinstance
(
arg
,
int
),
'The argument in view node should be either type of Node or int.'
assert
isinstance
(
arg
,
(
int
,
tuple
,
list
)),
'The argument in view node should be either type of Node or int.'
new_args
.
append
(
arg
)
for
dim
,
shard_dims
in
output_dim_partition_dict
.
items
():
...
...
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_bias_linear_module_node.py
View file @
e4293e50
...
...
@@ -102,12 +102,12 @@ def check_linear_module_handler(rank, bias, world_size, port):
assert
len
(
strategy_name_list
)
>
8
# SS = SR x RS
assert
'S0S1 = S0R x RS1'
in
strategy_name_list
assert
'S1S0 = S1R x RS0'
in
strategy_name_list
assert
'S0S1 = S0R x RS1
_0
'
in
strategy_name_list
assert
'S1S0 = S1R x RS0
_0
'
in
strategy_name_list
# SR = SS x SR
assert
'S0R = S0S1 x S1R'
in
strategy_name_list
assert
'S1R = S1S0 x S0R'
in
strategy_name_list
assert
'S0R = S0S1 x S1R
_0
'
in
strategy_name_list
assert
'S1R = S1S0 x S0R
_0
'
in
strategy_name_list
# RS = RS x SS
assert
'RS0 = RS1 x S1S0'
in
strategy_name_list
...
...
tests/test_auto_parallel/test_tensor_shard/test_node_handler/test_linear_handler.py
View file @
e4293e50
...
...
@@ -95,12 +95,12 @@ def check_linear_module_handler(rank, bias, world_size, port):
assert
len
(
strategy_name_list
)
>
8
# SS = SR x RS
assert
'S0S1 = S0R x RS1'
in
strategy_name_list
assert
'S1S0 = S1R x RS0'
in
strategy_name_list
assert
'S0S1 = S0R x RS1
_0
'
in
strategy_name_list
assert
'S1S0 = S1R x RS0
_0
'
in
strategy_name_list
# SR = SS x SR
assert
'S0R = S0S1 x S1R'
in
strategy_name_list
assert
'S1R = S1S0 x S0R'
in
strategy_name_list
assert
'S0R = S0S1 x S1R
_0
'
in
strategy_name_list
assert
'S1R = S1S0 x S0R
_0
'
in
strategy_name_list
# RS = RS x SS
assert
'RS0 = RS1 x S1S0'
in
strategy_name_list
...
...
@@ -212,12 +212,12 @@ def check_linear_function_handler(rank, bias, world_size, port):
assert
len
(
strategy_name_list
)
>
8
# SS = SR x RS
assert
'S0S1 = S0R x RS1'
in
strategy_name_list
assert
'S1S0 = S1R x RS0'
in
strategy_name_list
assert
'S0S1 = S0R x RS1
_0
'
in
strategy_name_list
assert
'S1S0 = S1R x RS0
_0
'
in
strategy_name_list
# SR = SS x SR
assert
'S0R = S0S1 x S1R'
in
strategy_name_list
assert
'S1R = S1S0 x S0R'
in
strategy_name_list
assert
'S0R = S0S1 x S1R
_0
'
in
strategy_name_list
assert
'S1R = S1S0 x S0R
_0
'
in
strategy_name_list
# RS = RS x SS
assert
'RS0 = RS1 x S1S0'
in
strategy_name_list
...
...
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