@@ -798,27 +798,25 @@ def _insert_send_recv(cur_id, prev_id):
798
798
ring_id = self ._pp_ring_map [pair_key ]
799
799
800
800
if self .schedule_mode == 'F-then-B' : # F-then-B
801
- send_op = block ._insert_op_without_sync (
801
+ block ._insert_op_without_sync (
802
802
index = index + extra_index_info ['index' ],
803
803
type = 'p_send' ,
804
804
inputs = {'x' : var },
805
805
attrs = {
806
806
'peer' : 1 ,
807
807
self ._op_role_key : op_role ,
808
808
'ring_id' : ring_id ,
809
+ 'dynamic_shape' : True ,
809
810
},
810
811
)
811
- print ("---------pipeline----------" )
812
- print (send_op )
813
- # send_op.dist_attr.execution_stream = "default"
814
812
extra_index_info ['index' ] += 1
815
813
var_shape = list (var .shape )
816
814
var_shape [0 ] = (
817
815
self .micro_batch_size
818
816
if var_shape [0 ] < 0
819
817
else var_shape [0 ]
820
818
)
821
- recv_op = block ._insert_op_without_sync (
819
+ block ._insert_op_without_sync (
822
820
index = index + extra_index_info ['index' ],
823
821
type = 'p_recv' ,
824
822
outputs = {'out' : [var ]},
@@ -827,11 +825,9 @@ def _insert_send_recv(cur_id, prev_id):
827
825
'peer' : 0 ,
828
826
'ring_id' : ring_id ,
829
827
self ._op_role_key : op_role ,
828
+ 'dynamic_shape' : True ,
830
829
},
831
830
)
832
- print ("---------pipeline----------" )
833
- print (recv_op )
834
- # recv_op.dist_attr.execution_stream = "default"
835
831
extra_index_info ['index' ] += 1
836
832
elif self .schedule_mode == '1F1B' : # 1F1B
837
833
var_shape = list (var .shape )
@@ -891,19 +887,17 @@ def _insert_send_recv(cur_id, prev_id):
891
887
True if isinstance (prefix_var , Parameter ) else False
892
888
)
893
889
if not use_mp or is_param :
894
- send_op = block ._insert_op_without_sync (
890
+ block ._insert_op_without_sync (
895
891
index = index + extra_index_info ['index' ],
896
892
type = 'p_send' ,
897
893
inputs = {'x' : var },
898
894
attrs = {
899
895
'ring_id' : ring_id ,
900
896
'peer' : 1 ,
901
897
self ._op_role_key : op_role ,
898
+ 'dynamic_shape' : True ,
902
899
},
903
900
)
904
- print ("---------pipeline----------" )
905
- print (send_op )
906
- # send_op.dist_attr.execution_stream = "default"
907
901
else :
908
902
block ._insert_op_without_sync (
909
903
index = index + extra_index_info ['index' ],
@@ -943,7 +937,7 @@ def _insert_send_recv(cur_id, prev_id):
943
937
sync_comm_op ._set_attr ('pipeline_flag' , '' )
944
938
extra_index_info ['index' ] += 1
945
939
if not use_mp or is_param :
946
- recv_op = block ._insert_op_without_sync (
940
+ block ._insert_op_without_sync (
947
941
index = index + extra_index_info ['index' ],
948
942
type = 'p_recv' ,
949
943
outputs = {'out' : [var ]},
@@ -952,11 +946,9 @@ def _insert_send_recv(cur_id, prev_id):
952
946
'peer' : 0 ,
953
947
'ring_id' : ring_id ,
954
948
self ._op_role_key : op_role ,
949
+ 'dynamic_shape' : True ,
955
950
},
956
951
)
957
- print ("---------pipeline----------" )
958
- print (recv_op )
959
- # recv_op.dist_attr.execution_stream = "default"
960
952
else :
961
953
block ._insert_op_without_sync (
962
954
index = index + extra_index_info ['index' ],
@@ -984,7 +976,6 @@ def _insert_send_recv(cur_id, prev_id):
984
976
self ._op_role_key : op_role ,
985
977
'use_calc_stream' : True ,
986
978
'ring_id' : 0 ,
987
- # if p_recv, num&id attr is not in op_attrs, will not insert
988
979
'nranks' : self .mp_degree ,
989
980
'rank' : self .mp_rank ,
990
981
},
@@ -1637,10 +1628,9 @@ def _process_persistable_vars_in_multi_sections(
1637
1628
'peer' : read_dev_index ,
1638
1629
'ring_id' : ring_id ,
1639
1630
self ._op_role_key : self ._op_role .LRSched ,
1631
+ 'dynamic_shape' : True ,
1640
1632
},
1641
1633
)
1642
- print ("---------pipeline----------" )
1643
- # print(recv_op)
1644
1634
read_block ._insert_op (
1645
1635
index = 0 ,
1646
1636
type = 'p_recv' ,
@@ -1652,6 +1642,7 @@ def _process_persistable_vars_in_multi_sections(
1652
1642
'peer' : write_dev_index ,
1653
1643
'ring_id' : ring_id ,
1654
1644
self ._op_role_key : self ._op_role .LRSched ,
1645
+ 'dynamic_shape' : True ,
1655
1646
},
1656
1647
)
1657
1648
read_block ._insert_op (
0 commit comments