Skip to content

Commit 8fadd5c

Browse files
Use openvino instead of cpu_info to get CPU full name
1 parent 23803a3 commit 8fadd5c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

nncf/common/utils/cpu_info.py nncf/openvino/cpu_info.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111

1212
import re
1313

14-
import cpuinfo # type: ignore
14+
import openvino as ov
1515

1616
_IS_LNL_CPU = None
1717

1818

1919
def is_lnl_cpu() -> bool:
2020
global _IS_LNL_CPU
2121
if _IS_LNL_CPU is None:
22-
_IS_LNL_CPU = re.search(r"Ultra \d 2\d{2}", cpuinfo.get_cpu_info()["brand_raw"]) is not None
22+
cpu_name = ov.Core().get_property("CPU", ov.properties.device.full_name)
23+
_IS_LNL_CPU = re.search(r"Ultra \d 2\d{2}", cpu_name) is not None
2324
return _IS_LNL_CPU

nncf/openvino/optimized_functions/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
from nncf.common.utils.backend import is_openvino_at_least
2626
from nncf.common.utils.caching import ResultsCache
2727
from nncf.common.utils.caching import cache_results
28-
from nncf.common.utils.cpu_info import is_lnl_cpu
2928
from nncf.common.utils.helpers import set_env_variable
29+
from nncf.openvino.cpu_info import is_lnl_cpu
3030
from nncf.openvino.graph.node_utils import convert_op
3131
from nncf.openvino.graph.node_utils import non_convertable_divide_op
3232
from nncf.quantization.algorithms.weight_compression.config import WeightCompressionConfig

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ dependencies = [
4343
"packaging>=20.0",
4444
"pandas>=1.1.5,<2.3",
4545
"psutil",
46-
"py-cpuinfo>=9.0.0",
4746
"pydot>=1.4.1, <=3.0.4",
4847
"pymoo>=0.6.0.1",
4948
"rich>=13.5.2",

0 commit comments

Comments
 (0)