Skip to content

Commit 157fac7

Browse files
committed
Merge commit 'c342c3b93de358a4571941b41c35dc5ba2081145' into concedo_experimental
# Conflicts: # .github/workflows/build.yml # CODEOWNERS # scripts/sync_vendor.py
2 parents de3ed7d + c342c3b commit 157fac7

6 files changed

Lines changed: 330 additions & 77 deletions

File tree

common/debug.cpp

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ static float common_ggml_get_float_value(const uint8_t * data,
4545
return v;
4646
}
4747

48+
#define INDENT " "
49+
4850
template <bool abort>
4951
void common_debug_print_tensor(uint8_t * data, ggml_type type, const int64_t * ne, const size_t * nb, int64_t n) {
5052
GGML_ASSERT(n > 0);
@@ -60,41 +62,41 @@ void common_debug_print_tensor(uint8_t * data, ggml_type type, const int64_t * n
6062
}
6163
}
6264
for (int64_t i3 = 0; i3 < ne[3]; i3++) {
63-
LOG_ERR(" [\n");
65+
LOG(INDENT "[\n");
6466
for (int64_t i2 = 0; i2 < ne[2]; i2++) {
6567
if (i2 == n && ne[2] > 2 * n) {
66-
LOG_ERR(" ..., \n");
68+
LOG(INDENT INDENT "..., \n");
6769
i2 = ne[2] - n;
6870
}
69-
LOG_ERR(" [\n");
71+
LOG(INDENT INDENT "[\n");
7072
for (int64_t i1 = 0; i1 < ne[1]; i1++) {
7173
if (i1 == n && ne[1] > 2 * n) {
72-
LOG_ERR(" ..., \n");
74+
LOG(INDENT INDENT INDENT "..., \n");
7375
i1 = ne[1] - n;
7476
}
75-
LOG_ERR(" [");
77+
LOG(INDENT INDENT INDENT "[");
7678
for (int64_t i0 = 0; i0 < ne[0]; i0++) {
7779
if (i0 == n && ne[0] > 2 * n) {
78-
LOG_ERR("..., ");
80+
LOG(" ..., ");
7981
i0 = ne[0] - n;
8082
}
8183
const float v = common_ggml_get_float_value(data, type, nb, i0, i1, i2, i3);
82-
LOG_ERR("%12.4f", v);
84+
LOG("%12.4f", v);
8385
if (i0 < ne[0] - 1) {
84-
LOG_ERR(", ");
86+
LOG(", ");
8587
}
8688
}
87-
LOG_ERR("],\n");
89+
LOG(" ],\n");
8890
}
89-
LOG_ERR(" ],\n");
91+
LOG(INDENT INDENT "],\n");
9092
}
91-
LOG_ERR(" ]\n");
92-
LOG_ERR(" sum = %f\n", sum);
93+
LOG(INDENT "]\n");
94+
LOG(INDENT "sum = %f\n", sum);
9395
}
9496

9597
if constexpr (abort) {
9698
if (std::isnan(sum)) {
97-
LOG_ERR("encountered NaN - aborting\n");
99+
LOG("encountered NaN - aborting\n");
98100
exit(0);
99101
}
100102
}
@@ -137,9 +139,9 @@ template <bool abort_on_nan> bool common_debug_cb_eval(struct ggml_tensor * t, b
137139
}
138140

139141
if (matches_filter) {
140-
LOG_ERR("%s: %24s = (%s) %10s(%s{%s}, %s}) = {%s}\n", __func__, t->name, ggml_type_name(t->type),
141-
ggml_op_desc(t), src0->name, common_ggml_ne_string(src0).c_str(), src1 ? src1_str : "",
142-
common_ggml_ne_string(t).c_str());
142+
LOG("%s: %24s = (%s) %10s(%s{%s}, %s}) = {%s}\n", __func__, t->name, ggml_type_name(t->type),
143+
ggml_op_desc(t), src0->name, common_ggml_ne_string(src0).c_str(), src1 ? src1_str : "",
144+
common_ggml_ne_string(t).c_str());
143145
}
144146

145147
const bool is_host = ggml_backend_buffer_is_host(t->buffer);

ggml/src/ggml-metal/ggml-metal.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#include "ggml-metal-context.h"
88
#include "ggml-metal-ops.h"
99

10+
#include <mutex>
11+
#include <string>
12+
1013
#define GGML_METAL_NAME "MTL"
1114
#define GGML_METAL_MAX_DEVICES 16
1215

src/models/qwen3next.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,13 @@ std::pair<ggml_tensor *, ggml_tensor *> llm_build_qwen3next::build_delta_net_chu
265265
cb(g_diff, "g_diff", il); // shape: (chunk_size, 1, n_chunks, H_v * n_seqs)
266266

267267
ggml_tensor * g_diff_exp = ggml_exp(ctx0, g_diff);
268-
ggml_tensor * g_diff_exp_t = ggml_reshape_4d(ctx0, g_diff_exp,
268+
ggml_tensor * g_diff_exp_t = ggml_reshape_4d(ctx0, g_diff_exp,
269269
1, chunk_size, n_chunks, g_diff_exp->ne[3]);
270270

271271
ggml_tensor * key_gdiff = ggml_mul(ctx0, k, g_diff_exp_t);
272272
cb(key_gdiff, "key_gdiff", il); // shape: (S_k, chunk_size, n_chunks, H_v * n_seqs)
273273

274-
ggml_tensor * key_gdiff_t = ggml_cont(ctx0, ggml_transpose(ctx0, key_gdiff));
274+
ggml_tensor * key_gdiff_t = ggml_cont(ctx0, ggml_transpose(ctx0, key_gdiff));
275275
cb(key_gdiff_t, "key_gdiff_t", il); // shape: (chunk_size, S_k, n_chunks, H_v * n_seqs)
276276

277277

vendor/cpp-httplib/CMakeLists.txt

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ license_add_file("cpp-httplib" "LICENSE")
33

44
find_package(Threads REQUIRED)
55

6+
llama_add_compile_flags()
7+
68
add_library(${TARGET} STATIC httplib.cpp httplib.h)
7-
if (NOT MSVC)
8-
# disable warnings in 3rd party code
9+
10+
# disable warnings in 3rd party code
11+
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
12+
target_compile_options(${TARGET} PRIVATE /w)
13+
else()
914
target_compile_options(${TARGET} PRIVATE -w)
1015
endif()
1116

@@ -146,6 +151,23 @@ elseif (LLAMA_OPENSSL)
146151
endif()
147152
endif()
148153

154+
# disable warnings in 3rd party code
155+
if(LLAMA_BUILD_BORINGSSL OR LLAMA_BUILD_LIBRESSL)
156+
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
157+
target_compile_options(ssl PRIVATE /w)
158+
target_compile_options(crypto PRIVATE /w)
159+
if(LLAMA_BUILD_BORINGSSL)
160+
target_compile_options(fipsmodule PRIVATE /w)
161+
endif()
162+
else()
163+
target_compile_options(ssl PRIVATE -w)
164+
target_compile_options(crypto PRIVATE -w)
165+
if(LLAMA_BUILD_BORINGSSL)
166+
target_compile_options(fipsmodule PRIVATE -w)
167+
endif()
168+
endif()
169+
endif()
170+
149171
if (CPPHTTPLIB_OPENSSL_SUPPORT)
150172
target_compile_definitions(${TARGET} PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT) # used in server.cpp
151173
if (APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")

0 commit comments

Comments
 (0)