Skip to content

Commit 09aed38

Browse files
authored
[Cherry-pic]Fix the bug in fleet amp_init. (#30606) (#30608)
* Fix the bug in fleet amp_init. * Fix the amp_init unit test.
1 parent 2494562 commit 09aed38

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python/paddle/distributed/fleet/base/fleet_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,8 @@ def run_example_code():
10191019
run_example_code()
10201020
"""
10211021
# imitate target optimizer retrieval
1022-
return self.user_defined_optimizer.amp_init(
1023-
place, scope=None, test_program=None, use_fp16_test=False)
1022+
return self.user_defined_optimizer.amp_init(place, scope, test_program,
1023+
use_fp16_test)
10241024

10251025
def _final_strategy(self):
10261026
if "valid_strategy" not in self._context:

python/paddle/fluid/tests/unittests/test_fleet_amp_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_fleet_amp_init(self):
6767

6868
exe = paddle.static.Executor(place)
6969
exe.run(paddle.static.default_startup_program())
70-
optimizer.amp_init(place, use_fp16_test=True)
70+
optimizer.amp_init(place)
7171

7272
step = 1
7373
for i in range(step):

0 commit comments

Comments
 (0)