Commit Graph

32 Commits

Author SHA1 Message Date
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