File size: 2,551 Bytes
aa677e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Quick Start: Run Tests & Generate Plots

## πŸš€ One Command to Run Everything

Since Docker is running, execute this **inside your Docker container**:

```bash
cd /workspace/edgeeda-agent
./run_all.sh
```

## πŸ“‹ Step-by-Step (If you prefer)

### 1. Enter Docker Container

If you're on the host machine:
```bash
cd /Users/thalia/Desktop/EdgePPAgent/edgeeda-agent
docker run --rm -it -v "$(pwd)":/workspace/edgeeda-agent -w /workspace/edgeeda-agent edgeeda-agent bash
```

Or if container is already running:
```bash
docker exec -it <CONTAINER_ID> bash
```

### 2. Run Tests
```bash
cd /workspace/edgeeda-agent
python3 run_tests_simple.py
```

### 3. Generate Plots
```bash
python3 generate_plots.py --db runs/experiment.sqlite --out runs/plots
```

### 4. View Results
```bash
# List generated files
ls -lh runs/plots/

# View test results (already shown in console)
# View plots (copy to host if needed)
```

## πŸ“Š Expected Output

### Tests:
```
Running agent tests...

βœ… RandomSearchAgent
βœ… SuccessiveHalvingAgent
βœ… SurrogateUCBAgent
βœ… Metrics Flattening
βœ… Metrics Coercion

==================================================
Results: 5/5 tests passed
βœ… All tests passed!
```

### Plots:
```
Loading data from runs/experiment.sqlite...
Found 11 trials
Successful: 3
With rewards: 0
Saved CSV to runs/plots/trials.csv
Generating plots...
  βœ“ Saved success_rate.png
  βœ“ Saved runtime_distribution.png
  βœ“ Saved return_code_distribution.png
  βœ“ Saved knob_PLACE_DENSITY.png
  βœ“ Saved knob_CORE_UTILIZATION.png

βœ… All plots generated in runs/plots
```

## πŸ“ Generated Files

After running, you'll have in `runs/plots/`:

- **trials.csv** - Complete trial data
- **success_rate.png** - Success rate over time
- **runtime_distribution.png** - Runtime histogram
- **return_code_distribution.png** - Error breakdown
- **knob_*.png** - Knob value analysis (one per knob)
- **learning_curve.png** - Best reward over time (if rewards exist)
- **area_vs_wns.png** - Pareto plot (if metrics exist)

## πŸ”§ Troubleshooting

**"Permission denied" on run_all.sh:**
```bash
chmod +x run_all.sh
```

**"No module named 'pandas'":**
- Make sure you're inside Docker container
- Run: `pip3 install -e .`

**"Database not found":**
- Check: `ls -la runs/experiment.sqlite`
- If missing, run experiments first: `edgeeda tune --config configs/gcd_nangate45.yaml --budget 5`

## πŸ’‘ Pro Tip

Copy plots to host machine:
```bash
# From host (replace CONTAINER_ID)
docker cp <CONTAINER_ID>:/workspace/edgeeda-agent/runs/plots ./runs/
```