Skip to main content

NumaStrategy

Enum NumaStrategy 

Source
pub enum NumaStrategy {
    DISABLED,
    DISTRIBUTE,
    ISOLATE,
    NUMACTL,
    MIRROR,
    COUNT,
}
Expand description

A rusty wrapper around numa_strategy.

§Description

Represents different NUMA (Non-Uniform Memory Access) strategies for memory management in multi-core or multi-processor systems.

§See more

https://github.com/ggerganov/llama.cpp/blob/master/ggml/include/ggml-cpu.h#L25-L32

Variants§

§

DISABLED

The NUMA strategy is disabled. No NUMA-aware optimizations are applied. Memory allocation will not consider NUMA node locality.

§

DISTRIBUTE

Distribute memory across NUMA nodes. This strategy aims to balance memory usage across all available NUMA nodes, potentially improving load balancing and preventing memory hotspots on a single node. It may use round-robin or another method to distribute allocations.

§

ISOLATE

Isolate memory to specific NUMA nodes. Memory allocations will be restricted to specific NUMA nodes, potentially reducing contention and improving locality for processes or threads bound to a particular node.

§

NUMACTL

Use numactl to manage memory and processor affinities. This strategy utilizes the numactl command or library to bind processes or memory allocations to specific NUMA nodes or CPUs, providing fine-grained control over memory placement.

§

MIRROR

Mirror memory across NUMA nodes. This strategy creates duplicate memory copies on multiple NUMA nodes, which can help with fault tolerance and redundancy, ensuring that each NUMA node has access to a copy of the memory.

§

COUNT

A placeholder representing the total number of strategies available. Typically used for iteration or determining the number of strategies in the enum.

Trait Implementations§

Source§

impl Clone for NumaStrategy

Source§

fn clone(&self) -> NumaStrategy

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NumaStrategy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<NumaStrategy> for ggml_numa_strategy

Source§

fn from(value: NumaStrategy) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for NumaStrategy

Source§

fn eq(&self, other: &NumaStrategy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<u32> for NumaStrategy

Source§

type Error = InvalidNumaStrategy

The type returned in the event of a conversion error.
Source§

fn try_from(value: ggml_numa_strategy) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for NumaStrategy

Source§

impl Eq for NumaStrategy

Source§

impl StructuralPartialEq for NumaStrategy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more