diff --git a/neural_compressor/common/utils/utility.py b/neural_compressor/common/utils/utility.py index f4f222b8f48..35e511fcea0 100644 --- a/neural_compressor/common/utils/utility.py +++ b/neural_compressor/common/utils/utility.py @@ -113,14 +113,6 @@ def __init__(self): b"\xB8\x07\x00\x00\x00" b"\x0f\xa2" b"\xC3", # mov eax, 7 # cpuid # ret ) self._bf16 = bool(eax & (1 << 5)) - # TODO: The implementation will be refined in the future. - # https://github.com/intel/neural-compressor/tree/detect_sockets - if "arch" in info and "ARM" in info["arch"]: # pragma: no cover - self._sockets = 1 - else: - self._sockets = self.get_number_of_sockets() - self._cores = psutil.cpu_count(logical=False) - self._cores_per_socket = int(self._cores / self._sockets) @property def bf16(self): @@ -132,32 +124,6 @@ def vnni(self): """Get whether it is vnni.""" return self._vnni - @property - def cores_per_socket(self): - """Get the cores per socket.""" - return self._cores_per_socket - - def get_number_of_sockets(self) -> int: - """Get number of sockets in platform.""" - cmd = "cat /proc/cpuinfo | grep 'physical id' | sort -u | wc -l" - if psutil.WINDOWS: - cmd = r'wmic cpu get DeviceID | C:\Windows\System32\find.exe /C "CPU"' - elif psutil.MACOS: # pragma: no cover - cmd = "sysctl -n machdep.cpu.core_count" - - with subprocess.Popen( - args=cmd, - shell=True, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - universal_newlines=False, - ) as proc: - proc.wait() - if proc.stdout: - for line in proc.stdout: - return int(line.decode("utf-8", errors="ignore").strip()) - return 0 - def dump_elapsed_time(customized_msg=""): """Get the elapsed time for decorated functions.