Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
clebert committed Aug 24, 2023
1 parent 6699f32 commit ecb06cc
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,13 @@
This is a Zig port of [llama2.c](https://github.com/karpathy/llama2.c).

My goal is to learn Zig while simultaneously gaining a better understanding of LLMs.

The current code is based on
The current code is based on:
https://github.com/karpathy/llama2.c/blob/c7a26264a233c32f396b1c67be4ac019d2d8a659/run.c

I have attempted to stay true to the philosophy of the original. The only dependency is the Zig
`std` library. I have, however, divided it into several files for better clarity.

Some deviations from the original include:

- No OpenMP support
- SIMD optimization of the matmul function using `@Vector`
- Utilization of slices instead of many-item pointers
- For models of 4096+ dimensions, thread pools are utilized to parallelize independent matrix
multiplications
I have significantly diverged from the original in terms of architecture and implementation.
However, my goal is to continue porting the improvements and new features of Andrej's C version into
this codebase. At present, my Zig port produces the same output as the C version. I ensure this
through the following linked [tests](./test.sh).

## Papers

Expand Down

0 comments on commit ecb06cc

Please sign in to comment.