pub enum ControllerMessage {
Attach {
client_actor: ActorRef<ClientActor>,
response_port: OncePortRef<()>,
},
Node {
seq: Seq,
defs: Vec<Ref>,
uses: Vec<Ref>,
},
DropRefs {
refs: Vec<Ref>,
},
Send {
ranks: Ranks,
message: Serialized,
},
RemoteFunctionFailed {
seq: Seq,
error: WorkerError,
},
Status {
seq: Seq,
worker_actor_id: ActorId,
controller: bool,
},
FetchResult {
seq: Seq,
value: Result<Serialized, WorkerError>,
},
GetFirstIncompleteSeqsUnitTestsOnly {
response_port: OncePortRef<Vec<Seq>>,
},
CheckSupervision {},
DebuggerMessage {
debugger_actor_id: ActorId,
action: DebuggerAction,
},
}Expand description
Controller messages. These define the contract that the controller has with the client and workers.
Variants§
Attach
Attach a client to the controller. This is used to send messages to the controller and allow the controller to send messages back to the client.
Fields
client_actor: ActorRef<ClientActor>The client actor that is being attached.
response_port: OncePortRef<()>The response to indicate if the client was successfully attached.
Node
Notify the controller of the dependencies for a worker operation with the same seq. It is the responsibility of the caller to ensure the seq is unique and strictly increasing and matches the right message. This will be used by the controller for history / data dependency tracking. TODO: Support mutates here as well for proper dep management
Fields
DropRefs
Send
Send a message to the workers mapping to the ranks provided in the
given slice. The message is serialized bytes with the underlying datatype being
crate::worker::WorkerMessage and serialization has been done in a hyperactor
compatible way i.e. using [bincode]. These bytes will be forwarded to
the workers as is. This helps provide isolation between the controller and the
workers and avoids the need to pay the cost to deserialize pytrees in the controller.
RemoteFunctionFailed
Response to a crate::worker::WorkerMessage::CallFunction message if
the function errored.
Status
Response to a crate::worker::WorkerMessage::RequestStatus message. The payload will
be set to the seq provided in the original message + 1.
FetchResult
Response to a crate::worker::WorkerMessage::SendValue message, containing the
requested value. The value is serialized as a Serialized and deserialization
is the responsibility of the caller. It should be deserialized as
monarch_types::PyTree<RValue> using the Serialized::deserialized method.
GetFirstIncompleteSeqsUnitTestsOnly
This is used in unit tests to get the first incomplete seq for each rank as captured by the controller.
Fields
response_port: OncePortRef<Vec<Seq>>CheckSupervision
The message to schedule next supervision check task on the controller.
DebuggerMessage
Debugger message sent from a debugger to be forwarded back to the client.
Trait Implementations§
Source§impl Debug for ControllerMessage
impl Debug for ControllerMessage
Source§impl<'de> Deserialize<'de> for ControllerMessage
impl<'de> Deserialize<'de> for ControllerMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Named for ControllerMessage
impl Named for ControllerMessage
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn arm(&self) -> Option<&'static str>
fn arm(&self) -> Option<&'static str>
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
Source§impl Serialize for ControllerMessage
impl Serialize for ControllerMessage
impl RemoteHandles<ControllerMessage> for ControllerActor
Auto Trait Implementations§
impl !Freeze for ControllerMessage
impl RefUnwindSafe for ControllerMessage
impl Send for ControllerMessage
impl Sync for ControllerMessage
impl Unpin for ControllerMessage
impl UnwindSafe for ControllerMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more