Skip to content

Commit 592bcb4

Browse files
authored
remove coloredlogs (#27135)
See related issues: #26889
1 parent 6861526 commit 592bcb4

28 files changed

+44
-60
lines changed

dockerfiles/Dockerfile.source

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ RUN cd /code && /bin/bash ./build.sh --allow_running_as_root --skip_submodule_sy
1616
FROM mcr.microsoft.com/azurelinux/base/python:3
1717
COPY --from=0 /code/build/Linux/Release/dist /root
1818
COPY --from=0 /code/dockerfiles/LICENSE-IMAGE.txt /code/LICENSE-IMAGE.txt
19-
RUN tdnf install -y ca-certificates python3-setuptools python3-wheel python3-pip python3-numpy python3-flatbuffers python3-packaging python3-protobuf python3-mpmath python3-sympy && python3 -m pip install coloredlogs humanfriendly && python3 -m pip install --no-index --find-links /root onnxruntime && rm -rf /root/*.whl
19+
RUN tdnf install -y ca-certificates python3-setuptools python3-wheel python3-pip python3-numpy python3-flatbuffers python3-packaging python3-protobuf python3-mpmath python3-sympy && python3 -m pip install humanfriendly && python3 -m pip install --no-index --find-links /root onnxruntime && rm -rf /root/*.whl

docs/python/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ furo
1111
pyquickhelper
1212
pandas
1313
pydot
14-
coloredlogs
1514
flatbuffers
1615
numpy<2.0.0
1716
packaging

onnxruntime/python/tools/tensorrt/perf/benchmark.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import timeit
1313
from datetime import datetime
1414

15-
import coloredlogs
1615
import numpy as np
1716
from perf_utils import (
1817
acl,
@@ -2259,12 +2258,13 @@ def parse_arguments():
22592258

22602259
def setup_logger(verbose):
22612260
if verbose:
2262-
coloredlogs.install(
2263-
level="DEBUG",
2264-
fmt="[%(filename)s:%(lineno)s - %(funcName)20s()] %(message)s",
2261+
logging.basicConfig(
2262+
level=logging.DEBUG,
2263+
format="[%(filename)s:%(lineno)s - %(funcName)20s()] %(message)s",
2264+
force=True,
22652265
)
22662266
else:
2267-
coloredlogs.install(fmt="%(message)s")
2267+
logging.basicConfig(format="%(message)s", force=True)
22682268
logging.getLogger("transformers").setLevel(logging.WARNING)
22692269

22702270

onnxruntime/python/tools/tensorrt/perf/benchmark_wrapper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import pprint
1212
import re
1313

14-
import coloredlogs # noqa: F401
1514
from benchmark import * # noqa: F403
1615
from perf_utils import * # noqa: F403
1716

onnxruntime/python/tools/tensorrt/perf/perf_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import subprocess
66
import sys
77

8-
import coloredlogs # noqa: F401
9-
108
debug = False
119
debug_verbose = False
1210

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
onnxconverter-common
22
onnxmltools
33
pandas
4-
coloredlogs

onnxruntime/python/tools/transformers/benchmark_helper.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from time import sleep
1919
from typing import Any
2020

21-
import coloredlogs
2221
import numpy
2322
import torch
2423
import transformers
@@ -147,12 +146,12 @@ def create_onnxruntime_session(
147146

148147
def setup_logger(verbose=True):
149148
if verbose:
150-
coloredlogs.install(
151-
level="DEBUG",
152-
fmt="[%(filename)s:%(lineno)s - %(funcName)20s()] %(message)s",
149+
logging.basicConfig(
150+
format="[%(filename)s:%(lineno)s - %(funcName)20s()] %(message)s",
151+
level=logging.DEBUG,
153152
)
154153
else:
155-
coloredlogs.install(fmt="%(message)s")
154+
logging.basicConfig(format="%(message)s", level=logging.INFO)
156155
logging.getLogger("transformers").setLevel(logging.WARNING)
157156

158157

onnxruntime/python/tools/transformers/convert_to_packing_mode.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import logging
88
import os
99

10-
import coloredlogs
1110
from constants import (
1211
AttentionInputIDs,
1312
AttentionOutputIDs,
@@ -358,12 +357,12 @@ def _parse_arguments():
358357

359358
def _setup_logger(verbose):
360359
if verbose:
361-
coloredlogs.install(
362-
level="DEBUG",
363-
fmt="[%(filename)s:%(lineno)s - %(funcName)20s()] %(message)s",
360+
logging.basicConfig(
361+
format="[%(filename)s:%(lineno)s - %(funcName)20s()] %(message)s",
362+
level=logging.DEBUG,
364363
)
365364
else:
366-
coloredlogs.install(fmt="%(funcName)20s: %(message)s")
365+
logging.basicConfig(format="%(funcName)20s: %(message)s", level=logging.INFO)
367366

368367

369368
def main():

onnxruntime/python/tools/transformers/models/longformer/benchmark_longformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# conda create -n gpu_env python=3.8
1212
# conda activate gpu_env
1313
# pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
14-
# pip3 install onnx transformers onnxruntime-gpu numpy sympy coloredlogs psutil py3nvml
14+
# pip3 install onnx transformers onnxruntime-gpu numpy sympy psutil py3nvml
1515
# python benchmark_longformer.py
1616
#
1717
# When there is no parameter, pre-defined tests will run on the longformer-base-4096 model.

onnxruntime/python/tools/transformers/models/longformer/convert_to_onnx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# conda create -n longformer python=3.8
1919
# conda activate longformer
2020
# python3 -m pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
21-
# python3 -m pip install coloredlogs flatbuffers numpy packaging sympy protobuf==3.20.1 onnx==1.12.0 transformers==4.18.0
21+
# python3 -m pip install flatbuffers numpy packaging sympy protobuf==3.20.1 onnx==1.12.0 transformers==4.18.0
2222
# python3 -m pip install -i https://test.pypi.org/simple/ ort-nightly-gpu
2323
# cd ./torch_extensions
2424
# rm -rf build

0 commit comments

Comments
 (0)