Skip to content

Commit 15e7c92

Browse files
authored
Merge pull request ggml-org#10 from luigifcruz/patch-1
Bigger number better with -funsafe-math-optimizations flag.
2 parents 1b63a95 + 1eb111a commit 15e7c92

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Let's just run a baby Llama 2 model in C. You need a model checkpoint. Download
1919
wget https://karpathy.ai/llama2c/model.bin -P out
2020
```
2121

22-
(if that doesn't work try [google drive](https://drive.google.com/file/d/1aTimLdx3JktDXxcHySNrZJOOk8Vb1qBR/view?usp=share_link)). Compile and run the C code:
22+
(if that doesn't work try [google drive](https://drive.google.com/file/d/1aTimLdx3JktDXxcHySNrZJOOk8Vb1qBR/view?usp=share_link)). Compile and run the C code (check [howto](#howto) for faster optimization flags):
2323

2424
```bash
2525
gcc -O3 -o run run.c -lm
@@ -68,6 +68,12 @@ Once we have the model.bin file, we can inference in C. Compile the C code first
6868
gcc -O3 -o run run.c -lm
6969
```
7070

71+
Alternatively, if you want to increase the inference performance and are confident in using unsafe math optimizations, which are probably fine for this application, you can compile the code with the `-funsafe-math-optimizations` flag as shown below:
72+
73+
```bash
74+
gcc -O3 -funsafe-math-optimizations -o run run.c -lm
75+
```
76+
7177
You can now run it simply as
7278

7379
```bash

0 commit comments

Comments
 (0)