Skip to content

【PIR API adaptor No.36】check_numerics #58879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 1, 2023
4 changes: 2 additions & 2 deletions python/paddle/amp/debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from paddle.base import core
from paddle.base.framework import dygraph_only

from ..framework import LayerHelper, in_dynamic_mode
from ..framework import LayerHelper, in_dynamic_or_pir_mode

__all__ = [
"DebugMode",
Expand Down Expand Up @@ -372,7 +372,7 @@ def check_numerics(
stack_height_limit = -1
output_dir = ""

if in_dynamic_mode():
if in_dynamic_or_pir_mode():
return _C_ops.check_numerics(
tensor,
op_type,
Expand Down
2 changes: 2 additions & 0 deletions test/legacy_test/test_nan_inf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import numpy as np

import paddle
from paddle.pir_utils import test_with_pir_api


class TestNanInfBase(unittest.TestCase):
Expand Down Expand Up @@ -299,6 +300,7 @@ def test_eager(self):
debug_mode=paddle.amp.debugging.DebugMode.CHECK_ALL,
)

@test_with_pir_api

This comment was marked as resolved.

def test_static(self):
paddle.enable_static()
shape = [8, 8]
Expand Down