Skip to content

Conversation

@Spycsh
Copy link
Contributor

@Spycsh Spycsh commented Jan 4, 2024

Type of Change

Fix intel/intel-extension-for-transformers#762

Description

lscpu | grep 'Socket(s)' | cut -d ':' -f 2 may not fetch correct Socket number on non-english system, because Socket(s) may be translated to different language, as shown in https://github.com/intel/intel-extension-for-transformers/issues/762#issuecomment-1873773702.

What we can do is an alternative cat /proc/cpuinfo | grep 'physical id' | sort -u | wc -l, which should be in pure English to fetch.

Expected Behavior & Potential Risk

As above.

How has this PR been tested?

Original UT will be enough.

Dependency Change?

None

@chensuyue chensuyue merged commit 5b2a887 into master Jan 12, 2024
@chensuyue chensuyue deleted the cpu_socket_fix branch January 12, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZeroDivisionError: division by zero

3 participants