pub struct IOStats {
pub total_flops: u64,
pub memory_reads: u64,
pub memory_writes: u64,
/* private fields */
}Expand description
IO statistics for comparing tiled vs naive attention.
Fields§
§total_flops: u64Total floating-point operations performed.
memory_reads: u64Total elements read from main memory.
memory_writes: u64Total elements written to main memory.
Implementations§
Source§impl IOStats
impl IOStats
Sourcepub fn flop_ratio(&self) -> f32
pub fn flop_ratio(&self) -> f32
Returns the ratio of naive FLOPs to tiled FLOPs (should be ~1.0 since FLOPs are the same; the advantage is in memory IO).
Sourcepub fn memory_complexity(&self) -> &'static str
pub fn memory_complexity(&self) -> &'static str
Returns the memory complexity class as a string. Tiled: O(N) working memory. Naive: O(N^2).
Sourcepub fn naive_memory_complexity(&self) -> &'static str
pub fn naive_memory_complexity(&self) -> &'static str
Returns the naive attention memory complexity for comparison.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IOStats
impl RefUnwindSafe for IOStats
impl Send for IOStats
impl Sync for IOStats
impl Unpin for IOStats
impl UnsafeUnpin for IOStats
impl UnwindSafe for IOStats
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