diff --git a/python/paddle/fluid/contrib/mixed_precision/fp16_lists.py b/python/paddle/fluid/contrib/mixed_precision/fp16_lists.py index 18f635ee8064cb5079b4b2e4d07ac4930b699613..efa9caaee8894a6fce6621f8e46a604ea97313b2 100644 --- a/python/paddle/fluid/contrib/mixed_precision/fp16_lists.py +++ b/python/paddle/fluid/contrib/mixed_precision/fp16_lists.py @@ -99,6 +99,8 @@ black_list = { # fp16 is slower than fp32, though fp16 is supported. 'lookup_table', 'lookup_table_v2', + # default fp32 can avoid return inf when the sum value large than 65504 + 'reduce_sum', } # This set contains two types of ops. All ops supported fp16 calculation. One diff --git a/python/paddle/fluid/dygraph/amp/auto_cast.py b/python/paddle/fluid/dygraph/amp/auto_cast.py index 7af8c18e33f8f7c6bf1d4adc927dba035be612d2..bd464450aef7f4115c01785c398fde62c7987b3f 100644 --- a/python/paddle/fluid/dygraph/amp/auto_cast.py +++ b/python/paddle/fluid/dygraph/amp/auto_cast.py @@ -47,6 +47,8 @@ BLACK_LIST = { 'sigmoid_cross_entropy_with_logits', 'cross_entropy', 'cross_entropy2', + # default fp32 can avoid return inf when the sum value large than 65504 + 'reduce_sum', } AMP_RELATED_FLAGS = [