Commit Graph

821 Commits

Author SHA1 Message Date
Yuta Hayashibe 1a95cf3274 Add --eot_line option 2024-02-24 23:27:33 +09: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