pub struct PagedAttentionConfig {
pub attention: AttentionConfig,
pub page_block_size: usize,
pub max_blocks_per_seq: usize,
pub max_num_seqs: usize,
}Expand description
Configuration for paged attention.
Fields§
§attention: AttentionConfigBase attention config.
page_block_size: usizeBlock size in the page table (tokens per block).
max_blocks_per_seq: usizeMaximum number of blocks per sequence.
max_num_seqs: usizeMaximum number of sequences.
Implementations§
Source§impl PagedAttentionConfig
impl PagedAttentionConfig
Sourcepub fn with_attention(self, attention: AttentionConfig) -> Self
pub fn with_attention(self, attention: AttentionConfig) -> Self
Set attention config.
Sourcepub fn with_max_blocks(self, max_blocks: usize) -> Self
pub fn with_max_blocks(self, max_blocks: usize) -> Self
Set max blocks per sequence.
Sourcepub fn max_context_len(&self) -> usize
pub fn max_context_len(&self) -> usize
Maximum context length supported.
Sourcepub fn validate(&self) -> ConfigResult<()>
pub fn validate(&self) -> ConfigResult<()>
Validate configuration values.
Trait Implementations§
Source§impl Clone for PagedAttentionConfig
impl Clone for PagedAttentionConfig
Source§fn clone(&self) -> PagedAttentionConfig
fn clone(&self) -> PagedAttentionConfig
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 moreSource§impl Debug for PagedAttentionConfig
impl Debug for PagedAttentionConfig
Auto Trait Implementations§
impl Freeze for PagedAttentionConfig
impl RefUnwindSafe for PagedAttentionConfig
impl Send for PagedAttentionConfig
impl Sync for PagedAttentionConfig
impl Unpin for PagedAttentionConfig
impl UnwindSafe for PagedAttentionConfig
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