Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9054793
move prettytable into inc.common
xin3he Jun 24, 2024
fd510db
add benchmark
xin3he Jun 25, 2024
29f974c
support windows
xin3he Jun 26, 2024
dabe436
fix bug
xin3he Jun 26, 2024
4f7cb7c
enable subprocess running
xin3he Jun 26, 2024
4a3b6cd
fix bug in windows
xin3he Jun 26, 2024
3cc3885
enhance log
xin3he Jun 26, 2024
b3c1091
add document
xin3he Jun 26, 2024
ca1f3b6
update platform status
xin3he Jun 26, 2024
29ebf1a
add incbench dlrm example
xin3he Jun 27, 2024
5960bb7
add more docstring
xin3he Jun 27, 2024
4c15bda
add performance test for sq opt-125m
xin3he Jun 28, 2024
60340f2
enhance pre-commit for max-line-length check
xin3he Jun 28, 2024
5f02407
add Multiple Instance Benchmark Summary
xin3he Jun 28, 2024
cc014af
Dump Throughput and Latency Summary
xin3he Jun 28, 2024
c3de633
change log folder and add UTs
xin3he Jul 1, 2024
9757779
add requirement
xin3he Jul 1, 2024
6ca810f
Merge branch 'master' into xinhe/benchmark
xin3he Jul 2, 2024
8549e92
improve UT coverage
xin3he Jul 3, 2024
0f6e057
fix pylint
xin3he Jul 3, 2024
7f3aff5
remove previous useless code
xin3he Jul 8, 2024
eeb56f6
fix bug
xin3he Jul 8, 2024
24ec333
fix pylint
xin3he Jul 8, 2024
18ca594
fix bug
xin3he Jul 8, 2024
b55b22b
Merge branch 'master' into xinhe/benchmark
chensuyue Jul 9, 2024
a524d9c
update summary format per suyue's request
xin3he Jul 9, 2024
245c75a
fdsa
xin3he Jul 9, 2024
81687bd
revert pre-commit change
xin3he Jul 9, 2024
d681fc7
Merge branch 'master' into xinhe/benchmark
xin3he Jul 10, 2024
7e73d1a
update UT
xin3he Jul 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove previous useless code
Signed-off-by: xin3he <[email protected]>
  • Loading branch information
xin3he committed Jul 8, 2024
commit 7f3aff52c8443ee05dcd0960c39af5969f87534e
34 changes: 0 additions & 34 deletions neural_compressor/common/utils/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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.
Expand Down