pub struct KernelMigrator { /* private fields */ }Expand description
Migrator that uses checkpoints for kernel state transfer between GPUs.
This integrates the checkpoint infrastructure with the multi-GPU migration system to enable live migration of persistent kernels.
§Example
ⓘ
use ringkernel_core::multi_gpu::{KernelMigrator, MultiGpuBuilder};
let coordinator = MultiGpuBuilder::new().build();
let migrator = KernelMigrator::new(coordinator);
// Migrate kernel from GPU 0 to GPU 1
migrator.migrate_with_checkpoint(&kernel, &mut request).await?;Implementations§
Source§impl KernelMigrator
impl KernelMigrator
Sourcepub fn new(coordinator: Arc<MultiGpuCoordinator>) -> Self
pub fn new(coordinator: Arc<MultiGpuCoordinator>) -> Self
Create a new kernel migrator with default in-memory storage.
Sourcepub fn with_storage(
coordinator: Arc<MultiGpuCoordinator>,
storage: Arc<dyn CheckpointStorage>,
) -> Self
pub fn with_storage( coordinator: Arc<MultiGpuCoordinator>, storage: Arc<dyn CheckpointStorage>, ) -> Self
Create a migrator with custom checkpoint storage.
Sourcepub fn migrate_with_checkpoint<K: CheckpointableKernel>(
&self,
kernel: &K,
request: &mut MigrationRequest,
) -> Result<MigrationResult>
pub fn migrate_with_checkpoint<K: CheckpointableKernel>( &self, kernel: &K, request: &mut MigrationRequest, ) -> Result<MigrationResult>
Perform a complete migration using checkpoint-based state transfer.
Steps:
- Quiesce the source kernel (drain pending messages)
- Create checkpoint of kernel state
- Transfer checkpoint to target device
- Restore kernel on target device
- Update coordinator routing tables
Sourcepub fn coordinator(&self) -> &Arc<MultiGpuCoordinator>
pub fn coordinator(&self) -> &Arc<MultiGpuCoordinator>
Get a reference to the coordinator.
Sourcepub fn stats(&self) -> MigrationStatsSnapshot
pub fn stats(&self) -> MigrationStatsSnapshot
Get migration statistics snapshot.
Auto Trait Implementations§
impl !Freeze for KernelMigrator
impl !RefUnwindSafe for KernelMigrator
impl Send for KernelMigrator
impl Sync for KernelMigrator
impl Unpin for KernelMigrator
impl !UnwindSafe for KernelMigrator
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.