From 79303c2ac1305b6f506ada5b767639392c2cd695 Mon Sep 17 00:00:00 2001 From: Aganlengzi Date: Thu, 21 Apr 2022 23:22:24 +0800 Subject: [PATCH] [CustomDevice] fix exit order (#42088) --- python/paddle/fluid/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/__init__.py b/python/paddle/fluid/__init__.py index 13b964274fd..8dbeb3eeb27 100644 --- a/python/paddle/fluid/__init__.py +++ b/python/paddle/fluid/__init__.py @@ -227,7 +227,9 @@ if core.is_compiled_with_npu(): atexit.register(core.npu_finalize) # NOTE(Aurelius84): clean up ExecutorCacheInfo in advance manually. atexit.register(core.clear_executor_cache) + # NOTE(Aganlengzi): clean up KernelFactory in advance manually. -atexit.register(core.clear_kernel_factory) # NOTE(wangran16): clean up DeviceManger in advance manually. +# Keep clear_kernel_factory running before clear_device_manager atexit.register(core.clear_device_manager) +atexit.register(core.clear_kernel_factory) -- GitLab