pub struct FusedGPUState { /* private fields */ }Expand description
GPU memory layout optimized for kernel fusion.
Implementations§
Source§impl FusedGPUState
impl FusedGPUState
Sourcepub fn new(config: KernelFusionConfig) -> Self
pub fn new(config: KernelFusionConfig) -> Self
Creates a new fused GPU state.
Sourcepub fn allocate_parameter(&mut self, id: String, size: usize) -> Result<()>
pub fn allocate_parameter(&mut self, id: String, size: usize) -> Result<()>
Allocates a fused parameter buffer on GPU.
Sourcepub fn launch_fused_adam_kernel(
&mut self,
param_id: &str,
param: &mut [f32],
grad: &[f32],
lr: f32,
betas: (f32, f32),
eps: f32,
weight_decay: f32,
) -> Result<()>
pub fn launch_fused_adam_kernel( &mut self, param_id: &str, param: &mut [f32], grad: &[f32], lr: f32, betas: (f32, f32), eps: f32, weight_decay: f32, ) -> Result<()>
Launches fused Adam kernel for a parameter.
Sourcepub fn launch_multi_param_kernel(
&mut self,
params: Vec<(&str, &mut [f32], &[f32])>,
lr: f32,
betas: (f32, f32),
eps: f32,
weight_decay: f32,
) -> Result<()>
pub fn launch_multi_param_kernel( &mut self, params: Vec<(&str, &mut [f32], &[f32])>, lr: f32, betas: (f32, f32), eps: f32, weight_decay: f32, ) -> Result<()>
Launches multi-parameter fused kernel.
Sourcepub fn gpu_memory_stats(&self) -> GPUMemoryStats
pub fn gpu_memory_stats(&self) -> GPUMemoryStats
Gets GPU memory usage statistics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FusedGPUState
impl RefUnwindSafe for FusedGPUState
impl Send for FusedGPUState
impl Sync for FusedGPUState
impl Unpin for FusedGPUState
impl UnwindSafe for FusedGPUState
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
Mutably borrows from an owned value. Read more
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> 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>
Converts
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>
Converts
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