Skip to content

Many DynamicsRunner agents#78

Draft
miketynes wants to merge 7 commits intomainfrom
agentmaxxing
Draft

Many DynamicsRunner agents#78
miketynes wants to merge 7 commits intomainfrom
agentmaxxing

Conversation

@miketynes
Copy link
Collaborator

Refactor so that we have one DynamicsRunner agent per trajectory. The DynamicsRunner agent owns the state for that trajectory. It will pass this around as needed as metadata to other agents. This will greatly reduce the need for agents to share state information and simplify the code, making scalable distributed runs more accessible.

@miketynes miketynes requested a review from WardLT February 9, 2026 19:56
Copy link
Member

@WardLT WardLT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll need that event to block/unlock the runner due to weights.

Another thing you'd want are tests. Might as well start testing these agents in isolation now using a faked Auditor that'll pass whichever signal you tell it to (I can show you an example)

# await self.queue.put(spec)

@action
async def receive_weights(self, weights: bytes) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might suggest having "receive weights" also receive a version number, in the off chance a worker somehow misses a version (no idea how, but remain paranoid about messages dropping).

You could also store a hash of the weights if you feel really fancy.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this is a good idea

self.attempt += 1
# wait for new weights
# not sure how best to do this
# await_event_async from academy?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do an event. It'll take a few parts:

  • Each have its own weights_updated Event as an attribute
  • This loop will clear the event if an audit fails and then await it being set
  • The receive_weights function sets the Event whenever it finishes updating the model weights.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

easy, i can implement this pattern before we meet

Copy link
Member

@WardLT WardLT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems right to me. We'll talk tests today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants