llama2.c icon indicating copy to clipboard operation
llama2.c copied to clipboard

Inference Llama 2 in one file of pure C

Results 146 llama2.c issues
Sort by recently updated
recently updated
newest added

Maintainer @karpathy is inactive since many weeks, he made [a single commit few days ago](https://github.com/karpathy/llama2.c/commit/d0237abd32e553317a2bd80ecd5d4c621ddd307a), but it seems more like a "ping signal" than a real commit. We can understand...

As a newcomer to transformers, there are some questions about the matrix multiplication operator in run.c, can the author answer them. ![image](https://github.com/karpathy/llama2.c/assets/124141787/5febdd0f-7265-4a15-815d-bc0554991212) In the forward function, it can be seen...

I found that the dim parameter affects the learning loss and n_layers affects the training speed. ![螢幕擷取畫面 2023-10-07 184924](https://github.com/karpathy/llama2.c/assets/125795763/7906a654-9697-4c05-8022-a99430c22ae9) ![螢幕擷取畫面 2023-10-07 185043](https://github.com/karpathy/llama2.c/assets/125795763/b2ad8f05-d745-4228-8364-3c10d9db644f) It took 30 minutes. The larger layer only...

I have trained TinyStories to validation loss that Karpathy achieves. I want to fine tune on top of this now. I imagine it is like "resume", but don't reset the...

How to save checkpoints at each step? what is mfu ?

Overriding: compile = False Overriding: eval_iters = 1 Overriding: batch_size = 1 tokens per iteration will be: 1,024 breaks down as: 4 grad accum steps * 1 processes * 1...

One potential optimization is to use a library such as OpenBLAS or Intel's MKL to perform the matrix multiplication in the matmul function. ``` #include void matmul(float* xout, float* x,...

In https://github.com/karpathy/llama2.c/pull/395 support was added to export the model to work with HuggingFace trasformers. However, this only works on the model, and not the tokenizer, so only works with the...

I want to convert this small 1.1B llama2 architecture model [PY007/TinyLlama-1.1B-intermediate-step-240k-503b](https://huggingface.co/PY007/TinyLlama-1.1B-intermediate-step-240k-503b) to llama2.c version. (Layers: 22, Heads: 32, Query Groups: 4, Embedding Size: 2048, Intermediate Size (Swiglu): 5632) Then I...

Is it possible to increase or decrease the size of only some of the layers of the model structure?