Skip to content

Commit

Permalink
More tolerant to crashes and failures
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Oct 13, 2024
1 parent d803cc4 commit f106574
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions pokemonred_puffer/sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,25 @@ def launch_sweep(
elif (
run["state"]
in [
# RunState.failed.value,
RunState.failed.value,
RunState.finished.value,
# RunState.crashed.value,
RunState.crashed.value,
]
and run["name"] not in finished
):
finished.add(run["name"])
summary_metrics = json.loads(run["summaryMetrics"])
obs_in = ObservationInParam(
input=json.loads(run["config"])["x"]["value"],
# TODO: try out other stats like required count
output=summary_metrics["environment/stats/event"],
cost=summary_metrics["performance/uptime"],
)
carbs.observe(obs_in)
if (
"environment/stats/event" in summary_metrics
and "performance/uptime" in summary_metrics
):
obs_in = ObservationInParam(
input=json.loads(run["config"])["x"]["value"],
# TODO: try out other stats like required count
output=summary_metrics["environment/stats/event"],
cost=summary_metrics["performance/uptime"],
)
carbs.observe(obs_in)
elif run["state"] == RunState.pending:
print(f"PENDING RUN FOUND {run['name']}")
sweep.print_status()
Expand Down

0 comments on commit f106574

Please sign in to comment.