verifiers 0.4.2.dev125__py3-none-any.whl → 0.4.2.dev126__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.
- verifiers/v1/agent.py +2 -0
- verifiers/v1/restore.py +21 -10
- {verifiers-0.4.2.dev125.dist-info → verifiers-0.4.2.dev126.dist-info}/METADATA +1 -1
- {verifiers-0.4.2.dev125.dist-info → verifiers-0.4.2.dev126.dist-info}/RECORD +7 -7
- {verifiers-0.4.2.dev125.dist-info → verifiers-0.4.2.dev126.dist-info}/WHEEL +0 -0
- {verifiers-0.4.2.dev125.dist-info → verifiers-0.4.2.dev126.dist-info}/entry_points.txt +0 -0
- {verifiers-0.4.2.dev125.dist-info → verifiers-0.4.2.dev126.dist-info}/licenses/LICENSE +0 -0
verifiers/v1/agent.py
CHANGED
|
@@ -816,6 +816,7 @@ class Agent:
|
|
|
816
816
|
collect_artifacts: bool = False,
|
|
817
817
|
on_score: Callable[[Trace, Runtime], Awaitable[None]] | None = None,
|
|
818
818
|
route: ModelRoute | None = None,
|
|
819
|
+
restore: dict[str, Any] | None = None,
|
|
819
820
|
) -> AgentRun:
|
|
820
821
|
"""Schedule a rollout and return the object used to steer it and await its trace."""
|
|
821
822
|
return AgentRun(
|
|
@@ -828,6 +829,7 @@ class Agent:
|
|
|
828
829
|
collect_artifacts=collect_artifacts,
|
|
829
830
|
on_score=on_score,
|
|
830
831
|
route=route,
|
|
832
|
+
restore=restore,
|
|
831
833
|
)
|
|
832
834
|
)
|
|
833
835
|
|
verifiers/v1/restore.py
CHANGED
|
@@ -19,6 +19,7 @@ import asyncio
|
|
|
19
19
|
import functools
|
|
20
20
|
import time
|
|
21
21
|
import weakref
|
|
22
|
+
from collections.abc import Collection
|
|
22
23
|
from contextvars import ContextVar
|
|
23
24
|
from typing import TYPE_CHECKING, Any
|
|
24
25
|
|
|
@@ -103,9 +104,16 @@ def unsaveable(config: AgentConfig, harness: Harness | None = None) -> str | Non
|
|
|
103
104
|
return None
|
|
104
105
|
|
|
105
106
|
|
|
106
|
-
def
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
def _live(trace_ids: Collection[str] | None = None) -> list[Rollout]:
|
|
108
|
+
if trace_ids is None:
|
|
109
|
+
return list(LIVE)
|
|
110
|
+
wanted = set(trace_ids)
|
|
111
|
+
return [rollout for rollout in list(LIVE) if rollout.trace.id in wanted]
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def release_all(trace_ids: Collection[str] | None = None) -> None:
|
|
115
|
+
"""Let every rollout (or only those in `trace_ids`) that `save_all(hold=True)` holds go on."""
|
|
116
|
+
for rollout in _live(trace_ids):
|
|
109
117
|
rollout.release()
|
|
110
118
|
|
|
111
119
|
|
|
@@ -115,8 +123,10 @@ async def save_all(
|
|
|
115
123
|
hold: bool = False,
|
|
116
124
|
watchdog: bool = True,
|
|
117
125
|
timeout: float | None = None,
|
|
126
|
+
trace_ids: Collection[str] | None = None,
|
|
118
127
|
) -> list[dict[str, Any]]:
|
|
119
|
-
"""Take a memory checkpoint of every running rollout of this process
|
|
128
|
+
"""Take a memory checkpoint of every running rollout of this process (or only those
|
|
129
|
+
in `trace_ids`) and return
|
|
120
130
|
their traces as saved (`restorable`). A rollout that takes no memory snapshots,
|
|
121
131
|
runs no harness segment right now, or whose snapshot fails has none: it starts
|
|
122
132
|
over when its owner runs it again. `skipped` collects why, as a count per reason.
|
|
@@ -143,7 +153,7 @@ async def save_all(
|
|
|
143
153
|
skipped[reason] = skipped.get(reason, 0) + 1
|
|
144
154
|
return point
|
|
145
155
|
|
|
146
|
-
rollouts =
|
|
156
|
+
rollouts = _live(trace_ids)
|
|
147
157
|
started = time.monotonic()
|
|
148
158
|
saves = [asyncio.ensure_future(save(rollout)) for rollout in rollouts]
|
|
149
159
|
try:
|
|
@@ -177,7 +187,7 @@ async def save_all(
|
|
|
177
187
|
time.monotonic() - started,
|
|
178
188
|
)
|
|
179
189
|
if hold and watchdog:
|
|
180
|
-
arm_hold_watchdogs()
|
|
190
|
+
arm_hold_watchdogs(trace_ids)
|
|
181
191
|
return points
|
|
182
192
|
|
|
183
193
|
|
|
@@ -186,8 +196,9 @@ def _disown_late(rollout: Rollout, task: asyncio.Future) -> None:
|
|
|
186
196
|
rollout.disown(point)
|
|
187
197
|
|
|
188
198
|
|
|
189
|
-
def arm_hold_watchdogs() -> None:
|
|
190
|
-
"""Start the self-release of every rollout
|
|
191
|
-
owner that does more work before it can
|
|
192
|
-
|
|
199
|
+
def arm_hold_watchdogs(trace_ids: Collection[str] | None = None) -> None:
|
|
200
|
+
"""Start the self-release of every rollout (or only those in `trace_ids`) a
|
|
201
|
+
`save_all(hold=True)` holds, for an owner that does more work before it can
|
|
202
|
+
`release_all`."""
|
|
203
|
+
for rollout in _live(trace_ids):
|
|
193
204
|
rollout.arm_hold_watchdog()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: verifiers
|
|
3
|
-
Version: 0.4.2.
|
|
3
|
+
Version: 0.4.2.dev126
|
|
4
4
|
Summary: Verifiers: Environments for LLM Reinforcement Learning
|
|
5
5
|
Project-URL: Homepage, https://github.com/primeintellect-ai/verifiers
|
|
6
6
|
Project-URL: Documentation, https://github.com/primeintellect-ai/verifiers
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
verifiers/__init__.py,sha256=F5IVMw6mhGaPBMCw7QKk0la_r5mMwydP2hdTTdQucik,352
|
|
2
2
|
verifiers/v1/__init__.py,sha256=VIKDoCrEqC6XP9EHKcZkrL29iBHRoge5j08yGap3jKc,19252
|
|
3
|
-
verifiers/v1/agent.py,sha256=
|
|
3
|
+
verifiers/v1/agent.py,sha256=cGiAACP0i1MK6NxOEFN0XPt8cC3TWKgY08fkOiR_XXY,62911
|
|
4
4
|
verifiers/v1/delta.py,sha256=ZdF-b7Qqpwg4WXrNyAO_VK82OEBFsQDOr_xkNWtQROs,12561
|
|
5
5
|
verifiers/v1/env.py,sha256=5F-LhPLAfVNwcco2TR-OOAnv0QtIj49X8pc_dSa-Hgk,20748
|
|
6
6
|
verifiers/v1/episode.py,sha256=Tqjo8aQDOh4sM03he2WMXzEhmn2ybzwwtUS_QSvESsA,6983
|
|
@@ -9,7 +9,7 @@ verifiers/v1/grading.py,sha256=OtZZv8P89CFSkUtu53rXIXuC6haC8KrmFp8E_3wCy_I,13364
|
|
|
9
9
|
verifiers/v1/graph.py,sha256=_IEMMdOJ7TAy2TM9H9LZBAeYCgV9-Uo8XtfTUdg_aBI,48582
|
|
10
10
|
verifiers/v1/harness.py,sha256=3jJjA_Td8f61jzN33J7h0Hk_hUCe_pqh_ePjH_EVg7c,19067
|
|
11
11
|
verifiers/v1/judge.py,sha256=T-TyYVcLGIoyUADYKy_pCBj2CTLhERlct5pmmWqPpTA,10507
|
|
12
|
-
verifiers/v1/restore.py,sha256=
|
|
12
|
+
verifiers/v1/restore.py,sha256=DA1Tcj0HZkUNOxrmMOJwR25WtCKdsZCTYBJZIf2RWUM,8861
|
|
13
13
|
verifiers/v1/rollout.py,sha256=freGbO3mYlkfv-m27WaSy4iORZL_N9VjDuUFkUBTqts,87684
|
|
14
14
|
verifiers/v1/semantic.py,sha256=nqKPPUoPL5Oh8Es_XjtcbDiQiIMKTYayXEm-EPB-jAE,5129
|
|
15
15
|
verifiers/v1/session.py,sha256=4O7JOFFoy2GvUOhJgWHn6FNwmpMv7tDflDA_0ffBS9k,52457
|
|
@@ -188,8 +188,8 @@ verifiers/v1/utils/scope.py,sha256=zbs4pj6AVk4jywlAJ3AX0Q0_kzB9dBB02nY-9H4ELdQ,8
|
|
|
188
188
|
verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
|
|
189
189
|
verifiers/v1/utils/trace_store.py,sha256=7F6xMhYgl3qmylnCU8-ekqswH16fUat1uegeM1OR9QQ,2563
|
|
190
190
|
verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
|
|
191
|
-
verifiers-0.4.2.
|
|
192
|
-
verifiers-0.4.2.
|
|
193
|
-
verifiers-0.4.2.
|
|
194
|
-
verifiers-0.4.2.
|
|
195
|
-
verifiers-0.4.2.
|
|
191
|
+
verifiers-0.4.2.dev126.dist-info/METADATA,sha256=zBxqnkrkaQrjWWxt30JJ5jp6OQU7hRHQ-LRS7oE7pn0,5118
|
|
192
|
+
verifiers-0.4.2.dev126.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
193
|
+
verifiers-0.4.2.dev126.dist-info/entry_points.txt,sha256=qdMg7ajiFpDsHf7tuPMRclJXizu1J6LTWawS5YS0B0I,137
|
|
194
|
+
verifiers-0.4.2.dev126.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
|
|
195
|
+
verifiers-0.4.2.dev126.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|