Skip to content

Commit 5a766c1

Browse files
committed
Merge branch 'master' into refactor
2 parents cc7cd62 + 43041d2 commit 5a766c1

35 files changed

+454
-276
lines changed

CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@ if (WIN32)
4646
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
4747
endif()
4848

49-
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
50-
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/source-charset:utf-8>")
51-
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/source-charset:utf-8>")
52-
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/execution-charset:utf-8>")
53-
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/execution-charset:utf-8>")
49+
if (MSVC)
50+
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/utf-8>")
51+
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/utf-8>")
5452
endif()
5553

5654
#

CMakePresets.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
{ "name": "sycl_f16", "hidden": true, "cacheVariables": { "GGML_SYCL_F16": "ON" } },
3232
{ "name": "vulkan", "hidden": true, "cacheVariables": { "GGML_VULKAN": "ON" } },
3333

34+
{
35+
"name": "x64-windows-llvm", "hidden": true,
36+
"cacheVariables": {
37+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/x64-windows-llvm.cmake"
38+
}
39+
},
40+
3441
{
3542
"name": "arm64-windows-msvc", "hidden": true,
3643
"architecture": { "value": "arm64", "strategy": "external" },
@@ -70,6 +77,11 @@
7077
{ "name": "arm64-windows-msvc-release", "inherits": [ "base", "arm64-windows-msvc", "reldbg" ] },
7178
{ "name": "arm64-windows-msvc+static-release", "inherits": [ "base", "arm64-windows-msvc", "reldbg", "static" ] },
7279

80+
{ "name": "x64-windows-llvm-debug", "inherits": [ "base", "x64-windows-llvm", "debug" ] },
81+
{ "name": "x64-windows-llvm-release", "inherits": [ "base", "x64-windows-llvm", "release" ] },
82+
{ "name": "x64-windows-llvm-reldbg", "inherits": [ "base", "x64-windows-llvm", "reldbg" ] },
83+
{ "name": "x64-windows-llvm+static-release", "inherits": [ "base", "x64-windows-llvm", "reldbg", "static" ] },
84+
7385
{ "name": "x64-windows-msvc-debug", "inherits": [ "base", "debug" ] },
7486
{ "name": "x64-windows-msvc-release", "inherits": [ "base", "reldbg" ] },
7587
{ "name": "x64-windows-msvc+static-release", "inherits": [ "base", "reldbg", "static" ] },

cmake/x64-windows-llvm.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
set( CMAKE_SYSTEM_NAME Windows )
2+
set( CMAKE_SYSTEM_PROCESSOR x86_64 )
3+
4+
set( CMAKE_C_COMPILER clang )
5+
set( CMAKE_CXX_COMPILER clang++ )
6+
7+
set( arch_c_flags "-march=native" )
8+
9+
set( CMAKE_C_FLAGS_INIT "${arch_c_flags}" )
10+
set( CMAKE_CXX_FLAGS_INIT "${arch_c_flags}" )
11+

common/arg.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
591591
[](common_params & params) {
592592
params.ctx_shift = false;
593593
}
594-
).set_examples({LLAMA_EXAMPLE_MAIN, LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_NO_CONTEXT_SHIFT"));
594+
).set_examples({LLAMA_EXAMPLE_MAIN, LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_IMATRIX}).set_env("LLAMA_ARG_NO_CONTEXT_SHIFT"));
595595
add_opt(common_arg(
596596
{"--chunks"}, "N",
597597
string_format("max number of chunks to process (default: %d, -1 = all)", params.n_chunks),
@@ -1711,6 +1711,13 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
17111711
params.public_path = value;
17121712
}
17131713
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_STATIC_PATH"));
1714+
add_opt(common_arg(
1715+
{"--no-webui"},
1716+
string_format("Disable the Web UI (default: %s)", params.webui ? "enabled" : "disabled"),
1717+
[](common_params & params) {
1718+
params.webui = false;
1719+
}
1720+
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_NO_WEBUI"));
17141721
add_opt(common_arg(
17151722
{"--embedding", "--embeddings"},
17161723
string_format("restrict to only support embedding use case; use only with dedicated embedding models (default: %s)", params.embedding ? "enabled" : "disabled"),

docs/build.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ cmake --build build --config Release
5757
```
5858
Building for arm64 can also be done with the MSVC compiler with the build-arm64-windows-MSVC preset, or the standard CMake build instructions. However, note that the MSVC compiler does not support inline ARM assembly code, used e.g. for the accelerated Q4_0_N_M CPU kernels.
5959
60+
For building with ninja generator and clang compiler as default:
61+
-set path:set LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\lib\x64\uwp;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\x64
62+
```bash
63+
cmake --preset x64-windows-llvm-release
64+
cmake --build build-x64-windows-llvm-release
65+
```
66+
6067
## BLAS Build
6168
6269
Building the program with BLAS support may lead to some performance improvements in prompt processing using batch sizes higher than 32 (the default is 512). Using BLAS doesn't affect the generation performance. There are currently several different BLAS implementations available for build and use:

examples/server/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ The project is under active development, and we are [looking for feedback and co
146146
| `--host HOST` | ip address to listen (default: 127.0.0.1)<br/>(env: LLAMA_ARG_HOST) |
147147
| `--port PORT` | port to listen (default: 8080)<br/>(env: LLAMA_ARG_PORT) |
148148
| `--path PATH` | path to serve static files from (default: )<br/>(env: LLAMA_ARG_STATIC_PATH) |
149+
| `--no-webui` | disable the Web UI<br/>(env: LLAMA_ARG_NO_WEBUI) |
149150
| `--embedding, --embeddings` | restrict to only support embedding use case; use only with dedicated embedding models (default: disabled)<br/>(env: LLAMA_ARG_EMBEDDINGS) |
150151
| `--reranking, --rerank` | enable reranking endpoint on server (default: disabled)<br/>(env: LLAMA_ARG_RERANKING) |
151152
| `--api-key KEY` | API key to use for authentication (default: none)<br/>(env: LLAMA_API_KEY) |

0 commit comments

Comments
 (0)