pub struct PleIdDims {
pub ngram_size: usize,
pub heads_per_ngram: usize,
pub multipliers: Vec<u64>,
pub head_vocab_sizes: Vec<u64>,
pub head_offsets: Vec<u64>,
pub eos_token_id: u32,
}Expand description
Geometry for one PLE site, read from the checkpoint rather than derived.
multipliers, head_vocab_sizes and head_offsets are all SHIPPED
(ple_embedding.layer_multipliers / .ngram_heads_vocab_sizes /
.ngram_heads_offsets). The reference can derive them — from SplitMix64
and a prime search — and bench/qwen4_exp/ple_golden.py confirms the
derivation reproduces the shipped values exactly. Reading them is still
right: it cannot drift when the reference does.
Fields§
§ngram_size: usizengram_size (3). Also the conv dilation, elsewhere.
heads_per_ngram: usizeheads_per_ngram (8). Heads are grouped by n-gram order:
[0, heads_per_ngram) uses order 2, the next block order 3, and so on.
multipliers: Vec<u64>layer_multipliers[ngram_size], always odd.
head_vocab_sizes: Vec<u64>ngram_heads_vocab_sizes[ngram_heads] — a distinct prime per head.
head_offsets: Vec<u64>ngram_heads_offsets[ngram_heads] — where each head’s range starts
in the single concatenated table.
eos_token_id: u32Implementations§
Source§impl PleIdDims
impl PleIdDims
Sourcepub fn ngram_heads(&self) -> usize
pub fn ngram_heads(&self) -> usize
(ngram_size - 1) * heads_per_ngram — 16 here. Times head_dim
(160) this is ple_embed_dim (2560): the head slices are
CONCATENATED, not summed as LongCat’s are.
Sourcepub fn context_len(&self) -> usize
pub fn context_len(&self) -> usize
How many previous tokens a decode step must carry to reproduce
prefill’s ids. ngram_size - 1 = 2.