pub enum BertTopology {
PostNormLayerNorm,
PreNormRms,
}Expand description
One transformer block’s weights. Biases that llama.cpp marks
TENSOR_NOT_REQUIRED are Option, so a checkpoint without them is
run without them rather than with a silently fabricated zero vector.
Where an encoder layer’s norms sit, and which function they are.
bert.cpp’s graph is POST-norm with LayerNorm: attention, residual,
norm, FFN, residual, norm. neo-bert.cpp:59-118 and
eurobert.cpp:55-114 are the other shape – RMSNorm BEFORE each
block and a bare residual after it, with one final norm at the end
– and they are one topology with four table columns between them,
not two graphs.
Variants§
PostNormLayerNorm
bert.cpp: LayerNorm with biases, after each residual.
PreNormRms
neo-bert / eurobert: RMSNorm with a weight and no bias,
before each block, and one final norm.
Trait Implementations§
Source§impl Clone for BertTopology
impl Clone for BertTopology
impl Copy for BertTopology
Source§impl Debug for BertTopology
impl Debug for BertTopology
impl Eq for BertTopology
Source§impl PartialEq for BertTopology
impl PartialEq for BertTopology
impl StructuralPartialEq for BertTopology
Auto Trait Implementations§
impl Freeze for BertTopology
impl RefUnwindSafe for BertTopology
impl Send for BertTopology
impl Sync for BertTopology
impl Unpin for BertTopology
impl UnsafeUnpin for BertTopology
impl UnwindSafe for BertTopology
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