Skip to content

Commit 3868f6e

Browse files
Add is_arm_cpu check
1 parent 23803a3 commit 3868f6e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

nncf/common/utils/cpu_info.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,26 @@
99
# See the License for the specific language governing permissions and
1010
# limitations under the License.
1111

12+
import platform
1213
import re
1314

1415
import cpuinfo # type: ignore
1516

17+
_IS_ARM_CPU = None
1618
_IS_LNL_CPU = None
1719

1820

21+
def is_arm_cpu() -> bool:
22+
global _IS_ARM_CPU
23+
if _IS_ARM_CPU is None:
24+
_IS_ARM_CPU = platform.processor().lower() == "arm"
25+
return _IS_ARM_CPU
26+
27+
1928
def is_lnl_cpu() -> bool:
2029
global _IS_LNL_CPU
2130
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
31+
_IS_LNL_CPU = (
32+
not is_arm_cpu() and re.search(r"Ultra \d 2\d{2}", cpuinfo.get_cpu_info()["brand_raw"]) is not None
33+
)
2334
return _IS_LNL_CPU

0 commit comments

Comments
 (0)