weco 0.2.6__py3-none-any.whl → 0.2.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- weco/__init__.py +1 -1
- weco/cli.py +5 -2
- weco/panels.py +4 -4
- {weco-0.2.6.dist-info → weco-0.2.7.dist-info}/METADATA +63 -9
- weco-0.2.7.dist-info/RECORD +11 -0
- weco-0.2.6.dist-info/RECORD +0 -11
- {weco-0.2.6.dist-info → weco-0.2.7.dist-info}/WHEEL +0 -0
- {weco-0.2.6.dist-info → weco-0.2.7.dist-info}/entry_points.txt +0 -0
- {weco-0.2.6.dist-info → weco-0.2.7.dist-info}/licenses/LICENSE +0 -0
- {weco-0.2.6.dist-info → weco-0.2.7.dist-info}/top_level.txt +0 -0
weco/__init__.py
CHANGED
weco/cli.py
CHANGED
|
@@ -50,6 +50,7 @@ def main() -> None:
|
|
|
50
50
|
)
|
|
51
51
|
parser.add_argument("--steps", type=int, required=True, help="Number of steps to run")
|
|
52
52
|
parser.add_argument("--model", type=str, required=True, help="Model to use for optimization")
|
|
53
|
+
parser.add_argument("--log-dir", type=str, default=".runs", help="Directory to store logs and results")
|
|
53
54
|
parser.add_argument(
|
|
54
55
|
"--additional-instructions",
|
|
55
56
|
default=None,
|
|
@@ -83,7 +84,9 @@ def main() -> None:
|
|
|
83
84
|
timeout = 800
|
|
84
85
|
|
|
85
86
|
# Initialize panels
|
|
86
|
-
summary_panel = SummaryPanel(
|
|
87
|
+
summary_panel = SummaryPanel(
|
|
88
|
+
maximize=maximize, metric_name=metric_name, total_steps=steps, model=args.model, runs_dir=args.log_dir
|
|
89
|
+
)
|
|
87
90
|
plan_panel = PlanPanel()
|
|
88
91
|
solution_panels = SolutionPanels(metric_name=metric_name)
|
|
89
92
|
eval_output_panel = EvaluationOutputPanel()
|
|
@@ -112,7 +115,7 @@ def main() -> None:
|
|
|
112
115
|
with Live(layout, refresh_per_second=refresh_rate, screen=True) as live:
|
|
113
116
|
# Define the runs directory (.runs/<session-id>)
|
|
114
117
|
session_id = session_response["session_id"]
|
|
115
|
-
runs_dir = pathlib.Path(
|
|
118
|
+
runs_dir = pathlib.Path(args.log_dir) / session_id
|
|
116
119
|
runs_dir.mkdir(parents=True, exist_ok=True)
|
|
117
120
|
|
|
118
121
|
# Save the original code (.runs/<session-id>/original.py)
|
weco/panels.py
CHANGED
|
@@ -11,7 +11,7 @@ from .utils import format_number
|
|
|
11
11
|
class SummaryPanel:
|
|
12
12
|
"""Holds a summary of the optimization session."""
|
|
13
13
|
|
|
14
|
-
def __init__(self, maximize: bool, metric_name: str, total_steps: int, model: str, session_id: str = None):
|
|
14
|
+
def __init__(self, maximize: bool, metric_name: str, total_steps: int, model: str, runs_dir: str, session_id: str = None):
|
|
15
15
|
self.maximize = maximize
|
|
16
16
|
self.metric_name = metric_name
|
|
17
17
|
self.goal = ("Maximizing" if self.maximize else "Minimizing") + f" {self.metric_name}..."
|
|
@@ -19,7 +19,8 @@ class SummaryPanel:
|
|
|
19
19
|
self.total_output_tokens = 0
|
|
20
20
|
self.total_steps = total_steps
|
|
21
21
|
self.model = model
|
|
22
|
-
self.
|
|
22
|
+
self.runs_dir = runs_dir
|
|
23
|
+
self.session_id = session_id if session_id is not None else "N/A"
|
|
23
24
|
self.progress = Progress(
|
|
24
25
|
TextColumn("[progress.description]{task.description}"),
|
|
25
26
|
BarColumn(bar_width=20),
|
|
@@ -55,8 +56,7 @@ class SummaryPanel:
|
|
|
55
56
|
summary_table.add_row(f"[bold cyan]Model:[/] {self.model}")
|
|
56
57
|
summary_table.add_row("")
|
|
57
58
|
# Log directory
|
|
58
|
-
|
|
59
|
-
summary_table.add_row(f"[bold cyan]Logs:[/] [blue underline]{runs_dir}[/]")
|
|
59
|
+
summary_table.add_row(f"[bold cyan]Logs:[/] [blue underline]{self.runs_dir}/{self.session_id}[/]")
|
|
60
60
|
summary_table.add_row("")
|
|
61
61
|
# Token counts
|
|
62
62
|
summary_table.add_row(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: weco
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.7
|
|
4
4
|
Summary: Documentation for `weco`, a CLI for using Weco AI's code optimizer.
|
|
5
5
|
Author-email: Weco AI Team <contact@weco.ai>
|
|
6
6
|
License: MIT
|
|
@@ -109,7 +109,7 @@ weco --source optimize.py \
|
|
|
109
109
|
--metric speedup \
|
|
110
110
|
--maximize true \
|
|
111
111
|
--steps 15 \
|
|
112
|
-
--model
|
|
112
|
+
--model gemini-2.5-pro-exp-03-25 \
|
|
113
113
|
--additional-instructions "Fuse operations in the forward method while ensuring the max float deviation remains small. Maintain the same format of the code."
|
|
114
114
|
```
|
|
115
115
|
|
|
@@ -127,7 +127,7 @@ weco --source optimize.py \
|
|
|
127
127
|
--metric speedup \
|
|
128
128
|
--maximize true \
|
|
129
129
|
--steps 30 \
|
|
130
|
-
--model
|
|
130
|
+
--model gemini-2.5-pro-exp-03-25 \
|
|
131
131
|
--additional-instructions examples.rst
|
|
132
132
|
```
|
|
133
133
|
|
|
@@ -144,7 +144,7 @@ Given how useful causal multihead self attention is to transformers, we've seen
|
|
|
144
144
|
--metric speedup \
|
|
145
145
|
--maximize true \
|
|
146
146
|
--steps 30 \
|
|
147
|
-
--model gemini-2.5-pro-
|
|
147
|
+
--model gemini-2.5-pro-exp-03-25 \
|
|
148
148
|
--additional-instructions "Use triton to optimize the code while ensuring a small max float diff. Maintain the same code format."
|
|
149
149
|
```
|
|
150
150
|
|
|
@@ -157,10 +157,52 @@ Given how useful causal multihead self attention is to transformers, we've seen
|
|
|
157
157
|
--metric speedup \
|
|
158
158
|
--maximize true \
|
|
159
159
|
--steps 30 \
|
|
160
|
-
--model gemini-2.5-pro-
|
|
160
|
+
--model gemini-2.5-pro-exp-03-25 \
|
|
161
161
|
--additional-instructions guide.md
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
+
**Example 4: Optimizing a Classification Model**
|
|
165
|
+
|
|
166
|
+
This example demonstrates optimizing a script for a Kaggle competition ([Spaceship Titanic](https://www.kaggle.com/competitions/spaceship-titanic/overview)) to improve classification accuracy. The additional instructions are provided via a separate file (`examples/spaceship-titanic/README.md`).
|
|
167
|
+
|
|
168
|
+
First, install the requirements for the example environment:
|
|
169
|
+
```bash
|
|
170
|
+
pip install -r examples/spaceship-titanic/requirements-test.txt
|
|
171
|
+
```
|
|
172
|
+
And run utility function once to prepare the dataset
|
|
173
|
+
```bash
|
|
174
|
+
python examples/spaceship-titanic/utils.py
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
You should see the following structure at `examples/spaceship-titanic`. You need to prepare the kaggle credentials for downloading the dataset.
|
|
178
|
+
```
|
|
179
|
+
.
|
|
180
|
+
├── baseline.py
|
|
181
|
+
├── evaluate.py
|
|
182
|
+
├── optimize.py
|
|
183
|
+
├── private
|
|
184
|
+
│ └── test.csv
|
|
185
|
+
├── public
|
|
186
|
+
│ ├── sample_submission.csv
|
|
187
|
+
│ ├── test.csv
|
|
188
|
+
│ └── train.csv
|
|
189
|
+
├── README.md
|
|
190
|
+
├── requirements-test.txt
|
|
191
|
+
└── utils.py
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Then, execute the optimization command:
|
|
195
|
+
```bash
|
|
196
|
+
weco --source examples/spaceship-titanic/optimize.py \
|
|
197
|
+
--eval-command "python examples/spaceship-titanic/optimize.py && python examples/spaceship-titanic/evaluate.py" \
|
|
198
|
+
--metric accuracy \
|
|
199
|
+
--maximize true \
|
|
200
|
+
--steps 10 \
|
|
201
|
+
--model gemini-2.5-pro-exp-03-25 \
|
|
202
|
+
--additional-instructions examples/spaceship-titanic/README.md
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
*The [baseline.py](examples/spaceship-titanic/baseline.py) is provided as a start point for optimization*
|
|
164
206
|
|
|
165
207
|
---
|
|
166
208
|
|
|
@@ -169,16 +211,28 @@ Given how useful causal multihead self attention is to transformers, we've seen
|
|
|
169
211
|
| Argument | Description | Required |
|
|
170
212
|
| :-------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
|
|
171
213
|
| `--source` | Path to the source code file that will be optimized (e.g., `optimize.py`). | Yes |
|
|
172
|
-
| `--eval-command` | Command to run for evaluating the code in `--source`. This command should print the target `--metric` and its value to the terminal (stdout/stderr). See note below.
|
|
173
|
-
| `--metric` | The name of the metric you want to optimize (e.g., 'accuracy', 'speedup', 'loss'). This metric name should match what's printed by your `--eval-command`.
|
|
214
|
+
| `--eval-command` | Command to run for evaluating the code in `--source`. This command should print the target `--metric` and its value to the terminal (stdout/stderr). See note below. | Yes |
|
|
215
|
+
| `--metric` | The name of the metric you want to optimize (e.g., 'accuracy', 'speedup', 'loss'). This metric name should match what's printed by your `--eval-command`. | Yes |
|
|
174
216
|
| `--maximize` | Whether to maximize (`true`) or minimize (`false`) the metric. | Yes |
|
|
175
217
|
| `--steps` | Number of optimization steps (LLM iterations) to run. | Yes |
|
|
176
|
-
| `--model` | Model identifier for the LLM to use (e.g., `gpt-4o`, `claude-3.5-sonnet`). Recommended models to try include `o3-mini`, `claude-3-haiku`, and `gemini-2.5-pro-exp-03-25
|
|
177
|
-
| `--additional-instructions` | (Optional) Natural language description of specific instructions OR path to a file containing detailed instructions to guide the LLM.
|
|
218
|
+
| `--model` | Model identifier for the LLM to use (e.g., `gpt-4o`, `claude-3.5-sonnet`). Recommended models to try include `o3-mini`, `claude-3-haiku`, and `gemini-2.5-pro-exp-03-25`.| Yes |
|
|
219
|
+
| `--additional-instructions` | (Optional) Natural language description of specific instructions OR path to a file containing detailed instructions to guide the LLM. | No |
|
|
220
|
+
| `--log-dir` | (Optional) Path to the directory to log intermediate steps and final optimization result. Defaults to `.runs/`. | No |
|
|
178
221
|
|
|
179
222
|
---
|
|
180
223
|
|
|
224
|
+
### Performance & Expectations
|
|
181
225
|
|
|
226
|
+
Weco, powered by the AIDE algorithm, optimizes code iteratively based on your evaluation results. Achieving significant improvements, especially on complex research-level tasks, often requires substantial exploration time.
|
|
227
|
+
|
|
228
|
+
The following plot from the independent [Research Engineering Benchmark (RE-Bench)](https://metr.org/AI_R_D_Evaluation_Report.pdf) report shows the performance of AIDE (the algorithm behind Weco) on challenging ML research engineering tasks over different time budgets.
|
|
229
|
+
<p align="center">
|
|
230
|
+
<img src="https://github.com/user-attachments/assets/ff0e471d-2f50-4e2d-b718-874862f533df" alt="RE-Bench Performance Across Time" width="60%"/>
|
|
231
|
+
</p>
|
|
232
|
+
|
|
233
|
+
As shown, AIDE demonstrates strong performance gains over time, surpassing lower human expert percentiles within hours and continuing to improve. This highlights the potential of evaluation-driven optimization but also indicates that reaching high levels of performance comparable to human experts on difficult benchmarks can take considerable time (tens of hours in this specific benchmark, corresponding to many `--steps` in the Weco CLI). Factor this into your planning when setting the number of `--steps` for your optimization runs.
|
|
234
|
+
|
|
235
|
+
---
|
|
182
236
|
|
|
183
237
|
### Important Note on Evaluation
|
|
184
238
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
weco/__init__.py,sha256=6ZYuD51wx6bytYdLFMvzihYrpBlSxiFbmuiEl0z_AFo,124
|
|
2
|
+
weco/api.py,sha256=8rIf2Fy3tN6GW7BG1CaggtfE9pW56I1erzwLCgawcVE,3511
|
|
3
|
+
weco/cli.py,sha256=h8FevpztBob7OziDTIKh4y9CSnehkHJp2ydts6V6DhM,17317
|
|
4
|
+
weco/panels.py,sha256=HHWmrnc2EJBJ8AEHb8mxlq30m-3q0j_4axc0r17sTnE,12349
|
|
5
|
+
weco/utils.py,sha256=hhIebUPnetFMfNSFfcsKVw1TSpeu_Zw3rBPPnxDie0U,3911
|
|
6
|
+
weco-0.2.7.dist-info/licenses/LICENSE,sha256=p_GQqJBvuZgkLNboYKyH-5dhpTDlKs2wq2TVM55WrWE,1065
|
|
7
|
+
weco-0.2.7.dist-info/METADATA,sha256=AlBfVky2jZ6C2MnB8k_WkSMyucTeTE1Ias3y3_4bVsE,14577
|
|
8
|
+
weco-0.2.7.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
9
|
+
weco-0.2.7.dist-info/entry_points.txt,sha256=ixJ2uClALbCpBvnIR6BXMNck8SHAab8eVkM9pIUowcs,39
|
|
10
|
+
weco-0.2.7.dist-info/top_level.txt,sha256=F0N7v6e2zBSlsorFv-arAq2yDxQbzX3KVO8GxYhPUeE,5
|
|
11
|
+
weco-0.2.7.dist-info/RECORD,,
|
weco-0.2.6.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
weco/__init__.py,sha256=a3RxrwZhsuinalG_NtT0maKLFXFbgmgXFahpFgcEtZQ,124
|
|
2
|
-
weco/api.py,sha256=8rIf2Fy3tN6GW7BG1CaggtfE9pW56I1erzwLCgawcVE,3511
|
|
3
|
-
weco/cli.py,sha256=6rGEm_L-WSkJIT-jgfFmf2i_DXkQn6ILhqYQlptLFew,17159
|
|
4
|
-
weco/panels.py,sha256=9gq5C43hgUmQgl6tW-f2dBbDjlsBKBatSaUVKeGm4Zw,12296
|
|
5
|
-
weco/utils.py,sha256=hhIebUPnetFMfNSFfcsKVw1TSpeu_Zw3rBPPnxDie0U,3911
|
|
6
|
-
weco-0.2.6.dist-info/licenses/LICENSE,sha256=p_GQqJBvuZgkLNboYKyH-5dhpTDlKs2wq2TVM55WrWE,1065
|
|
7
|
-
weco-0.2.6.dist-info/METADATA,sha256=Ih-nkHxq_SJKccYXoVHmxytElqG75BSU1DGAAC9ipkk,11581
|
|
8
|
-
weco-0.2.6.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
9
|
-
weco-0.2.6.dist-info/entry_points.txt,sha256=ixJ2uClALbCpBvnIR6BXMNck8SHAab8eVkM9pIUowcs,39
|
|
10
|
-
weco-0.2.6.dist-info/top_level.txt,sha256=F0N7v6e2zBSlsorFv-arAq2yDxQbzX3KVO8GxYhPUeE,5
|
|
11
|
-
weco-0.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|