Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong socket number retrieval for non-english system #1514

Merged
merged 2 commits into from
Jan 12, 2024

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
50 checks passed
@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
2 participants