pub enum MemoryConfiguration {
SubSlices,
ExclusivePages,
Custom {
pool_options: Vec<MemoryPoolOptions>,
},
}Expand description
High level configuration of memory management.
Variants§
SubSlices
The default preset, which uses pools that allocate sub slices.
ExclusivePages
Default preset for using exclusive pages. This can be necessary for backends don’t support sub-slices.
Custom
Custom settings.
Fields
pool_options: Vec<MemoryPoolOptions>Options for each pool to construct. When allocating, the first possible pool will be picked for an allocation.
Implementations§
Source§impl MemoryConfiguration
impl MemoryConfiguration
Sourcepub fn resolve(
self,
pools: Option<&MemoryPoolsConfig>,
properties: &MemoryDeviceProperties,
) -> Result<Self, PoolConfigError>
pub fn resolve( self, pools: Option<&MemoryPoolsConfig>, properties: &MemoryDeviceProperties, ) -> Result<Self, PoolConfigError>
Resolve a programmatic MemoryPoolsConfig override against the
runtime-chosen configuration for the main GPU pool.
When pools is None, the runtime’s own self is kept unchanged;
when present, it wins. There is deliberately no config-file pathway for
pool layouts — they are dynamic (set per model just before a load) and
must not freeze at startup; the override reaches the server through
configure_memory_pools.
page_size is deliberately not validated against
MemoryDeviceProperties::max_page_size: that value is a sizing
heuristic for the default layouts (CUDA/HIP report a quarter of the
device memory), not an allocation limit, and a large arena is exactly
what an explicit pool override is for. An unallocatable page fails at
allocation time.
Trait Implementations§
Source§impl Clone for MemoryConfiguration
impl Clone for MemoryConfiguration
Source§fn clone(&self) -> MemoryConfiguration
fn clone(&self) -> MemoryConfiguration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryConfiguration
impl Debug for MemoryConfiguration
Auto Trait Implementations§
impl Freeze for MemoryConfiguration
impl RefUnwindSafe for MemoryConfiguration
impl Send for MemoryConfiguration
impl Sync for MemoryConfiguration
impl Unpin for MemoryConfiguration
impl UnsafeUnpin for MemoryConfiguration
impl UnwindSafe for MemoryConfiguration
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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