Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/MojoLlama/blob/main/src/mojollama/kernels/forward/base.py # MojoLlama Archived Mojo/MAX quantizer and serving research repository (read-only history) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `MojoLlama / src / mojollama / kernels / forward / base.py` 28 lines ยท 954 bytes Raw Blame History 1 from abc import ABC, abstractmethod 2 3 class ArchitectureForwardPass(ABC): 4 """Base class for per-architecture forward passes.""" 5 6 def __init__(self, engine): 7 self.engine = engine # TurboEngineV7MoE reference 8 9 @abstractmethod 10 def forward(self, token_id): 11 """Single-token forward pass. Returns logits.""" 12 ... 13 14 def init_weights(self, weights, raw_weights, weight_info, weight_qtypes): 15 """Override to load architecture-specific weights. Called during _load_weights.""" 16 pass 17 18 def init_pointers(self, layer_idx, pfx, lw): 19 """Override to pre-compute ctypes pointers for a layer. Called during _preload_pointers.""" 20 pass 21 22 def init_buffers(self): 23 """Override to allocate per-architecture buffers. Called during _init_buffers.""" 24 pass 25 26 def reset_state(self): 27 """Override to reset per-architecture state. Called during reset/reset_state.""" 28 pass