From f80460919a3406d3ea0b55942bc88d7b32a308bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Agostinho?= Date: Thu, 19 Dec 2024 09:18:57 +0000 Subject: [PATCH] Don't touch nor send messages to the root logger. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --------- Signed-off-by: Sérgio Agostinho --- transformer_engine/jax/__init__.py | 4 +++- transformer_engine/paddle/__init__.py | 4 +++- transformer_engine/pytorch/__init__.py | 4 +++- transformer_engine/pytorch/attention.py | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/transformer_engine/jax/__init__.py b/transformer_engine/jax/__init__.py index 05adbd624c..34d4541a98 100644 --- a/transformer_engine/jax/__init__.py +++ b/transformer_engine/jax/__init__.py @@ -12,6 +12,8 @@ from transformer_engine.common import get_te_path, is_package_installed from transformer_engine.common import _get_sys_extension +_logger = logging.getLogger(__name__) + def _load_library(): """Load shared library with Transformer Engine C extensions""" @@ -36,7 +38,7 @@ def _load_library(): if is_package_installed("transformer-engine-cu12"): if not is_package_installed(module_name): - logging.info( + _logger.info( "Could not find package %s. Install transformer-engine using 'pip" " install transformer-engine[jax]==VERSION'", module_name, diff --git a/transformer_engine/paddle/__init__.py b/transformer_engine/paddle/__init__.py index 50cf2186d6..78912b0cce 100644 --- a/transformer_engine/paddle/__init__.py +++ b/transformer_engine/paddle/__init__.py @@ -11,6 +11,8 @@ from transformer_engine.common import is_package_installed +_logger = logging.getLogger(__name__) + def _load_library(): """Load shared library with Transformer Engine C extensions""" @@ -35,7 +37,7 @@ def _load_library(): if is_package_installed("transformer-engine-cu12"): if not is_package_installed(module_name): - logging.info( + _logger.info( "Could not find package %s. Install transformer-engine using 'pip" " install transformer-engine[paddle]==VERSION'", module_name, diff --git a/transformer_engine/pytorch/__init__.py b/transformer_engine/pytorch/__init__.py index 781f9d42fd..8c0d032eb5 100644 --- a/transformer_engine/pytorch/__init__.py +++ b/transformer_engine/pytorch/__init__.py @@ -16,6 +16,8 @@ from transformer_engine.common import get_te_path, is_package_installed from transformer_engine.common import _get_sys_extension +_logger = logging.getLogger(__name__) + def _load_library(): """Load shared library with Transformer Engine C extensions""" @@ -40,7 +42,7 @@ def _load_library(): if is_package_installed("transformer-engine-cu12"): if not is_package_installed(module_name): - logging.info( + _logger.info( "Could not find package %s. Install transformer-engine using 'pip" " install transformer-engine[pytorch]==VERSION'", module_name, diff --git a/transformer_engine/pytorch/attention.py b/transformer_engine/pytorch/attention.py index be0d176520..b336331dad 100644 --- a/transformer_engine/pytorch/attention.py +++ b/transformer_engine/pytorch/attention.py @@ -97,7 +97,7 @@ _formatter = logging.Formatter("[%(levelname)-8s | %(name)-19s]: %(message)s") _stream_handler = logging.StreamHandler() _stream_handler.setFormatter(_formatter) -fa_logger = logging.getLogger() +fa_logger = logging.getLogger(__name__) fa_logger.setLevel(_log_level) if not fa_logger.hasHandlers(): fa_logger.addHandler(_stream_handler)