pub enum RopeLayout {
Norm,
Neox,
}Expand description
Which RoPE pairing convention a model uses. Confirmed against
llama.cpp’s llama_model_rope_type (src/llama-model.cpp):
Norm is adjacent-pair / GPT-J (LLAMA_ROPE_TYPE_NORM); Neox is
split-half / GPT-NeoX (LLAMA_ROPE_TYPE_NEOX). Getting this wrong
silently produces fluent-but-wrong logits (the real Llama-3.1-8B
early-stop bug: ferrox applied NeoX to a Norm architecture).
Variants§
Norm
Adjacent pairs (2*i, 2*i+1) – llama.cpp LLAMA_ROPE_TYPE_NORM.
Used by llama (including Llama 3/3.1/3.2), deepseek2,
mistral3, and related families. (llama4 is DedicatedOnly — MoE
graph — but its RoPE type in the inventory is still Norm.)
Neox
Split-half pairs (i, i+half) – llama.cpp LLAMA_ROPE_TYPE_NEOX.
Used by olmoe, qwen2/qwen2moe/qwen3, phi3, gemma*, and
related families. Ferrox’s historical default before architecture-
aware dispatch existed.
Implementations§
Source§impl RopeLayout
impl RopeLayout
Sourcepub fn for_gguf_architecture(arch: &str) -> Self
pub fn for_gguf_architecture(arch: &str) -> Self
Maps a GGUF general.architecture string onto the RoPE pairing
llama.cpp selects for that family. Prefer
crate::capability::resolve_architecture for load-time
decisions — unknown architectures must fail closed there rather
than guessing. This helper remains for tests and call sites that
already know the arch is registered; unknowns still return Neox
only as a last-resort historical default.
Trait Implementations§
Source§impl Clone for RopeLayout
impl Clone for RopeLayout
Source§fn clone(&self) -> RopeLayout
fn clone(&self) -> RopeLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RopeLayout
Source§impl Debug for RopeLayout
impl Debug for RopeLayout
impl Eq for RopeLayout
Source§impl PartialEq for RopeLayout
impl PartialEq for RopeLayout
impl StructuralPartialEq for RopeLayout
Auto Trait Implementations§
impl Freeze for RopeLayout
impl RefUnwindSafe for RopeLayout
impl Send for RopeLayout
impl Sync for RopeLayout
impl Unpin for RopeLayout
impl UnsafeUnpin for RopeLayout
impl UnwindSafe for RopeLayout
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
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> ⓘ
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> ⓘ
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