pytorch-benchmark icon indicating copy to clipboard operation
pytorch-benchmark copied to clipboard

Benchmarking fails on M1

Open mikasenghaas opened this issue 1 year ago • 0 comments

Hi, firstly, thanks for the great repository! I wanted to use it to benchmark various image and video classifiers for my bachelor project, but ran into problems when running benchmark. The psutil.cpu_freq() call in get_machine_info fails because of a file missing on M1 Macs. It is a known, but (as far as I can tell) unsolved issue of the psutil (tested with almost latest version v5.9.4 repository (see this Issue)

As a quick and dirty fix I just hard-coded the maximum clock speed of my local machine, but it might be nice to find a programmatic cross-platform solution.

Reproducing the error in psutil dependency in Interactive Shell:

Python 3.10.10 (main, Mar 24 2023, 13:29:49) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.__version__
'5.9.4'
>>> psutil.cpu_freq()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jonas-mika/itu/bsc/.venv/lib/python3.10/site-packages/psutil/__init__.py", line 1864, in cpu_freq
    ret = _psplatform.cpu_freq()
  File "/Users/jonas-mika/itu/bsc/.venv/lib/python3.10/site-packages/psutil/_psosx.py", line 179, in cpu_freq
    curr, min_, max_ = cext.cpu_freq()
FileNotFoundError: [Errno 2] No such file or directory (originated from sysctl(HW_CPU_FREQ))

mikasenghaas avatar Apr 24 '23 08:04 mikasenghaas