Commit graph

1678 commits

Author SHA1 Message Date
Justine Tunney
72f8bd10b7
Perform some code cleanup 2023-05-28 19:42:00 -07:00
Connor
992a4638ae
Fix rgbtoxterm tool to output the proper colors (#819) 2023-05-26 18:30:24 -07:00
tkchia
90645f4dac
[metal] Fix some issues that were breaking UEFI boot (#822)
Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
2023-05-26 18:29:25 -07:00
Paul Kulchenko
5c40800d69
Update redbean ProgramDirectory to update package.path (#823) 2023-05-26 18:29:00 -07:00
Justine Tunney
1422e96b4e
Introduce native support for MacOS ARM64
There's a new program named ape/ape-m1.c which will be used to build an
embeddable binary that can load ape and elf executables. The support is
mostly working so far, but still chasing down ABI issues.
2023-05-20 04:17:03 -07:00
Justine Tunney
b852650c08
Fiddle around with Mach-O 2023-05-20 04:13:49 -07:00
Paul Kulchenko
6881a2ecea
Extend redbean Fetch to add option to keeping connection open (#818) 2023-05-17 20:49:26 -07:00
Paul Kulchenko
021c71b651
Fix redbean to avoid compressing the first yielded chunk. (#813)
This may happen if no Status or Content-Type is set and if the written
content is longer than 100B, the compression is going to be applied
after coroutine.yield, even though it shouldn't be.
2023-05-17 20:46:27 -07:00
Justine Tunney
e7eb0b3070
Make more ML improvements
- Fix UX issues with llama.com
- Do housekeeping on libm code
- Add more vectorization to GGML
- Get GGJT quantizer programs working well
- Have the quantizer keep the output layer as f16c
- Prefetching improves performance 15% if you use fewer threads
2023-05-16 08:07:23 -07:00
Justine Tunney
80db9de173
Make the intrinsics more readable 2023-05-15 23:12:11 -07:00
Justine Tunney
210187cf77
Perform some code cleanup 2023-05-15 16:32:10 -07:00
Justine Tunney
cc1732bc42
Make AARCH64 harder, better, faster, stronger
- Perform some housekeeping on scalar math function code
- Import ARM's Optimized Routines for SIMD string processing
- Upgrade to latest Chromium zlib and enable more SIMD optimizations
2023-05-15 02:15:34 -07:00
Justine Tunney
550b52abf6
Port a lot more code to AARCH64
- Introduce epoll_pwait()
- Rewrite -ftrapv and ffs() libraries in C code
- Use more FreeBSD code in math function library
- Get significantly more tests passing on qemu-aarch64
- Fix many Musl long double functions that were broken on AARCH64
2023-05-14 09:37:26 -07:00
Ariel Núñez
91791e9f38
Started removing features from RedPajama to make it easier to understand for beginners (#817) 2023-05-14 09:16:22 -07:00
Justine Tunney
89d1fad7ee
Enable crash reports for radpajama executables 2023-05-13 21:16:03 -07:00
Justine Tunney
296ee3ec58
Make some other fixes to radpajama build config 2023-05-13 21:09:28 -07:00
Justine Tunney
282dd8e7b7
Get radpajama to build
make -j8 o//third_party/radpajama/radpajama.com
    make -j8 o//third_party/radpajama/radpajama-chat.com

This change gets the radpajama.mk config working. This package depends
on THIRD_PARTY_GGML but it's configured to call ggjt_v1(), so that the
library will provide the old quantizers. The ggml_quantize_chunk() API
will now dispatch to older quantizers based on the configured version.
2023-05-13 20:44:36 -07:00
Justine Tunney
410c8785c9
Fix the AARCH64 build 2023-05-13 08:19:44 -07:00
Justine Tunney
5a4cf9560f
Add support for new GGJT v2 quantizers
This change makes quantized models (e.g. q4_0) go 10% faster on Macs
however doesn't offer much improvement for Intel PC hardware.

This change syncs llama.cpp 699b1ad7fe6f7b9e41d3cb41e61a8cc3ea5fc6b5
which recently made a breaking change to nearly all its file formats
without any migration. Since that'll break hundreds upon hundreds of
models on websites like HuggingFace llama.com will support both file
formats because llama.com will never ever break the GGJT file format
2023-05-13 08:08:32 -07:00
Justine Tunney
ba49e86e20
Get TEST_LIBC_CALLS passing on AARCH64 2023-05-13 02:41:41 -07:00
Justine Tunney
802e7eb4ef
Mop up more test regressions 2023-05-13 01:09:44 -07:00
Justine Tunney
4a8a81eb9f
Fix llama.com interactive mode regressions 2023-05-13 00:09:38 -07:00
Justine Tunney
fd34ef732d
Make considerably more progress on AARCH64
- Utilities like pledge.com now build
- kprintf() will no longer balk at 48-bit addresses
- There's a new aarch64-dbg build mode that should work
- gc() and defer() are mostly pacified; avoid using them on aarch64
- THIRD_PART_STB now has Arm Neon intrinsics for fast image handling
2023-05-12 22:42:57 -07:00
Justine Tunney
1bfb3aab1b
Make Arm Neon intrinsics work with make tags 2023-05-12 18:32:53 -07:00
Justine Tunney
414667b1c9
Get TEST_LIBC_STR passing on AARCH64
It's now possible to run commands like:

    make -j8 m=aarch64 o/aarch64/test/libc/str

Which will cross-compile and run the test suites in a qemu-aarch64
binary that's vendored in the third_party/qemu/ folder within your
x86_64 build environment.
2023-05-12 18:09:23 -07:00
Justine Tunney
45186c74ac
Introduce -q (quiet flag) and improve ctrl-c ux 2023-05-12 09:46:07 -07:00
Justine Tunney
e8de1e4766
Fix subtoken antiprompt scanning 2023-05-12 08:55:40 -07:00
Justine Tunney
80c174d494
Clean up llama.com anti/stop/reverse-prompt code
Example use case for JSON completion:

    $ m=opt
    $ make -j16 m=$m o/$m/third_party/ggml/llama.com
    $ o/$m/third_party/ggml/llama.com -m llama.bin -p '{"key": "life", "val": ' -r '}'
    42}

This provides better control. More sophisticated facilities for
controlling text generation will be provided soon enough.
2023-05-12 08:20:58 -07:00
Justine Tunney
bbfe4fbd11
Make llama.com n_predict be -1 by default 2023-05-12 08:20:34 -07:00
Justine Tunney
ca19ecf49c
Fine tune crash reports for llama.com 2023-05-12 06:24:26 -07:00
Justine Tunney
1f2a5a8fc1
Implement crash reporting for AARCH64
The ShowCrashReports() feature for aarch64 should work even better than
the x86 crash reports. Thanks to the benefit of hindsight these reports
should be rock solid reliable and beautiful to read.

This change also improves the syscall polyfills for aarch64. Some of the
sys_foo() functions have been removed, usually because they're legacy or
downright footguns not worth building.
2023-05-12 05:47:54 -07:00
Justine Tunney
285e8a2348
Get backtraces working on AARCH64 2023-05-11 22:12:41 -07:00
Justine Tunney
4edbc98811
Get MbedTLS and its unit tests passing AARCH64 2023-05-11 21:53:15 -07:00
Justine Tunney
5e2f7f7ced
Get LIBC_TESTLIB building on AARCH64 2023-05-11 19:57:09 -07:00
Justine Tunney
95fab334e4
Use yield on aarch in spin locks 2023-05-11 19:57:09 -07:00
Ariel Núñez
b3e3359d22
Import radpajama (a redpajama.cpp fork) (#814)
This is the relevant commit: bfa6466199

Model download links:
https://huggingface.co/ceonlabs/radpajama/tree/main
2023-05-11 07:12:08 -07:00
Justine Tunney
cba15bc77a
Fix regression in DNS client
Calling FreeResolvConf() would crash, due to a recent change from
yesterday where free_s() was removed.
2023-05-10 23:27:10 -07:00
Justine Tunney
8d24a18c62
Tune magic division for size
This helps it avoid generating a branch instruction.
2023-05-10 21:32:04 -07:00
Justine Tunney
1f6f9e6701
Remove division from matrix multiplication
This change reduces llama.com CPU cycles systemically by 2.5% according
to the Linux Kernel `perf stat -Bddd` utility.
2023-05-10 21:19:54 -07:00
Justine Tunney
a88290e595
Make sure llama.com terminal cleanup happens 2023-05-10 15:56:01 -07:00
Justine Tunney
5250feb7ad
There must only be one strerror() 2023-05-10 15:34:13 -07:00
Justine Tunney
c91de6a356
Avoid running clang-format on ggml.c 2023-05-10 14:59:33 -07:00
Justine Tunney
ea607781f8
Fix the build 2023-05-10 10:14:15 -07:00
Justine Tunney
bb3ebedfce
Fix load time measurement 2023-05-10 07:54:21 -07:00
Justine Tunney
290a49952e
Fix some more issues with aarch64 and llama.cpp 2023-05-10 07:34:26 -07:00
Justine Tunney
64aca4dc4f
Fix weird behavior issue w/ kprintf() on aarch64 2023-05-10 06:17:33 -07:00
Justine Tunney
4e81d3277c
Do some basic housekeeping in LIBC_STR 2023-05-10 06:17:20 -07:00
Justine Tunney
12a33858c9
There must be only one clock() 2023-05-10 06:16:01 -07:00
Justine Tunney
6cb9553706
Fix alignment bug in llama.com 2023-05-10 06:15:32 -07:00
Justine Tunney
ca990ef091
Make llama.com -h print to stdout 2023-05-10 04:55:59 -07:00