Commit Graph

42 Commits

Author SHA1 Message Date
austinvhuang 129e66ada2 Reduce KV cache preallocation to 4096 and make it comptime configurable, add rm build note in readme, add note on comptime options in DEVELOPERS, make multiturn=0 the default 2024-02-26 17:05:32 -05:00
David Coles 7aeade5c9d Copybara import of the project:
--
c64b6fd3a44b385e1502d2057bd8709edaebaa58 by David Coles <dcoles@dcoles.net>:

Include Windows in GitHub Actions build

This also preserves the `gemma` binary as a build artefact
should folks want to grab a pre-built binary.

Dropped the use of the lukka/cmake actions due to conflicts with `--preset`.
This isn't that bad as we were mostly overriding the default behaviour anyway.

It also shaves ~2 min off the build since the GitHub builders already
have CMake pre-installed.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gemma.cpp/pull/38 from dcoles:windows-build c64b6fd3a44b385e1502d2057bd8709edaebaa58
PiperOrigin-RevId: 610449220
2024-02-26 10:22:57 -08:00
Naoki Kishida 7ab968c957 Copybara import of the project:
--
26b541b666 by kishida <naokikishida@gmail.com>:

add information for the reseting conversation

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gemma.cpp/pull/40 from kishida:add_info_for_reset_conv 26b541b666
PiperOrigin-RevId: 610418671
2024-02-26 08:39:27 -08:00
Kewde 4e2efbcbd8 Copybara import of the project:
--
f4f2ff3c1a by kewde <kewde@particl.io>:

fix: add -fPIC to libgemma
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gemma.cpp/pull/42 from kewde:kewde/enable-fpic f4f2ff3c1a
PiperOrigin-RevId: 610416597
2024-02-26 08:31:06 -08:00
Dan Zheng 4c155bd3df Restore reverted changes.
Sync to 84444c93a4.

PiperOrigin-RevId: 610263918
2024-02-25 19:32:07 -08:00
Jan Wassenberg 6a3085828f Fixes #37, lambda issue: missing HWY_ATTR, and cannot capture SVE in/out vectors.
PiperOrigin-RevId: 610260610
2024-02-25 19:09:13 -08:00
Dan Zheng 1243be71c4 Copybara import of the project:
--
e0179bad83 by Dan Zheng <danielzheng@google.com>:

Rename BUILD to BUILD.bazel.

This fixes an error on macOS due to `build` and `BUILD` having conflicting names.

--
74b27074e1 by Dan Zheng <danielzheng@google.com>:

Enable macos-latest in GitHub Actions CI.

--
c08de58e6a by Dan Zheng <danielzheng@google.com>:

Fix concurrency key in GitHub Actions.

Use matrix configuration in concurrency key.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gemma.cpp/pull/36 from dan-zheng:rename-build-bzl b4b978f02b
PiperOrigin-RevId: 610156681
2024-02-25 04:34:15 -08:00
Silvio Traversaro 696597383c Copybara import of the project:
--
19694e1f2e by Silvio Traversaro <silvio@traversaro.it>:

Do not pass explicitly -O2 flag to compiler in Release build

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gemma.cpp/pull/3 from traversaro:patch-1 19694e1f2e
PiperOrigin-RevId: 610096914
2024-02-24 20:41:33 -08:00
Dan Zheng 84444c93a4 Revert "Copybara configuration update."
This reverts commit c03b5da542.

Restore lost changes due to improper Copybara syncing.
2024-02-24 15:15:14 -08:00
Naoki Kishida 621434e424 reset conversation (#34) 2024-02-24 14:54:19 -08:00
Dan Zheng 3af439621e
Rename BUILD to BUILD.bazel. (#36)
* Rename BUILD to BUILD.bazel.

This fixes an error on macOS due to `build` and `BUILD` having conflicting names.

* Enable macos-latest in GitHub Actions CI.

* Fix concurrency key in GitHub Actions.

Use matrix configuration in concurrency key.
2024-02-24 14:52:59 -08:00
Dan Zheng 5fe31ad0bc Copybara: rename BUILD to BUILD.bazel.
PiperOrigin-RevId: 610039263
2024-02-24 14:45:42 -08:00
austinvhuang 5b5c080b10 Merge branch 'main' into dev 2024-02-24 17:21:41 -05:00
Naoki Kishida 902adc5e62
reset conversation (#34) 2024-02-24 17:21:01 -05:00
Jan Wassenberg e7a6f44ba5 Sync infra
PiperOrigin-RevId: 610035407
2024-02-24 13:00:00 -08:00
Dan Zheng d9e1af7551 Copybara fix.
PiperOrigin-RevId: 610032760
2024-02-24 12:02:59 -08:00
Dan Zheng c03b5da542 Copybara configuration update.
PiperOrigin-RevId: 609931218
2024-02-24 12:02:47 -08:00
Dan Zheng 4b1fa03e95
Fix build. (#35)
* Enable GitHub Actions CI for pull requests.
* Fix sentencepiece include directives.
2024-02-24 11:03:36 -08:00
Austin Huang 830dda09b0
Merge pull request #3 from traversaro/patch-1
Do not pass explicitly -O2 flag to compiler in Release build
2024-02-24 12:28:03 -05:00
Austin Huang 34b22c56f5
Merge pull request #6 from dcoles/clang-cl
Allow building on Windows using `clang-cl` toolchain
2024-02-24 12:27:40 -05:00
Austin Huang ff8fb8cb9d Merge remote-tracking branch 'origin/main' into dev 2024-02-24 11:06:31 -05:00
Austin Huang d9f0b7bfba
Merge pull request #32 from shirayu/fix_typos
Fix typos
2024-02-24 11:03:30 -05:00
Yuta Hayashibe 65b20f9c55 Fix typos 2024-02-24 19:15:52 +09:00
Jan Wassenberg 4a0d23f47e Add missing hn::, fixes #25
PiperOrigin-RevId: 609914890
2024-02-23 22:34:47 -08:00
Jan Wassenberg af715d2436 Update readme to match code, see cl/609177092
PiperOrigin-RevId: 609912278
2024-02-23 22:34:08 -08:00
Ikko Eltociear Ashimine e4e02a17d4 Copybara import of the project:
--
5c7dbc6599 by Ikko Eltociear Ashimine <eltociear@gmail.com>:

Update build.yml

dispath -> dispatch

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gemma.cpp/pull/22 from eltociear:patch-1 5c7dbc6599
PiperOrigin-RevId: 609827161
2024-02-23 22:32:51 -08:00
Jan Wassenberg 8f27580fb6
Merge branch 'dev' into clang-cl 2024-02-24 04:22:42 +01:00
Dan Zheng 7698e3c3de Merge remote-tracking branch 'origin/main' into dev 2024-02-23 13:54:39 -08:00
Ikko Eltociear Ashimine 52e8b88bb0
Update build.yml (#22)
dispath -> dispatch
2024-02-23 12:58:39 -08:00
Austin Huang 0dfd720ddb
Merge pull request #24 from google/dev
Dev -> Main sync
2024-02-23 15:30:48 -05:00
The gemma.cpp Authors a16df06cf2 Toward Bazel support: expose BUILD, add WORKSPACE/MODULE.bazel. Refs #16
PiperOrigin-RevId: 609734560
2024-02-23 08:23:18 -08:00
The gemma.cpp Authors 7c9954dea5 Code update
PiperOrigin-RevId: 609719211
2024-02-23 07:13:10 -08:00
The gemma.cpp Authors 0263ccf276 remove UNROLL, negligible effect on codegen and may raise GCC warnings
PiperOrigin-RevId: 609648249
2024-02-23 01:19:51 -08:00
David Coles ceea495693 Add CMakePresets and update README instructions
Using a `CMakePresets.json` file makes it much easier to manage
several alternate build configurations, such as the "ClangCL"
build for Windows. This also makes it easier for tools like
VSCode to run CMake-based builds.
2024-02-23 00:41:47 -08:00
David Coles 39e385782c Allow building on Windows using `clang-cl` toolchain
It's not possible to build `gemma.cpp` with the standard MSVC front-end
as it doesn't support arrays more than `0x7ffffffff` bytes (see Compiler Error C2148),
however this isn't a problem with the optional Visual Studio Clang/LLVM frontend.

This can be specified using the `-T` flag when running CMake:

```
$ cmake -B build -T ClangCL
$ cmake --build build --config Release
```

Windows doesn't provide `pread`/`pwrite` so this must be emulated using
the `ReadFile`/`WriteFile` Win32 APIs.

`_CRT_SECURE_NO_WARNINGS` is defined to prevent a large number of warnings
about using "depricated" function names (e.g. `close` instead of `_close`).

`NOMINMAX` is defined to prevent the `min`/`max` macros from `windows.h`
from conflicting with expressions like `std::min`. Generally libraries should
avoid including `windows.h` in their public headers or define `WIN32_LEAN_AND_MEAN`
before including the `windows.h` header, but this unfortunately isn't always the case.
2024-02-23 00:38:54 -08:00
Dan Zheng 6747c24eef Copybara import of the project:
--
acafb83b5c by Dan Zheng <danielzheng@google.com>:

[readme] Minor tweaks.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gemma.cpp/pull/14 from dan-zheng:readme acafb83b5c
PiperOrigin-RevId: 609550615
2024-02-22 17:17:26 -08:00
Dan Zheng 0508e2c2e1 [readme] Clarify that development is done on dev branch.
Discussed using dev branch instead of main branch for development.

We could revisit this once CI is hardened to test end-to-end correctness.

PiperOrigin-RevId: 609500897
2024-02-22 14:32:56 -08:00
Dan Zheng a62f783efb Set up GitHub Actions CI.
PiperOrigin-RevId: 609411485
2024-02-22 10:12:47 -08:00
The gemma_cpp Authors 587e80f276 Code update
PiperOrigin-RevId: 609394329
2024-02-22 09:19:47 -08:00
Silvio Traversaro 19694e1f2e
Do not pass explicitly -O2 flag to compiler in Release build 2024-02-21 21:02:48 +01:00
Jan Wassenberg fb6f266db1 Fix email addresses 2024-02-21 07:53:56 +01:00
Austin Huang e29cd566cf initial commit 2024-02-21 03:31:22 +00:00