pub struct TensorChunkConfig {
pub strategy: ChunkingStrategy,
pub auto_tune: bool,
pub min_chunk_size: usize,
pub max_chunk_size: usize,
}Expand description
Tensor-specific chunking configuration
Provides high-level configuration for tensor operations with automatic parameter selection based on hardware capabilities.
Fields§
§strategy: ChunkingStrategyChunking strategy
auto_tune: boolEnable automatic tuning based on runtime profiling
min_chunk_size: usizeMinimum chunk size (prevents over-chunking for small tensors)
max_chunk_size: usizeMaximum chunk size (prevents cache thrashing)
Implementations§
Source§impl TensorChunkConfig
impl TensorChunkConfig
Sourcepub fn compute_intensive() -> Self
pub fn compute_intensive() -> Self
Create a compute-intensive configuration
Optimized for:
- Matrix multiplication (GEMM operations)
- Convolution operations
- FFT transformations
§Performance
Expected 15-30% speedup over naive chunking through:
- CPU core utilization optimization
- Instruction-level parallelism
- Reduced synchronization overhead
Sourcepub fn memory_intensive() -> Self
pub fn memory_intensive() -> Self
Create a memory-intensive configuration
Optimized for:
- Large tensor copies
- Broadcasting operations
- Tensor reshaping
§Performance
Expected 20-40% speedup through:
- Memory bandwidth optimization
- NUMA-aware memory access
- Prefetching optimization
Sourcepub fn cache_friendly() -> Self
pub fn cache_friendly() -> Self
Create a cache-friendly configuration
Optimized for:
- Reduction operations (sum, mean, max)
- Cumulative operations (cumsum, cumprod)
- Scan operations
§Performance
Expected 25-50% speedup through:
- L2/L3 cache size awareness
- Cache line alignment
- Reduced cache misses
Sourcepub fn custom(
chunk_size: usize,
alignment: usize,
prefetch_distance: usize,
auto_tune: bool,
) -> Self
pub fn custom( chunk_size: usize, alignment: usize, prefetch_distance: usize, auto_tune: bool, ) -> Self
Create a custom configuration
Sourcepub fn compute_chunk_size(
&self,
tensor_size: usize,
element_size: usize,
) -> usize
pub fn compute_chunk_size( &self, tensor_size: usize, element_size: usize, ) -> usize
Trait Implementations§
Source§impl Clone for TensorChunkConfig
impl Clone for TensorChunkConfig
Source§fn clone(&self) -> TensorChunkConfig
fn clone(&self) -> TensorChunkConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TensorChunkConfig
impl RefUnwindSafe for TensorChunkConfig
impl Send for TensorChunkConfig
impl Sync for TensorChunkConfig
impl Unpin for TensorChunkConfig
impl UnsafeUnpin for TensorChunkConfig
impl UnwindSafe for TensorChunkConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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