SYMBOL INDEX (153 symbols across 11 files) FILE: export.py function serialize_fp32 (line 34) | def serialize_fp32(file, tensor): function serialize_int8 (line 40) | def serialize_int8(file, tensor): function quantize_q80 (line 46) | def quantize_q80(w, group_size): function legacy_export (line 75) | def legacy_export(model, filepath): function version1_export (line 132) | def version1_export(model, filepath): function version2_export (line 182) | def version2_export(model, filepath, group_size=64): function hf_export (line 262) | def hf_export(llama_model, filepath, group_size=64, dtype=torch.float32): function load_checkpoint (line 356) | def load_checkpoint(checkpoint): function load_meta_model (line 371) | def load_meta_model(model_path): function load_hf_model (line 437) | def load_hf_model(model_path): function model_export (line 492) | def model_export(model, filepath, version, dtype=torch.float32): function torchscript_export (line 512) | def torchscript_export(model, filepath, zero_params=False, gzip_output=F... FILE: model.py class ModelArgs (line 13) | class ModelArgs: class RMSNorm (line 27) | class RMSNorm(torch.nn.Module): method __init__ (line 28) | def __init__(self, dim: int, eps: float): method _norm (line 33) | def _norm(self, x): method forward (line 36) | def forward(self, x): function precompute_freqs_cis (line 41) | def precompute_freqs_cis(dim: int, end: int, theta: float = 10000.0): function reshape_for_broadcast (line 49) | def reshape_for_broadcast(freqs_cis: torch.Tensor, x: torch.Tensor): function apply_rotary_emb (line 56) | def apply_rotary_emb( function repeat_kv (line 83) | def repeat_kv(x: torch.Tensor, n_rep: int) -> torch.Tensor: class Attention (line 94) | class Attention(nn.Module): method __init__ (line 95) | def __init__(self, args: ModelArgs): method forward (line 120) | def forward( class FeedForward (line 167) | class FeedForward(nn.Module): method __init__ (line 168) | def __init__(self, dim: int, hidden_dim: int, multiple_of: int, dropou... method forward (line 179) | def forward(self, x): class TransformerBlock (line 183) | class TransformerBlock(nn.Module): method __init__ (line 184) | def __init__(self, layer_id: int, args: ModelArgs): method forward (line 200) | def forward(self, x, freqs_cos, freqs_sin): class Transformer (line 206) | class Transformer(nn.Module): method __init__ (line 209) | def __init__(self, params: ModelArgs): method _init_weights (line 241) | def _init_weights(self, module): method forward (line 249) | def forward(self, tokens: torch.Tensor, targets: Optional[torch.Tensor... method configure_optimizers (line 271) | def configure_optimizers(self, weight_decay, learning_rate, betas, dev... method estimate_mfu (line 297) | def estimate_mfu(self, fwdbwd_per_iter, dt): method generate (line 314) | def generate(self, idx, max_new_tokens, temperature=1.0, top_k=None): FILE: run.c type Config (line 19) | typedef struct { type TransformerWeights (line 29) | typedef struct { type RunState (line 50) | typedef struct { type Transformer (line 67) | typedef struct { function malloc_run_state (line 77) | void malloc_run_state(RunState* s, Config* p) { function free_run_state (line 98) | void free_run_state(RunState* s) { function memory_map_weights (line 111) | void memory_map_weights(TransformerWeights *w, Config* p, float* ptr, in... function read_checkpoint (line 142) | void read_checkpoint(char* checkpoint, Config* config, TransformerWeight... function build_transformer (line 164) | void build_transformer(Transformer *t, char* checkpoint_path) { function free_transformer (line 171) | void free_transformer(Transformer* t) { function rmsnorm (line 182) | void rmsnorm(float* o, float* x, float* weight, int size) { function softmax (line 197) | void softmax(float* x, int size) { function matmul (line 217) | void matmul(float* xout, float* x, float* w, int n, int d) { type TokenIndex (line 367) | typedef struct { type Tokenizer (line 372) | typedef struct { function compare_tokens (line 381) | int compare_tokens(const void *a, const void *b) { function build_tokenizer (line 385) | void build_tokenizer(Tokenizer* t, char* tokenizer_path, int vocab_size) { function free_tokenizer (line 411) | void free_tokenizer(Tokenizer* t) { function safe_printf (line 431) | void safe_printf(char *piece) { function str_lookup (line 445) | int str_lookup(char *str, TokenIndex *sorted_vocab, int vocab_size) { function encode (line 452) | void encode(Tokenizer* t, char *text, int8_t bos, int8_t eos, int *token... type ProbIndex (line 577) | typedef struct { type Sampler (line 582) | typedef struct { function sample_argmax (line 590) | int sample_argmax(float* probabilities, int n) { function sample_mult (line 603) | int sample_mult(float* probabilities, int n, float coin) { function compare (line 616) | int compare(const void* a, const void* b) { function sample_topp (line 624) | int sample_topp(float* probabilities, int n, float topp, ProbIndex* prob... function build_sampler (line 667) | void build_sampler(Sampler* sampler, int vocab_size, float temperature, ... function free_sampler (line 676) | void free_sampler(Sampler* sampler) { function random_u32 (line 680) | unsigned int random_u32(unsigned long long *state) { function random_f32 (line 687) | float random_f32(unsigned long long *state) { // random float32 in [0,1) function sample (line 691) | int sample(Sampler* sampler, float* logits) { function time_in_ms (line 719) | long time_in_ms() { function generate (line 729) | void generate(Transformer *transformer, Tokenizer *tokenizer, Sampler *s... function read_stdin (line 785) | void read_stdin(const char* guide, char* buffer, size_t bufsize) { function chat (line 802) | void chat(Transformer *transformer, Tokenizer *tokenizer, Sampler *sampler, function error_usage (line 891) | void error_usage() { function main (line 906) | int main(int argc, char *argv[]) { FILE: runq.c type Config (line 24) | typedef struct { type QuantizedTensor (line 34) | typedef struct { type TransformerWeights (line 39) | typedef struct { type RunState (line 62) | typedef struct { type Transformer (line 81) | typedef struct { function malloc_run_state (line 91) | void malloc_run_state(RunState* s, Config* p) { function free_run_state (line 117) | void free_run_state(RunState* s) { function dequantize (line 139) | void dequantize(QuantizedTensor *qx, float* x, int n) { function quantize (line 145) | void quantize(QuantizedTensor *qx, float* x, int n) { function QuantizedTensor (line 174) | QuantizedTensor *init_quantized_tensors(void **ptr, int n, int size_each) { function memory_map_weights (line 189) | void memory_map_weights(TransformerWeights *w, Config* p, void* ptr, uin... function read_checkpoint (line 219) | void read_checkpoint(char* checkpoint, Config* config, TransformerWeight... function build_transformer (line 253) | void build_transformer(Transformer *t, char* checkpoint_path) { function free_transformer (line 260) | void free_transformer(Transformer* t) { function rmsnorm (line 282) | void rmsnorm(float* o, float* x, float* weight, int size) { function softmax (line 297) | void softmax(float* x, int size) { function matmul (line 317) | void matmul(float* xout, QuantizedTensor *x, QuantizedTensor *w, int n, ... type TokenIndex (line 486) | typedef struct { type Tokenizer (line 491) | typedef struct { function compare_tokens (line 500) | int compare_tokens(const void *a, const void *b) { function build_tokenizer (line 504) | void build_tokenizer(Tokenizer* t, char* tokenizer_path, int vocab_size) { function free_tokenizer (line 530) | void free_tokenizer(Tokenizer* t) { function safe_printf (line 550) | void safe_printf(char *piece) { function str_lookup (line 564) | int str_lookup(char *str, TokenIndex *sorted_vocab, int vocab_size) { function encode (line 571) | void encode(Tokenizer* t, char *text, int8_t bos, int8_t eos, int *token... type ProbIndex (line 696) | typedef struct { type Sampler (line 701) | typedef struct { function sample_argmax (line 709) | int sample_argmax(float* probabilities, int n) { function sample_mult (line 722) | int sample_mult(float* probabilities, int n, float coin) { function compare (line 735) | int compare(const void* a, const void* b) { function sample_topp (line 743) | int sample_topp(float* probabilities, int n, float topp, ProbIndex* prob... function build_sampler (line 786) | void build_sampler(Sampler* sampler, int vocab_size, float temperature, ... function free_sampler (line 795) | void free_sampler(Sampler* sampler) { function random_u32 (line 799) | unsigned int random_u32(unsigned long long *state) { function random_f32 (line 806) | float random_f32(unsigned long long *state) { // random float32 in [0,1) function sample (line 810) | int sample(Sampler* sampler, float* logits) { function time_in_ms (line 838) | long time_in_ms() { function generate (line 848) | void generate(Transformer *transformer, Tokenizer *tokenizer, Sampler *s... function read_stdin (line 904) | void read_stdin(const char* guide, char* buffer, size_t bufsize) { function chat (line 921) | void chat(Transformer *transformer, Tokenizer *tokenizer, Sampler *sampler, function error_usage (line 1010) | void error_usage() { function main (line 1025) | int main(int argc, char *argv[]) { FILE: test.c function assert_eq (line 4) | void assert_eq(int a, int b) { function test_prompt_encoding (line 11) | void test_prompt_encoding(Tokenizer* tokenizer, char* prompt, int* expec... function test_prompt_encodings (line 40) | void test_prompt_encodings() { function main (line 81) | int main(int argc, char *argv[]) { FILE: test_all.py function download_file (line 20) | def download_file(url, filename): function attempt_download_files (line 28) | def attempt_download_files(): function test_runc (line 43) | def test_runc(): function test_python (line 62) | def test_python(): FILE: tinystories.py function download_file (line 25) | def download_file(url: str, fname: str, chunk_size=1024): function download (line 41) | def download(): function train_vocab (line 71) | def train_vocab(vocab_size): function process_shard (line 127) | def process_shard(args, vocab_size): function pretokenize (line 159) | def pretokenize(vocab_size): class PretokDataset (line 175) | class PretokDataset(torch.utils.data.IterableDataset): method __init__ (line 178) | def __init__(self, split, max_seq_len, vocab_size, vocab_source): method __iter__ (line 185) | def __iter__(self): function get_tokenizer_model_path (line 228) | def get_tokenizer_model_path(vocab_size): class Task (line 239) | class Task: method iter_batches (line 242) | def iter_batches(batch_size, device, num_workers=0, **dataset_kwargs): FILE: tokenizer.py class Tokenizer (line 14) | class Tokenizer: method __init__ (line 15) | def __init__(self, tokenizer_model=None): method encode (line 29) | def encode(self, s: str, bos: bool, eos: bool) -> List[int]: method decode (line 38) | def decode(self, t: List[int]) -> str: method export (line 41) | def export(self): FILE: train.py function estimate_loss (line 212) | def estimate_loss(): function get_lr (line 229) | def get_lr(it): FILE: win.c function __map_mman_error (line 9) | static int __map_mman_error(const uint32_t err, const int deferr) function __map_mmap_prot_page (line 17) | static uint32_t __map_mmap_prot_page(const int prot) function __map_mmap_prot_file (line 38) | static uint32_t __map_mmap_prot_file(const int prot) function munmap (line 121) | int munmap(void *addr, size_t len) function mprotect (line 131) | int mprotect(void *addr, size_t len, int prot) function msync (line 144) | int msync(void *addr, size_t len, int flags) function mlock (line 154) | int mlock(const void *addr, size_t len) function munlock (line 164) | int munlock(const void *addr, size_t len) function clock_gettime (line 175) | int clock_gettime(int clk_id, struct timespec *tp) { FILE: win.h type timespec (line 63) | struct timespec