pub struct HotReloadManager { /* private fields */ }Expand description
Manager for kernel hot reload operations.
Provides seamless kernel code updates without stopping the system:
- Drain pending messages from kernel input queue
- Checkpoint kernel state (if preserving state)
- Compile/validate new kernel code
- Swap old kernel with new kernel
- Restore state to new kernel
- Resume processing
§Example
ⓘ
use ringkernel_core::multi_gpu::{HotReloadManager, HotReloadConfig, KernelCodeSource};
let manager = HotReloadManager::new(HotReloadConfig::default());
// Register a reloadable kernel
manager.register_kernel(&kernel_id, current_code);
// Request hot reload with new PTX
let new_code = KernelCodeSource::from_ptx(new_ptx, "my_kernel");
let request = manager.request_reload(&kernel_id, new_code).await?;
// Execute the reload
let result = manager.execute_reload(request, &mut kernel).await?;
println!("Reload completed in {:?}", result.total_duration);Implementations§
Source§impl HotReloadManager
impl HotReloadManager
Sourcepub fn new(config: HotReloadConfig) -> Arc<Self>
pub fn new(config: HotReloadConfig) -> Arc<Self>
Create a new hot reload manager.
Sourcepub fn with_defaults() -> Arc<Self>
pub fn with_defaults() -> Arc<Self>
Create with default configuration.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if hot reload is enabled.
Sourcepub fn register_kernel(&self, kernel_id: &KernelId, code: KernelCodeSource)
pub fn register_kernel(&self, kernel_id: &KernelId, code: KernelCodeSource)
Register a kernel for hot reload.
Sourcepub fn unregister_kernel(&self, kernel_id: &KernelId)
pub fn unregister_kernel(&self, kernel_id: &KernelId)
Unregister a kernel from hot reload.
Sourcepub fn get_current_version(&self, kernel_id: &KernelId) -> Option<u64>
pub fn get_current_version(&self, kernel_id: &KernelId) -> Option<u64>
Get current code version for a kernel.
Sourcepub fn get_current_code(&self, kernel_id: &KernelId) -> Option<KernelCodeSource>
pub fn get_current_code(&self, kernel_id: &KernelId) -> Option<KernelCodeSource>
Get current code for a kernel.
Sourcepub fn request_reload(
&self,
kernel_id: &KernelId,
new_code: KernelCodeSource,
) -> Result<HotReloadRequest>
pub fn request_reload( &self, kernel_id: &KernelId, new_code: KernelCodeSource, ) -> Result<HotReloadRequest>
Request a hot reload for a kernel.
Sourcepub fn execute_reload<K: CheckpointableKernel>(
&self,
request: &mut HotReloadRequest,
kernel: &K,
) -> Result<HotReloadResult>
pub fn execute_reload<K: CheckpointableKernel>( &self, request: &mut HotReloadRequest, kernel: &K, ) -> Result<HotReloadResult>
Execute a hot reload operation.
This performs the full reload sequence:
- Drain pending messages
- Checkpoint state (if enabled)
- Validate new code
- Swap kernels
- Restore state (if enabled)
Sourcepub fn rollback(&self, kernel_id: &KernelId) -> Result<()>
pub fn rollback(&self, kernel_id: &KernelId) -> Result<()>
Rollback to previous kernel version.
Sourcepub fn stats(&self) -> HotReloadStatsSnapshot
pub fn stats(&self) -> HotReloadStatsSnapshot
Get statistics snapshot.
Sourcepub fn list_kernels(&self) -> Vec<KernelId>
pub fn list_kernels(&self) -> Vec<KernelId>
List all registered kernels.
Sourcepub fn is_registered(&self, kernel_id: &KernelId) -> bool
pub fn is_registered(&self, kernel_id: &KernelId) -> bool
Check if a kernel is registered.
Sourcepub fn is_reload_in_progress(&self, kernel_id: &KernelId) -> bool
pub fn is_reload_in_progress(&self, kernel_id: &KernelId) -> bool
Check if a reload is in progress for a kernel.
Sourcepub fn config(&self) -> &HotReloadConfig
pub fn config(&self) -> &HotReloadConfig
Get the configuration.
Auto Trait Implementations§
impl !Freeze for HotReloadManager
impl !RefUnwindSafe for HotReloadManager
impl Send for HotReloadManager
impl Sync for HotReloadManager
impl Unpin for HotReloadManager
impl UnwindSafe for HotReloadManager
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.