mistralrs_core/dummy_paged_attention/
config.rs

1pub trait ModelConfigLike {
2    fn max_seq_len(&self) -> usize;
3    fn num_layers(&self) -> usize;
4    fn hidden_size(&self) -> usize;
5    fn num_kv_heads(&self) -> usize;
6    fn num_attn_heads(&self) -> usize;
7    fn k_head_dim(&self) -> usize;
8    fn v_head_dim(&self) -> usize;
9}
10
11#[derive(Clone)]
12pub struct ModelConfigMetadata {
13    pub max_seq_len: usize,
14    pub num_layers: usize,
15    pub hidden_size: usize,
16    pub num_kv_heads: usize,
17    pub num_attn_heads: usize,
18    pub sliding_window: Option<usize>,
19    pub k_head_dim: usize,
20    pub v_head_dim: usize,
21}
22
23impl ModelConfigLike for ModelConfigMetadata {
24    fn max_seq_len(&self) -> usize {
25        self.max_seq_len
26    }
27    fn hidden_size(&self) -> usize {
28        self.hidden_size
29    }
30    fn num_attn_heads(&self) -> usize {
31        self.num_attn_heads
32    }
33    fn num_kv_heads(&self) -> usize {
34        self.num_kv_heads
35    }
36    fn num_layers(&self) -> usize {
37        self.num_layers
38    }
39    fn k_head_dim(&self) -> usize {
40        self.k_head_dim
41    }
42    fn v_head_dim(&self) -> usize {
43        self.v_head_dim
44    }
45}