@fugood/llama.node 0.3.16 → 0.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +3 -0
- package/bin/darwin/arm64/llama-node.node +0 -0
- package/bin/darwin/x64/llama-node.node +0 -0
- package/bin/linux/arm64/llama-node.node +0 -0
- package/bin/linux/x64/llama-node.node +0 -0
- package/bin/linux-cuda/arm64/llama-node.node +0 -0
- package/bin/linux-cuda/x64/llama-node.node +0 -0
- package/bin/linux-vulkan/arm64/llama-node.node +0 -0
- package/bin/linux-vulkan/x64/llama-node.node +0 -0
- package/bin/win32/arm64/llama-node.node +0 -0
- package/bin/win32/arm64/node.lib +0 -0
- package/bin/win32/x64/llama-node.node +0 -0
- package/bin/win32/x64/node.lib +0 -0
- package/bin/win32-vulkan/arm64/llama-node.node +0 -0
- package/bin/win32-vulkan/arm64/node.lib +0 -0
- package/bin/win32-vulkan/x64/llama-node.node +0 -0
- package/bin/win32-vulkan/x64/node.lib +0 -0
- package/lib/binding.ts +5 -0
- package/package.json +1 -1
- package/src/LlamaCompletionWorker.cpp +8 -0
- package/src/LlamaCompletionWorker.h +1 -0
- package/src/LlamaContext.cpp +3 -2
- package/src/llama.cpp/.github/workflows/build-linux-cross.yml +124 -0
- package/src/llama.cpp/.github/workflows/build.yml +70 -27
- package/src/llama.cpp/.github/workflows/docker.yml +6 -6
- package/src/llama.cpp/.github/workflows/server.yml +7 -11
- package/src/llama.cpp/CMakeLists.txt +23 -1
- package/src/llama.cpp/common/CMakeLists.txt +6 -3
- package/src/llama.cpp/common/arg.cpp +809 -105
- package/src/llama.cpp/common/arg.h +9 -0
- package/src/llama.cpp/common/chat.cpp +1 -1
- package/src/llama.cpp/common/common.cpp +31 -521
- package/src/llama.cpp/common/common.h +17 -36
- package/src/llama.cpp/common/json-schema-to-grammar.cpp +3 -0
- package/src/llama.cpp/common/llguidance.cpp +30 -47
- package/src/llama.cpp/common/minja/chat-template.hpp +15 -7
- package/src/llama.cpp/common/minja/minja.hpp +119 -93
- package/src/llama.cpp/common/sampling.cpp +3 -0
- package/src/llama.cpp/docs/build.md +122 -7
- package/src/llama.cpp/examples/CMakeLists.txt +0 -9
- package/src/llama.cpp/examples/batched/batched.cpp +1 -1
- package/src/llama.cpp/examples/batched-bench/batched-bench.cpp +1 -1
- package/src/llama.cpp/examples/embedding/embedding.cpp +7 -1
- package/src/llama.cpp/examples/export-lora/export-lora.cpp +1 -1
- package/src/llama.cpp/examples/gguf-split/gguf-split.cpp +15 -16
- package/src/llama.cpp/examples/gritlm/gritlm.cpp +1 -1
- package/src/llama.cpp/examples/llama-bench/llama-bench.cpp +210 -8
- package/src/llama.cpp/examples/llama.android/llama/build.gradle.kts +1 -0
- package/src/llama.cpp/examples/llava/CMakeLists.txt +39 -24
- package/src/llama.cpp/examples/llava/clip-impl.h +345 -0
- package/src/llama.cpp/examples/llava/clip.cpp +2152 -1803
- package/src/llama.cpp/examples/llava/clip.h +39 -22
- package/src/llama.cpp/examples/llava/deprecation-warning.cpp +22 -0
- package/src/llama.cpp/examples/llava/llava.cpp +64 -52
- package/src/llama.cpp/examples/llava/mtmd-cli.cpp +344 -0
- package/src/llama.cpp/examples/llava/mtmd.cpp +708 -0
- package/src/llama.cpp/examples/llava/mtmd.h +168 -0
- package/src/llama.cpp/examples/llava/{qwen2vl-cli.cpp → qwen2vl-test.cpp} +83 -31
- package/src/llama.cpp/examples/main/main.cpp +16 -5
- package/src/llama.cpp/examples/parallel/parallel.cpp +3 -1
- package/src/llama.cpp/examples/passkey/passkey.cpp +1 -1
- package/src/llama.cpp/examples/perplexity/perplexity.cpp +17 -3
- package/src/llama.cpp/examples/quantize/quantize.cpp +115 -2
- package/src/llama.cpp/examples/rpc/CMakeLists.txt +4 -2
- package/src/llama.cpp/examples/rpc/rpc-server.cpp +163 -8
- package/src/llama.cpp/examples/run/CMakeLists.txt +12 -1
- package/src/llama.cpp/examples/run/run.cpp +14 -28
- package/src/llama.cpp/examples/server/httplib.h +313 -247
- package/src/llama.cpp/examples/server/server.cpp +238 -139
- package/src/llama.cpp/examples/server/utils.hpp +51 -2
- package/src/llama.cpp/examples/speculative/speculative.cpp +1 -1
- package/src/llama.cpp/examples/speculative-simple/speculative-simple.cpp +1 -1
- package/src/llama.cpp/examples/sycl/build.sh +2 -2
- package/src/llama.cpp/examples/sycl/win-build-sycl.bat +2 -2
- package/src/llama.cpp/examples/tts/tts.cpp +6 -9
- package/src/llama.cpp/ggml/CMakeLists.txt +8 -2
- package/src/llama.cpp/ggml/cmake/GitVars.cmake +22 -0
- package/src/llama.cpp/ggml/include/ggml-cpu.h +5 -0
- package/src/llama.cpp/ggml/include/ggml-rpc.h +6 -1
- package/src/llama.cpp/ggml/include/ggml.h +66 -99
- package/src/llama.cpp/ggml/src/CMakeLists.txt +10 -7
- package/src/llama.cpp/ggml/src/ggml-cann/CMakeLists.txt +0 -2
- package/src/llama.cpp/ggml/src/ggml-cann/acl_tensor.cpp +8 -4
- package/src/llama.cpp/ggml/src/ggml-cann/acl_tensor.h +5 -5
- package/src/llama.cpp/ggml/src/ggml-cann/aclnn_ops.cpp +692 -1534
- package/src/llama.cpp/ggml/src/ggml-cann/aclnn_ops.h +613 -122
- package/src/llama.cpp/ggml/src/ggml-cann/common.h +135 -1
- package/src/llama.cpp/ggml/src/ggml-cann/ggml-cann.cpp +507 -137
- package/src/llama.cpp/ggml/src/ggml-common.h +12 -6
- package/src/llama.cpp/ggml/src/ggml-cpu/CMakeLists.txt +48 -22
- package/src/llama.cpp/ggml/src/ggml-cpu/binary-ops.cpp +158 -0
- package/src/llama.cpp/ggml/src/ggml-cpu/binary-ops.h +16 -0
- package/src/llama.cpp/ggml/src/ggml-cpu/common.h +72 -0
- package/src/llama.cpp/ggml/src/ggml-cpu/cpu-feats-x86.cpp +1 -1
- package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp +896 -192
- package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-impl.h +2 -21
- package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c +754 -404
- package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.c +1003 -13519
- package/src/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.cpp +2 -0
- package/src/llama.cpp/ggml/src/ggml-cpu/kleidiai/kernels.cpp +2 -7
- package/src/llama.cpp/ggml/src/ggml-cpu/kleidiai/kernels.h +0 -1
- package/src/llama.cpp/ggml/src/ggml-cpu/kleidiai/kleidiai.cpp +3 -4
- package/src/llama.cpp/ggml/src/ggml-cpu/llamafile/sgemm.cpp +533 -88
- package/src/llama.cpp/ggml/src/ggml-cpu/ops.cpp +8809 -0
- package/src/llama.cpp/ggml/src/ggml-cpu/ops.h +110 -0
- package/src/llama.cpp/ggml/src/ggml-cpu/simd-mappings.h +892 -0
- package/src/llama.cpp/ggml/src/ggml-cpu/unary-ops.cpp +186 -0
- package/src/llama.cpp/ggml/src/ggml-cpu/unary-ops.h +28 -0
- package/src/llama.cpp/ggml/src/ggml-cpu/vec.cpp +258 -0
- package/src/llama.cpp/ggml/src/ggml-cpu/vec.h +802 -0
- package/src/llama.cpp/ggml/src/ggml-cuda/vendors/hip.h +7 -0
- package/src/llama.cpp/ggml/src/ggml-cuda/vendors/musa.h +1 -0
- package/src/llama.cpp/ggml/src/ggml-hip/CMakeLists.txt +0 -4
- package/src/llama.cpp/ggml/src/ggml-impl.h +52 -18
- package/src/llama.cpp/ggml/src/ggml-metal/ggml-metal-impl.h +70 -3
- package/src/llama.cpp/ggml/src/ggml-opencl/CMakeLists.txt +67 -119
- package/src/llama.cpp/ggml/src/ggml-opencl/ggml-opencl.cpp +1023 -260
- package/src/llama.cpp/ggml/src/ggml-rpc/ggml-rpc.cpp +293 -40
- package/src/llama.cpp/ggml/src/ggml-sycl/CMakeLists.txt +96 -22
- package/src/llama.cpp/ggml/src/ggml-sycl/backend.hpp +1 -0
- package/src/llama.cpp/ggml/src/ggml-sycl/binbcast.cpp +350 -0
- package/src/llama.cpp/ggml/src/ggml-sycl/binbcast.hpp +39 -0
- package/src/llama.cpp/ggml/src/ggml-sycl/common.cpp +0 -35
- package/src/llama.cpp/ggml/src/ggml-sycl/common.hpp +2 -292
- package/src/llama.cpp/ggml/src/ggml-sycl/dpct/helper.hpp +79 -90
- package/src/llama.cpp/ggml/src/ggml-sycl/element_wise.cpp +967 -438
- package/src/llama.cpp/ggml/src/ggml-sycl/element_wise.hpp +22 -23
- package/src/llama.cpp/ggml/src/ggml-sycl/getrows.cpp +24 -20
- package/src/llama.cpp/ggml/src/ggml-sycl/getrows.hpp +1 -4
- package/src/llama.cpp/ggml/src/ggml-sycl/ggml-sycl.cpp +204 -280
- package/src/llama.cpp/ggml/src/ggml-sycl/im2col.cpp +84 -74
- package/src/llama.cpp/ggml/src/ggml-sycl/im2col.hpp +1 -3
- package/src/llama.cpp/ggml/src/ggml-sycl/norm.cpp +37 -49
- package/src/llama.cpp/ggml/src/ggml-sycl/norm.hpp +7 -22
- package/src/llama.cpp/ggml/src/ggml-sycl/outprod.cpp +4 -14
- package/src/llama.cpp/ggml/src/ggml-sycl/rope.cpp +204 -118
- package/src/llama.cpp/ggml/src/ggml-sycl/rope.hpp +1 -3
- package/src/llama.cpp/ggml/src/ggml-vulkan/CMakeLists.txt +23 -0
- package/src/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp +646 -114
- package/src/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/CMakeLists.txt +12 -0
- package/src/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +17 -8
- package/src/llama.cpp/ggml/src/ggml.c +141 -245
- package/src/llama.cpp/ggml/src/gguf.cpp +1 -0
- package/src/llama.cpp/include/llama.h +30 -11
- package/src/llama.cpp/models/ggml-vocab-llama4.gguf.inp +112 -0
- package/src/llama.cpp/models/ggml-vocab-llama4.gguf.out +46 -0
- package/src/llama.cpp/models/ggml-vocab-pixtral.gguf.inp +112 -0
- package/src/llama.cpp/models/ggml-vocab-pixtral.gguf.out +46 -0
- package/src/llama.cpp/requirements/requirements-all.txt +2 -0
- package/src/llama.cpp/requirements/requirements-gguf_editor_gui.txt +3 -0
- package/src/llama.cpp/src/CMakeLists.txt +3 -2
- package/src/llama.cpp/src/llama-adapter.cpp +37 -1
- package/src/llama.cpp/src/llama-arch.cpp +160 -17
- package/src/llama.cpp/src/llama-arch.h +16 -0
- package/src/llama.cpp/src/llama-chat.cpp +82 -17
- package/src/llama.cpp/src/llama-chat.h +6 -2
- package/src/llama.cpp/src/llama-context.cpp +108 -92
- package/src/llama.cpp/src/llama-context.h +1 -2
- package/src/llama.cpp/src/llama-graph.cpp +189 -119
- package/src/llama.cpp/src/llama-graph.h +26 -6
- package/src/llama.cpp/src/llama-hparams.h +13 -0
- package/src/llama.cpp/src/llama-kv-cache.cpp +70 -123
- package/src/llama.cpp/src/llama-kv-cache.h +41 -115
- package/src/llama.cpp/src/llama-memory.h +1 -1
- package/src/llama.cpp/src/llama-mmap.cpp +1 -1
- package/src/llama.cpp/src/llama-model-loader.cpp +10 -5
- package/src/llama.cpp/src/llama-model-loader.h +5 -3
- package/src/llama.cpp/src/llama-model.cpp +1760 -534
- package/src/llama.cpp/src/llama-model.h +13 -1
- package/src/llama.cpp/src/llama-quant.cpp +29 -8
- package/src/llama.cpp/src/llama-sampling.cpp +7 -1
- package/src/llama.cpp/src/llama-vocab.cpp +44 -6
- package/src/llama.cpp/src/llama.cpp +1 -1
- package/src/llama.cpp/tests/CMakeLists.txt +43 -30
- package/src/llama.cpp/tests/test-arg-parser.cpp +51 -4
- package/src/llama.cpp/tests/test-backend-ops.cpp +82 -43
- package/src/llama.cpp/tests/test-chat-template.cpp +34 -13
- package/src/llama.cpp/tests/test-chat.cpp +12 -2
- package/src/llama.cpp/{examples/gbnf-validator/gbnf-validator.cpp → tests/test-gbnf-validator.cpp} +2 -2
- package/src/llama.cpp/tests/test-grammar-integration.cpp +3 -2
- package/src/llama.cpp/tests/test-grammar-llguidance.cpp +63 -2
- package/src/llama.cpp/tests/test-grammar-parser.cpp +3 -1
- package/src/llama.cpp/tests/test-json-schema-to-grammar.cpp +17 -1
- package/src/llama.cpp/tests/test-llama-grammar.cpp +2 -1
- package/src/llama.cpp/{examples/quantize-stats/quantize-stats.cpp → tests/test-quantize-stats.cpp} +3 -1
- package/src/llama.cpp/tests/test-tokenizer-1-bpe.cpp +2 -1
- package/src/llama.cpp/tests/test-tokenizer-1-spm.cpp +2 -1
- package/src/llama.cpp/examples/gbnf-validator/CMakeLists.txt +0 -5
- package/src/llama.cpp/examples/llava/gemma3-cli.cpp +0 -341
- package/src/llama.cpp/examples/llava/llava-cli.cpp +0 -332
- package/src/llama.cpp/examples/llava/minicpmv-cli.cpp +0 -354
- package/src/llama.cpp/examples/quantize-stats/CMakeLists.txt +0 -6
- package/src/llama.cpp/ggml/src/ggml-cann/kernels/CMakeLists.txt +0 -30
- package/src/llama.cpp/ggml/src/ggml-cann/kernels/ascendc_kernels.h +0 -19
- package/src/llama.cpp/ggml/src/ggml-cann/kernels/dup.cpp +0 -234
- package/src/llama.cpp/ggml/src/ggml-cann/kernels/get_row_f16.cpp +0 -197
- package/src/llama.cpp/ggml/src/ggml-cann/kernels/get_row_f32.cpp +0 -190
- package/src/llama.cpp/ggml/src/ggml-cann/kernels/get_row_q4_0.cpp +0 -204
- package/src/llama.cpp/ggml/src/ggml-cann/kernels/get_row_q8_0.cpp +0 -191
- package/src/llama.cpp/ggml/src/ggml-cann/kernels/quantize_f16_q8_0.cpp +0 -218
- package/src/llama.cpp/ggml/src/ggml-cann/kernels/quantize_f32_q8_0.cpp +0 -216
- package/src/llama.cpp/ggml/src/ggml-cann/kernels/quantize_float_to_q4_0.cpp +0 -295
package/CMakeLists.txt
CHANGED
|
@@ -69,12 +69,15 @@ endif()
|
|
|
69
69
|
|
|
70
70
|
set(LLAMA_BUILD_COMMON ON CACHE BOOL "Build common")
|
|
71
71
|
|
|
72
|
+
set(LLAMA_CURL OFF CACHE BOOL "Build curl")
|
|
73
|
+
|
|
72
74
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries")
|
|
73
75
|
add_subdirectory("src/llama.cpp")
|
|
74
76
|
|
|
75
77
|
include_directories(
|
|
76
78
|
${CMAKE_JS_INC}
|
|
77
79
|
"src/llama.cpp"
|
|
80
|
+
"src/llama.cpp/src"
|
|
78
81
|
)
|
|
79
82
|
|
|
80
83
|
file(
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/win32/arm64/node.lib
CHANGED
|
Binary file
|
|
Binary file
|
package/bin/win32/x64/node.lib
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/binding.ts
CHANGED
|
@@ -36,6 +36,10 @@ export type LlamaModelOptions = {
|
|
|
36
36
|
| 'iq4_nl'
|
|
37
37
|
| 'q5_0'
|
|
38
38
|
| 'q5_1'
|
|
39
|
+
/**
|
|
40
|
+
* Enable context shifting to handle prompts larger than context size
|
|
41
|
+
*/
|
|
42
|
+
ctx_shift?: boolean
|
|
39
43
|
use_mlock?: boolean
|
|
40
44
|
use_mmap?: boolean
|
|
41
45
|
vocab_only?: boolean
|
|
@@ -96,6 +100,7 @@ export type LlamaCompletionResult = {
|
|
|
96
100
|
tokens_predicted: number
|
|
97
101
|
tokens_evaluated: number
|
|
98
102
|
truncated: boolean
|
|
103
|
+
context_full: boolean
|
|
99
104
|
timings: {
|
|
100
105
|
prompt_n: number
|
|
101
106
|
prompt_ms: number
|
package/package.json
CHANGED
|
@@ -90,6 +90,12 @@ void LlamaCompletionWorker::Execute() {
|
|
|
90
90
|
for (int i = 0; i < max_len || _stop; i++) {
|
|
91
91
|
// check if we need to remove some tokens
|
|
92
92
|
if (embd->size() >= _params.n_ctx) {
|
|
93
|
+
if (!_params.ctx_shift) {
|
|
94
|
+
// Context is full and ctx_shift is disabled, so we need to stop
|
|
95
|
+
_result.context_full = true;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
|
|
93
99
|
const int n_left = n_cur - n_keep - 1;
|
|
94
100
|
const int n_discard = n_left / 2;
|
|
95
101
|
|
|
@@ -161,6 +167,8 @@ void LlamaCompletionWorker::OnOK() {
|
|
|
161
167
|
_result.tokens_predicted));
|
|
162
168
|
result.Set("truncated",
|
|
163
169
|
Napi::Boolean::New(env, _result.truncated));
|
|
170
|
+
result.Set("context_full",
|
|
171
|
+
Napi::Boolean::New(env, _result.context_full));
|
|
164
172
|
result.Set("text",
|
|
165
173
|
Napi::String::New(env, _result.text.c_str()));
|
|
166
174
|
|
package/src/LlamaContext.cpp
CHANGED
|
@@ -173,8 +173,8 @@ LlamaContext::LlamaContext(const Napi::CallbackInfo &info)
|
|
|
173
173
|
auto options = info[0].As<Napi::Object>();
|
|
174
174
|
|
|
175
175
|
common_params params;
|
|
176
|
-
params.model = get_option<std::string>(options, "model", "");
|
|
177
|
-
if (params.model.empty()) {
|
|
176
|
+
params.model.path = get_option<std::string>(options, "model", "");
|
|
177
|
+
if (params.model.path.empty()) {
|
|
178
178
|
Napi::TypeError::New(env, "Model is required").ThrowAsJavaScriptException();
|
|
179
179
|
}
|
|
180
180
|
|
|
@@ -211,6 +211,7 @@ LlamaContext::LlamaContext(const Napi::CallbackInfo &info)
|
|
|
211
211
|
params.flash_attn = get_option<bool>(options, "flash_attn", false);
|
|
212
212
|
params.cache_type_k = kv_cache_type_from_str(get_option<std::string>(options, "cache_type_k", "f16").c_str());
|
|
213
213
|
params.cache_type_v = kv_cache_type_from_str(get_option<std::string>(options, "cache_type_v", "f16").c_str());
|
|
214
|
+
params.ctx_shift = get_option<bool>(options, "ctx_shift", true);
|
|
214
215
|
|
|
215
216
|
params.use_mlock = get_option<bool>(options, "use_mlock", false);
|
|
216
217
|
params.use_mmap = get_option<bool>(options, "use_mmap", true);
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
name: Build on Linux using cross-compiler
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
ubuntu-latest-riscv64-cpu-cross:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- name: Setup Riscv
|
|
13
|
+
run: |
|
|
14
|
+
sudo dpkg --add-architecture riscv64
|
|
15
|
+
sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-ports|g' \
|
|
16
|
+
/etc/apt/sources.list /etc/apt/apt-mirrors.txt
|
|
17
|
+
sudo apt-get clean
|
|
18
|
+
sudo apt-get update
|
|
19
|
+
sudo apt-get install -y --no-install-recommends \
|
|
20
|
+
build-essential \
|
|
21
|
+
gcc-14-riscv64-linux-gnu \
|
|
22
|
+
g++-14-riscv64-linux-gnu \
|
|
23
|
+
libcurl4-openssl-dev:riscv64
|
|
24
|
+
|
|
25
|
+
- name: Build
|
|
26
|
+
run: |
|
|
27
|
+
cmake -B build -DCMAKE_BUILD_TYPE=Release \
|
|
28
|
+
-DGGML_OPENMP=OFF \
|
|
29
|
+
-DLLAMA_BUILD_EXAMPLES=ON \
|
|
30
|
+
-DLLAMA_BUILD_TESTS=OFF \
|
|
31
|
+
-DCMAKE_SYSTEM_NAME=Linux \
|
|
32
|
+
-DCMAKE_SYSTEM_PROCESSOR=riscv64 \
|
|
33
|
+
-DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
|
|
34
|
+
-DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14 \
|
|
35
|
+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
|
36
|
+
-DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64-linux-gnu \
|
|
37
|
+
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
|
|
38
|
+
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
|
39
|
+
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
|
|
40
|
+
|
|
41
|
+
cmake --build build --config Release -j $(nproc)
|
|
42
|
+
|
|
43
|
+
ubuntu-latest-riscv64-vulkan-cross:
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@v4
|
|
48
|
+
with:
|
|
49
|
+
fetch-depth: 0
|
|
50
|
+
|
|
51
|
+
- name: Setup Riscv
|
|
52
|
+
run: |
|
|
53
|
+
sudo dpkg --add-architecture riscv64
|
|
54
|
+
sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-ports|g' \
|
|
55
|
+
/etc/apt/sources.list /etc/apt/apt-mirrors.txt
|
|
56
|
+
sudo apt-get clean
|
|
57
|
+
sudo apt-get update
|
|
58
|
+
sudo apt-get install -y --no-install-recommends \
|
|
59
|
+
build-essential \
|
|
60
|
+
glslc \
|
|
61
|
+
gcc-14-riscv64-linux-gnu \
|
|
62
|
+
g++-14-riscv64-linux-gnu \
|
|
63
|
+
libvulkan-dev:riscv64 \
|
|
64
|
+
libcurl4-openssl-dev:riscv64
|
|
65
|
+
|
|
66
|
+
- name: Build
|
|
67
|
+
run: |
|
|
68
|
+
cmake -B build -DCMAKE_BUILD_TYPE=Release \
|
|
69
|
+
-DGGML_VULKAN=ON \
|
|
70
|
+
-DGGML_OPENMP=OFF \
|
|
71
|
+
-DLLAMA_BUILD_EXAMPLES=ON \
|
|
72
|
+
-DLLAMA_BUILD_TESTS=OFF \
|
|
73
|
+
-DCMAKE_SYSTEM_NAME=Linux \
|
|
74
|
+
-DCMAKE_SYSTEM_PROCESSOR=riscv64 \
|
|
75
|
+
-DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
|
|
76
|
+
-DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14 \
|
|
77
|
+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
|
78
|
+
-DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64-linux-gnu \
|
|
79
|
+
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
|
|
80
|
+
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
|
81
|
+
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
|
|
82
|
+
|
|
83
|
+
cmake --build build --config Release -j $(nproc)
|
|
84
|
+
|
|
85
|
+
ubuntu-latest-arm64-vulkan-cross:
|
|
86
|
+
runs-on: ubuntu-latest
|
|
87
|
+
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/checkout@v4
|
|
90
|
+
with:
|
|
91
|
+
fetch-depth: 0
|
|
92
|
+
|
|
93
|
+
- name: Setup Arm64
|
|
94
|
+
run: |
|
|
95
|
+
sudo dpkg --add-architecture arm64
|
|
96
|
+
sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-ports|g' \
|
|
97
|
+
/etc/apt/sources.list /etc/apt/apt-mirrors.txt
|
|
98
|
+
sudo apt-get clean
|
|
99
|
+
sudo apt-get update
|
|
100
|
+
sudo apt-get install -y --no-install-recommends \
|
|
101
|
+
build-essential \
|
|
102
|
+
glslc \
|
|
103
|
+
crossbuild-essential-arm64 \
|
|
104
|
+
libvulkan-dev:arm64 \
|
|
105
|
+
libcurl4-openssl-dev:arm64
|
|
106
|
+
|
|
107
|
+
- name: Build
|
|
108
|
+
run: |
|
|
109
|
+
cmake -B build -DCMAKE_BUILD_TYPE=Release \
|
|
110
|
+
-DGGML_VULKAN=ON \
|
|
111
|
+
-DGGML_OPENMP=OFF \
|
|
112
|
+
-DLLAMA_BUILD_EXAMPLES=ON \
|
|
113
|
+
-DLLAMA_BUILD_TESTS=OFF \
|
|
114
|
+
-DCMAKE_SYSTEM_NAME=Linux \
|
|
115
|
+
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
|
|
116
|
+
-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
|
|
117
|
+
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
|
|
118
|
+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
|
119
|
+
-DCMAKE_FIND_ROOT_PATH=/usr/lib/aarch64-linux-gnu \
|
|
120
|
+
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
|
|
121
|
+
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
|
122
|
+
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
|
|
123
|
+
|
|
124
|
+
cmake --build build --config Release -j $(nproc)
|
|
@@ -10,7 +10,7 @@ on:
|
|
|
10
10
|
push:
|
|
11
11
|
branches:
|
|
12
12
|
- master
|
|
13
|
-
paths: ['.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal', '**/*.comp']
|
|
13
|
+
paths: ['.github/workflows/build.yml', '.github/workflows/build-linux-cross.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal', '**/*.comp']
|
|
14
14
|
pull_request:
|
|
15
15
|
types: [opened, synchronize, reopened]
|
|
16
16
|
paths: ['.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal', '**/*.comp']
|
|
@@ -54,6 +54,7 @@ jobs:
|
|
|
54
54
|
continue-on-error: true
|
|
55
55
|
run: |
|
|
56
56
|
brew update
|
|
57
|
+
brew install curl
|
|
57
58
|
|
|
58
59
|
- name: Build
|
|
59
60
|
id: cmake_build
|
|
@@ -62,7 +63,6 @@ jobs:
|
|
|
62
63
|
cmake -B build \
|
|
63
64
|
-DCMAKE_BUILD_RPATH="@loader_path" \
|
|
64
65
|
-DLLAMA_FATAL_WARNINGS=ON \
|
|
65
|
-
-DLLAMA_CURL=ON \
|
|
66
66
|
-DGGML_METAL_USE_BF16=ON \
|
|
67
67
|
-DGGML_METAL_EMBED_LIBRARY=ON \
|
|
68
68
|
-DGGML_RPC=ON
|
|
@@ -92,7 +92,6 @@ jobs:
|
|
|
92
92
|
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
|
|
93
93
|
run: |
|
|
94
94
|
cp LICENSE ./build/bin/
|
|
95
|
-
cp examples/run/linenoise.cpp/LICENSE ./build/bin/LICENSE.linenoise.cpp
|
|
96
95
|
zip -r llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.zip ./build/bin/*
|
|
97
96
|
|
|
98
97
|
- name: Upload artifacts
|
|
@@ -123,6 +122,7 @@ jobs:
|
|
|
123
122
|
continue-on-error: true
|
|
124
123
|
run: |
|
|
125
124
|
brew update
|
|
125
|
+
brew install curl
|
|
126
126
|
|
|
127
127
|
- name: Build
|
|
128
128
|
id: cmake_build
|
|
@@ -133,7 +133,6 @@ jobs:
|
|
|
133
133
|
cmake -B build \
|
|
134
134
|
-DCMAKE_BUILD_RPATH="@loader_path" \
|
|
135
135
|
-DLLAMA_FATAL_WARNINGS=ON \
|
|
136
|
-
-DLLAMA_CURL=ON \
|
|
137
136
|
-DGGML_METAL=OFF \
|
|
138
137
|
-DGGML_RPC=ON
|
|
139
138
|
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
|
|
@@ -162,7 +161,6 @@ jobs:
|
|
|
162
161
|
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
|
|
163
162
|
run: |
|
|
164
163
|
cp LICENSE ./build/bin/
|
|
165
|
-
cp examples/run/linenoise.cpp/LICENSE ./build/bin/LICENSE.linenoise.cpp
|
|
166
164
|
zip -r llama-${{ steps.tag.outputs.name }}-bin-macos-x64.zip ./build/bin/*
|
|
167
165
|
|
|
168
166
|
- name: Upload artifacts
|
|
@@ -207,7 +205,6 @@ jobs:
|
|
|
207
205
|
run: |
|
|
208
206
|
cmake -B build \
|
|
209
207
|
-DLLAMA_FATAL_WARNINGS=ON \
|
|
210
|
-
-DLLAMA_CURL=ON \
|
|
211
208
|
-DGGML_RPC=ON
|
|
212
209
|
cmake --build build --config Release -j $(nproc)
|
|
213
210
|
|
|
@@ -246,7 +243,6 @@ jobs:
|
|
|
246
243
|
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
|
|
247
244
|
run: |
|
|
248
245
|
cp LICENSE ./build/bin/
|
|
249
|
-
cp examples/run/linenoise.cpp/LICENSE ./build/bin/LICENSE.linenoise.cpp
|
|
250
246
|
zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.zip ./build/bin/*
|
|
251
247
|
|
|
252
248
|
- name: Upload artifacts
|
|
@@ -281,7 +277,7 @@ jobs:
|
|
|
281
277
|
id: depends
|
|
282
278
|
run: |
|
|
283
279
|
sudo apt-get update
|
|
284
|
-
sudo apt-get install build-essential
|
|
280
|
+
sudo apt-get install build-essential libcurl4-openssl-dev
|
|
285
281
|
|
|
286
282
|
- name: Build
|
|
287
283
|
id: cmake_build
|
|
@@ -322,7 +318,7 @@ jobs:
|
|
|
322
318
|
id: depends
|
|
323
319
|
run: |
|
|
324
320
|
sudo apt-get update
|
|
325
|
-
sudo apt-get install build-essential
|
|
321
|
+
sudo apt-get install build-essential libcurl4-openssl-dev
|
|
326
322
|
|
|
327
323
|
- name: Build
|
|
328
324
|
id: cmake_build
|
|
@@ -360,7 +356,7 @@ jobs:
|
|
|
360
356
|
id: depends
|
|
361
357
|
run: |
|
|
362
358
|
sudo apt-get update
|
|
363
|
-
sudo apt-get install build-essential
|
|
359
|
+
sudo apt-get install build-essential libcurl4-openssl-dev
|
|
364
360
|
|
|
365
361
|
- name: Build
|
|
366
362
|
id: cmake_build
|
|
@@ -397,7 +393,7 @@ jobs:
|
|
|
397
393
|
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
|
|
398
394
|
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
|
|
399
395
|
sudo apt-get update -y
|
|
400
|
-
sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk
|
|
396
|
+
sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libcurl4-openssl-dev
|
|
401
397
|
|
|
402
398
|
- name: Build
|
|
403
399
|
id: cmake_build
|
|
@@ -431,7 +427,6 @@ jobs:
|
|
|
431
427
|
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
|
|
432
428
|
run: |
|
|
433
429
|
cp LICENSE ./build/bin/
|
|
434
|
-
cp examples/run/linenoise.cpp/LICENSE ./build/bin/LICENSE.linenoise.cpp
|
|
435
430
|
zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.zip ./build/bin/*
|
|
436
431
|
|
|
437
432
|
- name: Upload artifacts
|
|
@@ -454,7 +449,7 @@ jobs:
|
|
|
454
449
|
id: depends
|
|
455
450
|
run: |
|
|
456
451
|
sudo apt-get update
|
|
457
|
-
sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev
|
|
452
|
+
sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libcurl4-openssl-dev
|
|
458
453
|
|
|
459
454
|
- name: ccache
|
|
460
455
|
uses: hendrikmuhs/ccache-action@v1.2.16
|
|
@@ -530,7 +525,7 @@ jobs:
|
|
|
530
525
|
shell: bash
|
|
531
526
|
run: |
|
|
532
527
|
sudo apt update
|
|
533
|
-
sudo apt install intel-oneapi-compiler-dpcpp-cpp
|
|
528
|
+
sudo apt install intel-oneapi-compiler-dpcpp-cpp libcurl4-openssl-dev
|
|
534
529
|
|
|
535
530
|
- name: install oneAPI MKL library
|
|
536
531
|
shell: bash
|
|
@@ -578,7 +573,7 @@ jobs:
|
|
|
578
573
|
shell: bash
|
|
579
574
|
run: |
|
|
580
575
|
sudo apt update
|
|
581
|
-
sudo apt install intel-oneapi-compiler-dpcpp-cpp
|
|
576
|
+
sudo apt install intel-oneapi-compiler-dpcpp-cpp libcurl4-openssl-dev
|
|
582
577
|
|
|
583
578
|
- name: install oneAPI MKL library
|
|
584
579
|
shell: bash
|
|
@@ -606,6 +601,10 @@ jobs:
|
|
|
606
601
|
-DGGML_SYCL_F16=ON
|
|
607
602
|
cmake --build build --config Release -j $(nproc)
|
|
608
603
|
|
|
604
|
+
# Disabled for now due to sporadic issue syncing.
|
|
605
|
+
# build-linux-cross:
|
|
606
|
+
# uses: ./.github/workflows/build-linux-cross.yml
|
|
607
|
+
|
|
609
608
|
macOS-latest-cmake-ios:
|
|
610
609
|
runs-on: macos-latest
|
|
611
610
|
|
|
@@ -633,6 +632,7 @@ jobs:
|
|
|
633
632
|
cmake -B build -G Xcode \
|
|
634
633
|
-DGGML_METAL_USE_BF16=ON \
|
|
635
634
|
-DGGML_METAL_EMBED_LIBRARY=ON \
|
|
635
|
+
-DLLAMA_BUILD_COMMON=OFF \
|
|
636
636
|
-DLLAMA_BUILD_EXAMPLES=OFF \
|
|
637
637
|
-DLLAMA_BUILD_TESTS=OFF \
|
|
638
638
|
-DLLAMA_BUILD_SERVER=OFF \
|
|
@@ -668,6 +668,7 @@ jobs:
|
|
|
668
668
|
cmake -B build -G Xcode \
|
|
669
669
|
-DGGML_METAL_USE_BF16=ON \
|
|
670
670
|
-DGGML_METAL_EMBED_LIBRARY=ON \
|
|
671
|
+
-DLLAMA_BUILD_COMMON=OFF \
|
|
671
672
|
-DLLAMA_BUILD_EXAMPLES=OFF \
|
|
672
673
|
-DLLAMA_BUILD_TESTS=OFF \
|
|
673
674
|
-DLLAMA_BUILD_SERVER=OFF \
|
|
@@ -697,6 +698,7 @@ jobs:
|
|
|
697
698
|
cmake -B build -G Xcode \
|
|
698
699
|
-DGGML_METAL_USE_BF16=ON \
|
|
699
700
|
-DGGML_METAL_EMBED_LIBRARY=ON \
|
|
701
|
+
-DLLAMA_BUILD_COMMON=OFF \
|
|
700
702
|
-DLLAMA_BUILD_EXAMPLES=OFF \
|
|
701
703
|
-DLLAMA_BUILD_TESTS=OFF \
|
|
702
704
|
-DLLAMA_BUILD_SERVER=OFF \
|
|
@@ -736,6 +738,7 @@ jobs:
|
|
|
736
738
|
cmake -B build -G Xcode \
|
|
737
739
|
-DGGML_METAL_USE_BF16=ON \
|
|
738
740
|
-DGGML_METAL_EMBED_LIBRARY=ON \
|
|
741
|
+
-DLLAMA_CURL=OFF \
|
|
739
742
|
-DLLAMA_BUILD_EXAMPLES=OFF \
|
|
740
743
|
-DLLAMA_BUILD_TESTS=OFF \
|
|
741
744
|
-DLLAMA_BUILD_SERVER=OFF \
|
|
@@ -803,7 +806,7 @@ jobs:
|
|
|
803
806
|
env:
|
|
804
807
|
OPENBLAS_VERSION: 0.3.23
|
|
805
808
|
SDE_VERSION: 9.33.0-2024-01-07
|
|
806
|
-
VULKAN_VERSION: 1.4.
|
|
809
|
+
VULKAN_VERSION: 1.4.309.0
|
|
807
810
|
|
|
808
811
|
strategy:
|
|
809
812
|
matrix:
|
|
@@ -896,10 +899,17 @@ jobs:
|
|
|
896
899
|
-DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
|
|
897
900
|
cmake --build build-arm64-release --target install --config release
|
|
898
901
|
|
|
902
|
+
- name: libCURL
|
|
903
|
+
id: get_libcurl
|
|
904
|
+
uses: ./.github/actions/windows-setup-curl
|
|
905
|
+
|
|
899
906
|
- name: Build
|
|
900
907
|
id: cmake_build
|
|
908
|
+
env:
|
|
909
|
+
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
|
|
901
910
|
run: |
|
|
902
|
-
cmake -S . -B build ${{ matrix.defines }}
|
|
911
|
+
cmake -S . -B build ${{ matrix.defines }} `
|
|
912
|
+
-DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
|
|
903
913
|
cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
|
|
904
914
|
|
|
905
915
|
- name: Add libopenblas.dll
|
|
@@ -959,9 +969,10 @@ jobs:
|
|
|
959
969
|
- name: Pack artifacts
|
|
960
970
|
id: pack_artifacts
|
|
961
971
|
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
|
|
972
|
+
env:
|
|
973
|
+
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
|
|
962
974
|
run: |
|
|
963
|
-
Copy-Item
|
|
964
|
-
Copy-Item .\examples\run\linenoise.cpp\LICENSE .\build\bin\Release\linenoise.cpp.txt
|
|
975
|
+
Copy-Item $env:CURL_PATH\bin\libcurl-x64.dll .\build\bin\Release\libcurl-x64.dll
|
|
965
976
|
7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}.zip .\build\bin\Release\*
|
|
966
977
|
|
|
967
978
|
- name: Upload artifacts
|
|
@@ -987,7 +998,7 @@ jobs:
|
|
|
987
998
|
DEBIAN_FRONTEND: noninteractive
|
|
988
999
|
run: |
|
|
989
1000
|
apt update
|
|
990
|
-
apt install -y cmake build-essential ninja-build libgomp1 git
|
|
1001
|
+
apt install -y cmake build-essential ninja-build libgomp1 git libcurl4-openssl-dev
|
|
991
1002
|
|
|
992
1003
|
- name: ccache
|
|
993
1004
|
uses: hendrikmuhs/ccache-action@v1.2.16
|
|
@@ -1089,16 +1100,23 @@ jobs:
|
|
|
1089
1100
|
run: |
|
|
1090
1101
|
choco install ninja
|
|
1091
1102
|
|
|
1103
|
+
- name: libCURL
|
|
1104
|
+
id: get_libcurl
|
|
1105
|
+
uses: ./.github/actions/windows-setup-curl
|
|
1106
|
+
|
|
1092
1107
|
- name: Build
|
|
1093
1108
|
id: cmake_build
|
|
1094
1109
|
shell: cmd
|
|
1110
|
+
env:
|
|
1111
|
+
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
|
|
1095
1112
|
run: |
|
|
1096
1113
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
|
1097
1114
|
cmake -S . -B build -G "Ninja Multi-Config" ^
|
|
1098
1115
|
-DLLAMA_BUILD_SERVER=ON ^
|
|
1099
1116
|
-DGGML_NATIVE=OFF ^
|
|
1100
1117
|
-DGGML_CUDA=ON ^
|
|
1101
|
-
-DGGML_RPC=ON
|
|
1118
|
+
-DGGML_RPC=ON ^
|
|
1119
|
+
-DCURL_LIBRARY="%CURL_PATH%/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="%CURL_PATH%/include"
|
|
1102
1120
|
set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
|
|
1103
1121
|
cmake --build build --config Release -j %NINJA_JOBS% -t ggml
|
|
1104
1122
|
cmake --build build --config Release
|
|
@@ -1119,7 +1137,10 @@ jobs:
|
|
|
1119
1137
|
- name: Pack artifacts
|
|
1120
1138
|
id: pack_artifacts
|
|
1121
1139
|
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
|
|
1140
|
+
env:
|
|
1141
|
+
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
|
|
1122
1142
|
run: |
|
|
1143
|
+
cp $env:CURL_PATH\bin\libcurl-x64.dll .\build\bin\Release\libcurl-x64.dll
|
|
1123
1144
|
7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip .\build\bin\Release\*
|
|
1124
1145
|
|
|
1125
1146
|
- name: Upload artifacts
|
|
@@ -1174,6 +1195,8 @@ jobs:
|
|
|
1174
1195
|
run: |
|
|
1175
1196
|
scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
|
|
1176
1197
|
|
|
1198
|
+
# TODO: add libcurl support ; we will also need to modify win-build-sycl.bat to accept user-specified args
|
|
1199
|
+
|
|
1177
1200
|
- name: Build
|
|
1178
1201
|
id: cmake_build
|
|
1179
1202
|
run: examples/sycl/win-build-sycl.bat
|
|
@@ -1259,8 +1282,14 @@ jobs:
|
|
|
1259
1282
|
key: ${{ github.job }}
|
|
1260
1283
|
evict-old-files: 1d
|
|
1261
1284
|
|
|
1285
|
+
- name: libCURL
|
|
1286
|
+
id: get_libcurl
|
|
1287
|
+
uses: ./.github/actions/windows-setup-curl
|
|
1288
|
+
|
|
1262
1289
|
- name: Build
|
|
1263
1290
|
id: cmake_build
|
|
1291
|
+
env:
|
|
1292
|
+
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
|
|
1264
1293
|
run: |
|
|
1265
1294
|
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
|
|
1266
1295
|
$env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
|
|
@@ -1271,9 +1300,11 @@ jobs:
|
|
|
1271
1300
|
-DCMAKE_BUILD_TYPE=Release `
|
|
1272
1301
|
-DGGML_HIP=ON `
|
|
1273
1302
|
-DGGML_HIP_ROCWMMA_FATTN=ON `
|
|
1274
|
-
-DGGML_RPC=ON
|
|
1303
|
+
-DGGML_RPC=ON `
|
|
1304
|
+
-DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
|
|
1275
1305
|
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
|
|
1276
1306
|
|
|
1307
|
+
# TODO: reuse windows-latest-cmake-hip instead of duplicating this job
|
|
1277
1308
|
windows-latest-cmake-hip-release:
|
|
1278
1309
|
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
|
|
1279
1310
|
runs-on: windows-latest
|
|
@@ -1315,8 +1346,14 @@ jobs:
|
|
|
1315
1346
|
run: |
|
|
1316
1347
|
& 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
|
|
1317
1348
|
|
|
1349
|
+
- name: libCURL
|
|
1350
|
+
id: get_libcurl
|
|
1351
|
+
uses: ./.github/actions/windows-setup-curl
|
|
1352
|
+
|
|
1318
1353
|
- name: Build
|
|
1319
1354
|
id: cmake_build
|
|
1355
|
+
env:
|
|
1356
|
+
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
|
|
1320
1357
|
run: |
|
|
1321
1358
|
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
|
|
1322
1359
|
$env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
|
|
@@ -1328,7 +1365,8 @@ jobs:
|
|
|
1328
1365
|
-DAMDGPU_TARGETS=${{ matrix.gpu_target }} `
|
|
1329
1366
|
-DGGML_HIP_ROCWMMA_FATTN=ON `
|
|
1330
1367
|
-DGGML_HIP=ON `
|
|
1331
|
-
-DGGML_RPC=ON
|
|
1368
|
+
-DGGML_RPC=ON `
|
|
1369
|
+
-DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
|
|
1332
1370
|
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
|
|
1333
1371
|
md "build\bin\rocblas\library\"
|
|
1334
1372
|
cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
|
|
@@ -1350,7 +1388,10 @@ jobs:
|
|
|
1350
1388
|
|
|
1351
1389
|
- name: Pack artifacts
|
|
1352
1390
|
id: pack_artifacts
|
|
1391
|
+
env:
|
|
1392
|
+
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
|
|
1353
1393
|
run: |
|
|
1394
|
+
cp $env:CURL_PATH\bin\libcurl-x64.dll .\build\bin\libcurl-x64.dll
|
|
1354
1395
|
7z a llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip .\build\bin\*
|
|
1355
1396
|
|
|
1356
1397
|
- name: Upload artifacts
|
|
@@ -1375,6 +1416,7 @@ jobs:
|
|
|
1375
1416
|
cmake -B build -G Xcode \
|
|
1376
1417
|
-DGGML_METAL_USE_BF16=ON \
|
|
1377
1418
|
-DGGML_METAL_EMBED_LIBRARY=ON \
|
|
1419
|
+
-DLLAMA_CURL=OFF \
|
|
1378
1420
|
-DLLAMA_BUILD_EXAMPLES=OFF \
|
|
1379
1421
|
-DLLAMA_BUILD_TESTS=OFF \
|
|
1380
1422
|
-DLLAMA_BUILD_SERVER=OFF \
|
|
@@ -1725,16 +1767,17 @@ jobs:
|
|
|
1725
1767
|
if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'Ascend NPU') }}
|
|
1726
1768
|
defaults:
|
|
1727
1769
|
run:
|
|
1728
|
-
|
|
1729
|
-
runs-on: ubuntu-24.04-arm
|
|
1770
|
+
shell: bash -el {0}
|
|
1730
1771
|
strategy:
|
|
1731
1772
|
matrix:
|
|
1773
|
+
arch: [x86, aarch64]
|
|
1732
1774
|
cann:
|
|
1733
|
-
- '8.
|
|
1775
|
+
- '8.1.RC1.alpha001-910b-openeuler22.03-py3.10'
|
|
1734
1776
|
device:
|
|
1735
1777
|
- 'ascend910b3'
|
|
1736
1778
|
build:
|
|
1737
1779
|
- 'Release'
|
|
1780
|
+
runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
|
|
1738
1781
|
container: ascendai/cann:${{ matrix.cann }}
|
|
1739
1782
|
steps:
|
|
1740
1783
|
- name: Checkout
|
|
@@ -1743,7 +1786,7 @@ jobs:
|
|
|
1743
1786
|
- name: Dependencies
|
|
1744
1787
|
run: |
|
|
1745
1788
|
yum update -y
|
|
1746
|
-
yum install -y git gcc gcc-c++ make cmake
|
|
1789
|
+
yum install -y git gcc gcc-c++ make cmake libcurl-devel
|
|
1747
1790
|
|
|
1748
1791
|
- name: Build
|
|
1749
1792
|
run: |
|
|
@@ -36,13 +36,13 @@ jobs:
|
|
|
36
36
|
matrix:
|
|
37
37
|
config:
|
|
38
38
|
# Multi-stage build
|
|
39
|
-
- { tag: "cpu", dockerfile: ".devops/cpu.Dockerfile", platforms: "linux/amd64,linux/arm64", full: true, light: true, server: true,
|
|
40
|
-
- { tag: "cuda", dockerfile: ".devops/cuda.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true,
|
|
41
|
-
- { tag: "musa", dockerfile: ".devops/musa.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true,
|
|
42
|
-
- { tag: "intel", dockerfile: ".devops/intel.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true,
|
|
43
|
-
- { tag: "vulkan", dockerfile: ".devops/vulkan.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true,
|
|
39
|
+
- { tag: "cpu", dockerfile: ".devops/cpu.Dockerfile", platforms: "linux/amd64,linux/arm64", full: true, light: true, server: true, free_disk_space: false }
|
|
40
|
+
- { tag: "cuda", dockerfile: ".devops/cuda.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false }
|
|
41
|
+
- { tag: "musa", dockerfile: ".devops/musa.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true }
|
|
42
|
+
- { tag: "intel", dockerfile: ".devops/intel.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false }
|
|
43
|
+
- { tag: "vulkan", dockerfile: ".devops/vulkan.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false }
|
|
44
44
|
# Note: the rocm images are failing due to a compiler error and are disabled until this is fixed to allow the workflow to complete
|
|
45
|
-
#- {tag: "rocm", dockerfile: ".devops/rocm.Dockerfile", platforms: "linux/amd64,linux/arm64", full: true, light: true, server: true,
|
|
45
|
+
#- {tag: "rocm", dockerfile: ".devops/rocm.Dockerfile", platforms: "linux/amd64,linux/arm64", full: true, light: true, server: true, free_disk_space: true }
|
|
46
46
|
steps:
|
|
47
47
|
- name: Check out the repo
|
|
48
48
|
uses: actions/checkout@v4
|