remoteable¶
remoteable
¶
RemoteableMixin
¶
RemoteableMixin(*args, dispatch: bool = False, meta_buffers: bool = True, rename: Optional[Dict[str, str]] = None, **kwargs)
Bases: MetaMixin
Mixin that adds remote execution support via NDIF.
Extends :class:MetaMixin with remote and backend
parameters on :meth:trace and :meth:session, enabling
interventions to be serialized and executed on remote
infrastructure.
Subclasses must implement :meth:_remoteable_model_key (returns a
string identifying the model for the remote server) and
:meth:_remoteable_from_model_key (reconstructs the wrapper from
that key on the server side).
trace
¶
trace(*inputs: Any, backend: Union[Backend, str, None] = None, remote: Union[bool, str] = False, blocking: bool = True, **kwargs: Dict[str, Any])
Open a tracing context for a single forward pass.
Extends the base :meth:trace with remote execution options.
| PARAMETER | DESCRIPTION |
|---|---|
*inputs
|
Model inputs (strings, tensors, etc.).
TYPE:
|
backend
|
Explicit backend
instance or a URL string for a :class:
TYPE:
|
remote
|
TYPE:
|
blocking
|
If
TYPE:
|
**kwargs
|
Forwarded to the underlying trace.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
|
A tracing context manager. |
session
¶
session(*inputs: Any, backend: Union[Backend, str, None] = None, remote: bool = False, blocking: bool = True, **kwargs: Dict[str, Any])
Open a session context grouping multiple traces.
| PARAMETER | DESCRIPTION |
|---|---|
*inputs
|
Inputs forwarded to the underlying session.
TYPE:
|
backend
|
Explicit backend
instance or a URL string for a :class:
TYPE:
|
remote
|
If
TYPE:
|
blocking
|
If
TYPE:
|
**kwargs
|
Forwarded to the underlying session.
TYPE:
|
to_model_key
¶
Build a fully-qualified model key including the class import path.
The key has the form "import.path.ClassName:model_specific_key"
and is used by NDIF to locate and reconstruct the model on the server.
from_model_key
classmethod
¶
Reconstruct a model wrapper from a fully-qualified model key.
Parses the import path, imports the correct class, and delegates
to :meth:_remoteable_from_model_key.
| PARAMETER | DESCRIPTION |
|---|---|
model_key
|
Key in the form
TYPE:
|
**kwargs
|
Additional arguments forwarded to the class constructor.
DEFAULT:
|
StreamTracer
¶
Bases: Tracer
Tracer that serializes intervention code, sends it to a remote server, and injects results back into the caller's frame.
Used by :meth:RemoteTracer.local to enable hybrid local/remote
execution within a remote session.
RemoteTracer
¶
RemoteInterleavingTracer
¶
Bases: InterleavingTracer, RemoteTracer
Interleaving tracer with remote execution capabilities.
Combines :class:InterleavingTracer (thread-based interleaving) with
:class:RemoteTracer (remote/hybrid support) for use in
model.trace(remote=True).