Skip to content

Commit 35e6cdc

Browse files
committed
Update run_benchmarks.py
1 parent 753cb5b commit 35e6cdc

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

examples/mlx_metal_kernel_opt/run_benchmarks.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,20 @@ def run_optimized_benchmark(args, original_dir):
105105
"""
106106
try:
107107
# Import the optimized attention implementation
108-
best_program_path = os.path.join(original_dir, "best_program.py")
109-
108+
# First, try the OpenEvolve output directory (most likely location)
109+
best_program_path = os.path.join(original_dir, "openevolve_output", "best", "best_program.py")
110+
111+
# Fallback to root directory if not found in openevolve_output
112+
if not os.path.exists(best_program_path):
113+
best_program_path = os.path.join(original_dir, "best_program.py")
114+
110115
if not os.path.exists(best_program_path):
111-
print(f"❌ Error: Optimized program not found at {best_program_path}")
116+
print(f"❌ Error: Optimized program not found")
117+
print("Searched in the following locations:")
118+
print(f" 1. {os.path.join(original_dir, 'openevolve_output', 'best', 'best_program.py')}")
119+
print(f" 2. {os.path.join(original_dir, 'best_program.py')}")
112120
print("Please ensure OpenEvolve has generated an optimized solution")
113-
print("Expected path structure:")
114-
print(" ./openevolve_output/best/best_program.py")
121+
print("Expected path: ./openevolve_output/best/best_program.py")
115122
return None
116123

117124
print(f"📁 Loading optimized program from: {best_program_path}")

0 commit comments

Comments
 (0)