diff --git a/tests/graph_optimization/test_graph_opt_backend.py b/tests/graph_optimization/test_graph_opt_backend.py index 6a4b56ccf53..ec1d729daeb 100644 --- a/tests/graph_optimization/test_graph_opt_backend.py +++ b/tests/graph_optimization/test_graph_opt_backend.py @@ -76,6 +76,8 @@ class TestGraphOptBackend(unittest.TestCase): """ def setUp(self): + paddle.seed(2025) + """Set up test fixtures, compute baseline once for all tests""" # Setup common test data that will be reused across all tests self.input_shape = (4, 8) @@ -177,9 +179,11 @@ def _run_model_test(self, fd_config, test_name, compare_with_baseline=True): self.baseline_result, output.numpy(), err_msg=f"Test {test_name} failed: output mismatch", - atol=1e-6, # for CINN + atol=1e-4, # for CINN + rtol=1e-2, ) + def tearDown(self): paddle.jit.sot.opcode_translator.executor.executor_cache.OpcodeExecutorCache().clear() def test_dynamic_graph(self):