File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
python/paddle/distributed/auto_parallel Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -1929,16 +1929,21 @@ def __convert_strategy(self, strategy):
1929
1929
inner_strategy .gradient_merge = copy .deepcopy (strategy .gradient_merge )
1930
1930
inner_strategy .pipeline = copy .deepcopy (strategy .pipeline )
1931
1931
# The below are template interfaces
1932
- inner_strategy .recompute = copy .deepcopy (strategy ._recompute )
1933
- inner_strategy .mp_optimization = copy .deepcopy (
1934
- strategy ._mp_optimization
1935
- )
1936
- inner_strategy .dp_optimization = copy .deepcopy (
1937
- strategy ._dp_optimization
1938
- )
1939
- inner_strategy .sp_optimization = copy .deepcopy (
1940
- strategy ._sp_optimization
1941
- )
1932
+ if hasattr (strategy , "_recompute" ):
1933
+ inner_strategy .recompute = copy .deepcopy (strategy ._recompute )
1934
+
1935
+ if hasattr (strategy , "_mp_optimization" ):
1936
+ inner_strategy .mp_optimization = copy .deepcopy (
1937
+ strategy ._mp_optimization
1938
+ )
1939
+ if hasattr (strategy , "_dp_optimization" ):
1940
+ inner_strategy .dp_optimization = copy .deepcopy (
1941
+ strategy ._dp_optimization
1942
+ )
1943
+ if hasattr (strategy , "_sp_optimization" ):
1944
+ inner_strategy .sp_optimization = copy .deepcopy (
1945
+ strategy ._sp_optimization
1946
+ )
1942
1947
1943
1948
return inner_strategy
1944
1949
You can’t perform that action at this time.
0 commit comments