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
Justine Tunney
f312f706f4
Bring MODE=tiny binary sizes down to 20kb minimum
...
aarch64 binaries start at 4kb.
2023-05-10 04:20:48 -07:00
Justine Tunney
5f57fc1f59
Upgrade llama.cpp to e6a46b0ed1884c77267dc70693183e3b7164e0e0
2023-05-10 04:20:48 -07:00
Justine Tunney
5a455eaa0b
Work on magic numbers for aarch64
2023-05-10 04:20:48 -07:00
Justine Tunney
59766efd3e
Do some more aarch64 fixups
2023-05-10 04:20:47 -07:00
Justine Tunney
86d9323a43
Remove sys_getrandom() on NetBSD
...
This fixes an apparent regression caused by
3f0bcdc3ef
where getrandom() on NetBSD 9.2
doesn't appear to work; ktrace oddly reports:
1446 1 .ape CALL #91 (unimplemented getdopt)
1446 1 .ape RET #91 (unimplemented getdopt) -1 errno 78
Function not implemented
1446 1 .ape PSIG SIGSYS SIG_DFL: code=SI_NOINFO
2023-05-10 04:20:47 -07:00
Justine Tunney
a0237a017c
Get llama.com working on aarch64
2023-05-10 04:20:47 -07:00
Justine Tunney
4c093155a3
Get llama.com building as an aarch64 native binary
2023-05-10 04:20:47 -07:00
Justine Tunney
d04430f4ef
Get LIBC_MEM and LIBC_STDIO building with aarch64
2023-05-10 04:20:47 -07:00
Justine Tunney
ae0ee59614
Get aarch64 hello world working
...
$ m=aarch64-tiny
$ make -j8 m=$m o/$m/tool/hello/hello.com o/third_party/qemu/qemu-aarch64
$ o/third_party/qemu/qemu-aarch64 o/$m/tool/hello/hello.com
hello world
$ ls -hal o/$m/tool/hello/hello.com
-rwxr-xr-x 1 jart jart 4.0K May 9 05:04 o/aarch64-tiny/tool/hello/hello.com
2023-05-10 04:20:47 -07:00
Justine Tunney
e5e3cdf447
Get LIBC_RUNTIME and LIBC_CALLS building on aarch64
2023-05-10 04:20:47 -07:00
Justine Tunney
7e46645193
Get LIBC_FMT to build for aarch64
2023-05-10 04:20:47 -07:00
Justine Tunney
036b9a0002
Make further progress on non-x86 support
2023-05-10 04:20:47 -07:00
Justine Tunney
aef9a69a60
Make more progress on aarch64
2023-05-10 04:20:47 -07:00
Justine Tunney
135080fd3e
Get libc/tinymath/ compiling on aarch64
2023-05-10 04:20:46 -07:00
Justine Tunney
2b73e72d59
Make more code aarch64 friendly
2023-05-10 04:20:46 -07:00
Justine Tunney
ca2860947f
Make progress towards aarch64 build
2023-05-10 04:20:46 -07:00
Justine Tunney
08ff26c817
Add qemu-aarch64
2023-05-10 04:20:46 -07:00
Justine Tunney
8303e23b3a
Do some basic build tuning
2023-05-10 04:20:46 -07:00
Justine Tunney
57cc257f58
Vendor musl-cross-make gcc 9.2.0 aarch64
2023-05-10 04:20:46 -07:00
Paul Kulchenko
a493b64233
Merge pull request #807 from jart/evalarg
...
Fix the behavior of `redbean -i -e CODE`
2023-05-02 07:48:43 -07:00
Justine Tunney
b008950d90
Add libcxx to make toolchain
2023-05-01 14:12:46 -07:00
Justine Tunney
12438cce16
Fix regression with Python linker eaxmples
...
We can once again create 2mb statically-linked Python binaries:
$ make -j8 m=tiny o/tiny/examples/pyapp/pyapp.com
$ ls -hal o/tiny/examples/pyapp/pyapp.com
-rwxr-xr-x 1 jart jart 2.1M May 1 14:04 o/tiny/examples/pyapp/pyapp.com
$ o/tiny/examples/pyapp/pyapp.com
cosmopolitan is cool!
The regression was caused by Python thread support in b15f9eb58
2023-05-01 14:12:15 -07:00
Justine Tunney
fc82f77a46
Fix bug in cosmocc / cosmoc++ scripts
...
The necessary flags weren't being passed when compiling programs as a
single step (i.e. not using `-c` to make intermediate objects).
2023-05-01 13:46:15 -07:00
Justine Tunney
3dac9f8999
Use Companion AI in llama.com by default
2023-04-30 23:08:15 -07:00
Justine Tunney
d9e27203d4
Incorporate some fixes and updates for GGML
2023-04-28 20:24:55 -07:00
Justine Tunney
b31ba86ace
Introduce prompt caching so prompts load instantly
...
This change also introduces an ephemeral status line in non-verbose mode
to display a load percentage status when slow operations are happening.
2023-04-28 16:15:26 -07:00
Justine Tunney
bf6459e324
Fix bugs with cli flags in gzip.com
2023-04-28 05:15:58 -07:00
Justine Tunney
1c2da3a55a
Make shell usability improvements to llama.cpp
...
- Introduce -v and --verbose flags
- Don't print stats / diagnostics unless -v is passed
- Reduce --top_p default from 0.95 to 0.70
- Change --reverse-prompt to no longer imply --interactive
- Permit --reverse-prompt specifying custom EOS if non-interactive
2023-04-28 02:54:11 -07:00
Justine Tunney
420f889ac3
Further optimize the math library
...
The sincosf() function is now twice as fast, thanks to ARM Limited. The
same might also be true of logf() and expm1f() which have been updated.
2023-04-28 01:20:47 -07:00
Justine Tunney
e8b43903b2
Import llama.cpp
...
https://github.com/ggerganov/llama.cpp
0b2da20538d01926b77ea237dd1c930c4d20b686
See third_party/ggml/README.cosmo for changes
2023-04-27 14:37:14 -07:00
Justine Tunney
f42089d5c6
Be more lenient about stack memory
...
The new stack size is 256kb in order to compromise with llama.cpp's
aggressive use of stack memory, which can't be easily patched. This
change disables the dynamic alloca() and VLA warnings for now, plus
frame sizes for individual functions may be <=50% of the stack size
This only applies to code in the cosmo monorepo. Open source builds
should already be using an 8mb stack by default, like everyone else
2023-04-27 10:45:47 -07:00
Justine Tunney
fec139f423
Add mlock() and munlock()
2023-04-27 10:42:52 -07:00
Justine Tunney
7c9ef924bf
Add more sorting algorithms
2023-04-27 05:44:44 -07:00
Justine Tunney
b7bf052a4b
Add Intel intrinsics headers
2023-04-27 05:44:38 -07:00
Justine Tunney
369f9740de
Run clang-format on most sources
2023-04-27 05:44:32 -07:00
Justine Tunney
497d4fa6d1
Fix the behavior of redbean -i -e CODE
...
When redbean is functioning as a Lua interpreter, the `-e` flag should
behave the same way as other open source language interpreters. Namely
it should exit after evaluating the code rather than showing the REPL.
2023-04-25 01:52:13 -07:00
Justine Tunney
614229e3f4
Make some sorting functions faster
2023-04-24 23:11:18 -07:00
Gautham
1a839ba41d
add os.geteuid to python ( #806 )
2023-04-24 20:15:24 -07:00