Alex Cheema 7 months ago
parent
commit
41902f716f
2 changed files with 10 additions and 5 deletions
  1. 7 2
      .github/bench.py
  2. 3 3
      .github/workflows/bench_job.yml

+ 7 - 2
.github/bench.py

@@ -18,8 +18,13 @@ def check_system_state():
     # Add macOS-specific checks
     try:
         # Check powermetrics
-        power_metrics = subprocess.run(['sudo', 'powermetrics', '-n', '1', '-i', '1000', '--show-process-energy'], 
-                                    capture_output=True, text=True)
+        try:
+            power_metrics = subprocess.run(['powermetrics', '-n', '1', '-i', '1000', '--show-process-energy'], 
+                                      capture_output=True, text=True)
+        except:
+            # Try with sudo if direct access fails
+            power_metrics = subprocess.run(['sudo', 'powermetrics', '-n', '1', '-i', '1000', '--show-process-energy'], 
+                                      capture_output=True, text=True)
         print("\nPower Metrics:", power_metrics.stdout, flush=True)
         
         # Check thermal state

+ 3 - 3
.github/workflows/bench_job.yml

@@ -57,9 +57,9 @@ jobs:
           # Apply MLX optimizations
           ./configure_mlx.sh
           
-          # Disable CPU throttling
-          sudo pmset -a processorperf 2
-          sudo pmset -a gpuswitch 2
+          # Disable CPU throttling (correct syntax for M-series Macs)
+          sudo pmset -a powermode 0 2>/dev/null || echo "Failed to set power mode"
+          sudo pmset -a gpuswitch 2 2>/dev/null || echo "Failed to set GPU mode"
           
           # Check current state
           pmset -g