Skip to content

Commit 80e3235

Browse files
committed
refactor: move logger initialization to the top of tensor_utils.py
Signed-off-by: jianjunzhong <jianjunzhong@foxmail.com>
1 parent d31bb52 commit 80e3235

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

verl/utils/tensor_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@
1313
# limitations under the License.
1414
"""Utility functions for tensor operations."""
1515

16+
import logging
17+
import os
1618
from dataclasses import dataclass
1719
from functools import reduce
1820

1921
import torch
2022

23+
logger = logging.getLogger(__file__)
24+
logger.setLevel(os.getenv("VERL_LOGGING_LEVEL", "INFO"))
25+
2126

2227
@dataclass
2328
class WeightChunkInfo:
@@ -58,9 +63,6 @@ def compute_weight_chunks(
5863
Raises:
5964
ValueError: If a single slice is larger than bucket_size.
6065
"""
61-
import logging
62-
63-
logger = logging.getLogger(__name__)
6466

6567
weight_size = weight.nbytes
6668
if weight_size <= bucket_size:

0 commit comments

Comments
 (0)