Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions docs/usage/competitive_runs.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,6 @@ limiting the maximum amount of memory per worker.

In our case, this completely avoided any instances of running OOM.

However, OOM situations can potentially lock you out of the server, so
you might want to use a script like the following as a second layer
defense to kill any process that hogs too much memory (note that this will affect _any_ script and not just swe-agent):

<details>
<summary>Memory sentinel</summary>

```python
--8<-- "docs/usage/memory_sentinel.py"
```

</details>

If swe-agent dies or you frequently abort it, you might have leftover docker containers
(they are cleaned up by normal termination of swe-agent but can be left over if it is killed).
You can use a sentinel script like the following to clean them up periodically
(note that this will affect _any_ long running container and not just those from swe-agent):

<details>
<summary>Container sentinel</summary>

```bash
--8<-- "docs/usage/containers_sentinel.sh"
```
</details>

## Tradeoffs between resolution rate and cost

* Running multi-attempt configurations will always be _very_ expensive. Don't use them if cost is of importance.
Expand Down
22 changes: 0 additions & 22 deletions docs/usage/containers_sentinel.sh

This file was deleted.

140 changes: 0 additions & 140 deletions docs/usage/memory_sentinel.py

This file was deleted.

135 changes: 0 additions & 135 deletions evaluation/run_evaluation.py

This file was deleted.

21 changes: 2 additions & 19 deletions phoenix/adaptive_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,10 @@ def __init__(self, initial=12, maximum=30, minimum=4):
self.low_since = None
self.high_since = None
self.last_change = None
self.last_failure = None
self.last = None
self.reason = 'initial_limit'
self.last_request_id = None

def apply_request(self, request, wall_time):
if not request or request.get('id') == self.last_request_id or request.get('expires_at', 0) < wall_time:
return False
target = request.get('total')
if type(target) is not int or not self.minimum <= target <= self.maximum:
return False
self.limit = target
self.last_request_id = request['id']
self.last_change = None
self.reason = 'user_capacity_probe'
return True

def update(self, metrics, now, active, infrastructure_failure=False):
if infrastructure_failure:
self.last_failure = now
def update(self, metrics, now, active):
if metrics is None:
return self.settings()
self.last = metrics
Expand All @@ -91,7 +75,6 @@ def update(self, metrics, now, active, infrastructure_failure=False):
self.low_since = None
elif (low and self.low_since is not None and now - self.low_since >= 600
and (self.last_change is None or now - self.last_change >= 600)
and (self.last_failure is None or now - self.last_failure >= 600)
and active >= self.limit - 1 and self.limit < self.maximum):
self.limit = min(self.maximum, self.limit + 2)
self.last_change = now
Expand All @@ -105,6 +88,6 @@ def settings(self, high=False):
'environment_start_concurrency': 1 if high else 2,
'local_command_concurrency': 2 if high else 4,
'pause_new_image_imports': high, 'reason': self.reason,
'last_request_id': self.last_request_id,
'last_request_id': None,
'sample': self.last, 'evaluation_enabled': False,
'running_workers_are_preserved': True, 'updated_at': time.time()}
7 changes: 3 additions & 4 deletions phoenix/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,12 @@ def run_task(task, settings, backend, key, candidates=None, summary_fn=summarize
for job in jobs:
stage = directory / job["stage"]
if job["kind"] == "summary":
summary = summary_fn(task, results, settings, stage, key, shared_budget=method in REPAIR_METHODS)
if method in REPAIR_METHODS:
used += 1
summary = summary_fn(task, results, settings, stage, key)
used += 1
continue
candidate = candidates[len(results)] if job["kind"] == "candidate" else None
allowance = job["allowance"]
if method in REPAIR_METHODS and job["kind"] == "final":
if job["kind"] == "final":
allowance = settings["max_steps"] - used
if allowance < 1:
raise RuntimeError("No generation budget remains for final PhoenixRepair")
Expand Down
Loading
Loading