Skip to content

Commit 8c6aaf6

Browse files
committed
i
1 parent f6f6ecd commit 8c6aaf6

File tree

3 files changed

+835
-10
lines changed

3 files changed

+835
-10
lines changed

examples/mlx_fine_tuning_kernels/config.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
# MLX Quantized LoRA Fusion Optimization Configuration
1+
# MLX Quantized LoRA Fusion Optimization Configuration - EVOLVED VERSION
22
# Target: Eliminate dequantization bottleneck in MLX-LM LoRA implementation
3+
#
4+
# EVOLUTION IMPROVEMENTS:
5+
# - Training iterations: 15 → 50 (better convergence)
6+
# - Trial count: 5 → 7 (improved statistics)
7+
# - Statistical significance: p < 0.05 → p < 0.1 (less strict)
8+
# - Starting from best evolved program (Generation 4) with advanced optimizations
39

4-
max_iterations: 20 # Keep existing proven count
10+
max_iterations: 20 # EVOLVED: Can increase to 30+ for continued evolution with improved setup
511
checkpoint_interval: 5
612
log_level: "INFO"
713

examples/mlx_fine_tuning_kernels/evaluator.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ def create_test_config(self, data_dir: str, adapter_dir: str, trial_seed: int) -
129129
"seed": trial_seed, # Unique seed per trial
130130
"num_layers": 3,
131131
"batch_size": 2,
132-
"iters": 15, # Sufficient iterations for meaningful measurement
132+
"iters": 50, # EVOLVED: Increased from 15 for better convergence and meaningful measurement
133133
"val_batches": 5,
134134
"learning_rate": 1e-4,
135-
"steps_per_report": 5,
135+
"steps_per_report": 10, # EVOLVED: Adjusted for longer training
136136
"steps_per_eval": 50,
137137
"adapter_path": adapter_dir,
138138
"save_every": 100,
@@ -196,11 +196,11 @@ def validate_kernel_application(self, model, expected_kernels_applied: bool) ->
196196

197197
return True
198198

199-
def compare_implementations(self, evolved_kernels: Dict, num_trials: int = 5) -> Dict[str, Any]:
199+
def compare_implementations(self, evolved_kernels: Dict, num_trials: int = 7) -> Dict[str, Any]:
200200
"""
201201
Robust comparison between baseline and evolved implementations.
202202
203-
Uses 5 trials for better statistical power and rigorous validation.
203+
EVOLVED: Uses 7 trials for improved statistical power and rigorous validation.
204204
"""
205205

206206
if not MLX_LM_AVAILABLE:
@@ -520,8 +520,8 @@ def assess_significance(baseline_vals, evolved_vals):
520520
return "identical"
521521

522522
t_stat = abs(b_mean - e_mean) / pooled_se
523-
# Rough significance assessment (t > 2 is approximately p < 0.05 for small samples)
524-
return "significant" if t_stat > 2.0 else "not_significant"
523+
# EVOLVED: Less strict significance assessment (t > 1.6 is approximately p < 0.1 for small samples)
524+
return "significant" if t_stat > 1.6 else "not_significant"
525525

526526
significance = {
527527
"memory": assess_significance(baseline_stats["memory_delta"], evolved_stats["memory_delta"]),
@@ -600,9 +600,9 @@ def evaluate(program_path: str) -> Dict[str, Any]:
600600
# Setup benchmark
601601
benchmark = QuantizedLoRABenchmark()
602602

603-
# Run robust comparison with 5 trials
603+
# EVOLVED: Run robust comparison with 7 trials for improved statistics
604604
comparison_results = benchmark.compare_implementations(
605-
evolved_kernels=evolved_kernels, num_trials=5
605+
evolved_kernels=evolved_kernels, num_trials=7
606606
)
607607

608608
if "error" in comparison_results:

0 commit comments

Comments
 (0)