LlaMa2 architecture in Julia: llama2.jl (300 lines?)

Hello!

I’m currently porting karpathy/llama2.c to Julia
Managed to import all the weights and the config. Created structs with the appropiate types and implemented some of the math too. Now I’m implementing the architecture.
I’m having some issues to understand the way arrays are sliced in C but I’m managing I think

You can check out the progress here: GitHub - jdiaz97/llama2.jl: llama2 in Julia
I’m trying to make a rough port first and once it works I’ll refactor it to be more julian and fast (loop vectorization, parallelization)
The final version should have way less lines, be more readable and faster than karpathy’s C version.

13 Likes

This one is already up and running

in case you have not seen it yet.

4 Likes

There is also

3 Likes