Skip to content

Fix macOS benchmarks#1

Merged
afonsoarriaga merged 1 commit intoafonsoarriaga:mainfrom
rozbb:fix-mac-bench
Apr 5, 2026
Merged

Fix macOS benchmarks#1
afonsoarriaga merged 1 commit intoafonsoarriaga:mainfrom
rozbb:fix-mac-bench

Conversation

@rozbb
Copy link
Copy Markdown
Contributor

@rozbb rozbb commented Apr 3, 2026

I get an error when running sudo python3 main_count_cycles_mac_m1.py:

Traceback (most recent call last):
  File "projects/ProjectTempo/main_count_cycles_mac_m1.py", line 473, in <module>
    main()
    ~~~~^^
  File "projects/ProjectTempo/main_count_cycles_mac_m1.py", line 434, in main
    avg, rsd = bench_gen_matrix(gen_matrix, k)
               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "projects/ProjectTempo/main_count_cycles_mac_m1.py", line 308, in bench_gen_matrix
    start = read_cycles()
  File "projects/ProjectTempo/main_count_cycles_mac_m1.py", line 102, in read_cycles
    fixed = read_fixed()
  File "projects/ProjectTempo/main_count_cycles_mac_m1.py", line 96, in read_fixed
    raise OSError("kpc_get_thread_counters failed")
OSError: kpc_get_thread_counters failed

I think this is because the benchmark is missing a kperf init line. This PR adds that line and fixes the benches on my MBP Air M1.

@afonsoarriaga
Copy link
Copy Markdown
Owner

Thank you, @rozbb! I must have removed that line during a cleanup, and it went unnoticed since I don't reboot my laptop very often.

@afonsoarriaga afonsoarriaga merged commit fee5db6 into afonsoarriaga:main Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants