From 7307e955ad0a678bfc465a6ce2e31dc425eefc4b Mon Sep 17 00:00:00 2001 From: gongweibao Date: Tue, 21 Jun 2022 17:53:03 +0800 Subject: [PATCH] Pass NVIDIA_TF32_OVERRIDE to internal (#43646) --- .../paddle/fluid/tests/unittests/test_collective_api_base.py | 4 ++++ python/paddle/fluid/tests/unittests/test_dist_base.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/python/paddle/fluid/tests/unittests/test_collective_api_base.py b/python/paddle/fluid/tests/unittests/test_collective_api_base.py index 04f36c2e74c..ef011d2ddc8 100644 --- a/python/paddle/fluid/tests/unittests/test_collective_api_base.py +++ b/python/paddle/fluid/tests/unittests/test_collective_api_base.py @@ -229,6 +229,10 @@ class TestDistBase(unittest.TestCase): required_envs["GLOG_logtostderr"] = "1" required_envs["GLOO_LOG_LEVEL"] = "TRACE" + if os.getenv('NVIDIA_TF32_OVERRIDE', '') is not None: + required_envs['NVIDIA_TF32_OVERRIDE'] = os.getenv( + 'NVIDIA_TF32_OVERRIDE', '') + if eager_mode: required_envs["FLAGS_enable_eager_mode"] = "%d" % 1 else: diff --git a/python/paddle/fluid/tests/unittests/test_dist_base.py b/python/paddle/fluid/tests/unittests/test_dist_base.py index 987af61c489..70b1d0568a0 100755 --- a/python/paddle/fluid/tests/unittests/test_dist_base.py +++ b/python/paddle/fluid/tests/unittests/test_dist_base.py @@ -1468,6 +1468,10 @@ class TestDistBase(unittest.TestCase): "grpc_server=10,request_handler_impl=10,section_worker=10" required_envs["GLOG_logtostderr"] = "1" + if os.getenv('NVIDIA_TF32_OVERRIDE', '') is not None: + required_envs['NVIDIA_TF32_OVERRIDE'] = os.getenv( + 'NVIDIA_TF32_OVERRIDE', '') + required_envs.update(need_envs) return required_envs -- GitLab