Skip to content

Commit db43f4d

Browse files
committed
Revert "Merge branch 'ggml-org:master' into master"
This reverts commit fe4acc6, reversing changes made to b2cc147.
1 parent fe4acc6 commit db43f4d

30 files changed

+114
-484
lines changed

.github/workflows/build-linux-cross.yml

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,18 @@ on:
44
workflow_call:
55

66
jobs:
7-
ubuntu-24-riscv64-cpu-cross:
8-
runs-on: ubuntu-24.04
7+
ubuntu-latest-riscv64-cpu-cross:
8+
runs-on: ubuntu-latest
99

1010
steps:
1111
- uses: actions/checkout@v4
1212
- name: Setup Riscv
1313
run: |
1414
sudo dpkg --add-architecture riscv64
15-
16-
# Add arch-specific repositories for non-amd64 architectures
17-
cat << EOF | sudo tee /etc/apt/sources.list.d/riscv64-ports.list
18-
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
19-
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
20-
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
21-
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
22-
EOF
23-
24-
sudo apt-get update || true ;# Prevent failure due to missing URLs.
25-
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
2619
sudo apt-get install -y --no-install-recommends \
2720
build-essential \
2821
gcc-14-riscv64-linux-gnu \
@@ -47,25 +40,21 @@ jobs:
4740
4841
cmake --build build --config Release -j $(nproc)
4942
50-
ubuntu-24-riscv64-vulkan-cross:
51-
runs-on: ubuntu-24.04
43+
ubuntu-latest-riscv64-vulkan-cross:
44+
runs-on: ubuntu-latest
5245

5346
steps:
5447
- uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
50+
5551
- name: Setup Riscv
5652
run: |
5753
sudo dpkg --add-architecture riscv64
58-
59-
# Add arch-specific repositories for non-amd64 architectures
60-
cat << EOF | sudo tee /etc/apt/sources.list.d/riscv64-ports.list
61-
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
62-
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
63-
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
64-
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
65-
EOF
66-
67-
sudo apt-get update || true ;# Prevent failure due to missing URLs.
68-
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
6958
sudo apt-get install -y --no-install-recommends \
7059
build-essential \
7160
glslc \
@@ -93,25 +82,21 @@ jobs:
9382
9483
cmake --build build --config Release -j $(nproc)
9584
96-
ubuntu-24-arm64-vulkan-cross:
97-
runs-on: ubuntu-24.04
85+
ubuntu-latest-arm64-vulkan-cross:
86+
runs-on: ubuntu-latest
9887

9988
steps:
10089
- uses: actions/checkout@v4
90+
with:
91+
fetch-depth: 0
92+
10193
- name: Setup Arm64
10294
run: |
10395
sudo dpkg --add-architecture arm64
104-
105-
# Add arch-specific repositories for non-amd64 architectures
106-
cat << EOF | sudo tee /etc/apt/sources.list.d/arm64-ports.list
107-
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
108-
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
109-
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
110-
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
111-
EOF
112-
113-
sudo apt-get update || true ;# Prevent failure due to missing URLs.
114-
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
115100
sudo apt-get install -y --no-install-recommends \
116101
build-essential \
117102
glslc \

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,9 @@ jobs:
601601
-DGGML_SYCL_F16=ON
602602
cmake --build build --config Release -j $(nproc)
603603
604-
build-linux-cross:
605-
uses: ./.github/workflows/build-linux-cross.yml
604+
# Disabled for now due to sporadic issue syncing.
605+
# build-linux-cross:
606+
# uses: ./.github/workflows/build-linux-cross.yml
606607

607608
macOS-latest-cmake-ios:
608609
runs-on: macos-latest

cmake/build-info.cmake

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,14 @@ endif()
4141

4242
if(MSVC)
4343
set(BUILD_COMPILER "${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
44-
if (CMAKE_VS_PLATFORM_NAME)
45-
set(BUILD_TARGET ${CMAKE_VS_PLATFORM_NAME})
46-
else()
47-
set(BUILD_TARGET "${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}")
48-
endif()
44+
set(BUILD_TARGET ${CMAKE_VS_PLATFORM_NAME})
4945
else()
5046
execute_process(
51-
COMMAND ${CMAKE_C_COMPILER} --version
47+
COMMAND sh -c "\"$@\" --version | head -1" _ ${CMAKE_C_COMPILER}
5248
OUTPUT_VARIABLE OUT
5349
OUTPUT_STRIP_TRAILING_WHITESPACE
5450
)
55-
string(REGEX REPLACE " *\n.*" "" OUT "${OUT}")
5651
set(BUILD_COMPILER ${OUT})
57-
5852
execute_process(
5953
COMMAND ${CMAKE_C_COMPILER} -dumpmachine
6054
OUTPUT_VARIABLE OUT

common/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ add_custom_command(
3939
COMMENT "Generating build details from Git"
4040
COMMAND ${CMAKE_COMMAND} -DMSVC=${MSVC} -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}
4141
-DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} -DCMAKE_VS_PLATFORM_NAME=${CMAKE_VS_PLATFORM_NAME}
42-
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
43-
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}
44-
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/build-info-gen-cpp.cmake"
42+
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/build-info-gen-cpp.cmake"
4543
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.."
4644
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/build-info.cpp.in" ${GIT_INDEX}
4745
VERBATIM

common/arg.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2783,10 +2783,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
27832783
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_THREADS_HTTP"));
27842784
add_opt(common_arg(
27852785
{"--cache-reuse"}, "N",
2786-
string_format(
2787-
"min chunk size to attempt reusing from the cache via KV shifting (default: %d)\n"
2788-
"[(card)](https://ggml.ai/f0.png)", params.n_cache_reuse
2789-
),
2786+
string_format("min chunk size to attempt reusing from the cache via KV shifting (default: %d)", params.n_cache_reuse),
27902787
[](common_params & params, int value) {
27912788
params.n_cache_reuse = value;
27922789
}

convert_hf_to_gguf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,7 @@ def get_model_part_names(dir_model: Path, prefix: str, suffix: str) -> list[str]
419419
@staticmethod
420420
def load_hparams(dir_model: Path):
421421
try:
422-
# for security reason, we don't allow loading remote code by default
423-
# if a model need remote code, we will fallback to config.json
424-
return AutoConfig.from_pretrained(dir_model, trust_remote_code=False).to_dict()
422+
return AutoConfig.from_pretrained(dir_model).to_dict()
425423
except Exception as e:
426424
logger.warning(f"Failed to load model config from {dir_model}: {e}")
427425
logger.warning("Trying to load config.json instead")

examples/llava/clip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2561,7 +2561,7 @@ struct llava_uhd {
25612561

25622562
// no pinpoints, dynamically calculate the grid size (e.g. minicpmv)
25632563

2564-
auto best_size = get_best_resize(original_size, slice_size, patch_size, !has_slices);
2564+
auto best_size = get_best_resize(original_size, slice_size, patch_size, has_slices);
25652565
res.overview_size = best_size;
25662566

25672567
if (!has_slices) {

examples/server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ The project is under active development, and we are [looking for feedback and co
154154
| `--ssl-cert-file FNAME` | path to file a PEM-encoded SSL certificate<br/>(env: LLAMA_ARG_SSL_CERT_FILE) |
155155
| `-to, --timeout N` | server read/write timeout in seconds (default: 600)<br/>(env: LLAMA_ARG_TIMEOUT) |
156156
| `--threads-http N` | number of threads used to process HTTP requests (default: -1)<br/>(env: LLAMA_ARG_THREADS_HTTP) |
157-
| `--cache-reuse N` | min chunk size to attempt reusing from the cache via KV shifting (default: 0)<br/>[(card)](https://ggml.ai/f0.png)<br/>(env: LLAMA_ARG_CACHE_REUSE) |
157+
| `--cache-reuse N` | min chunk size to attempt reusing from the cache via KV shifting (default: 0)<br/>(env: LLAMA_ARG_CACHE_REUSE) |
158158
| `--metrics` | enable prometheus compatible metrics endpoint (default: disabled)<br/>(env: LLAMA_ARG_ENDPOINT_METRICS) |
159159
| `--slots` | enable slots monitoring endpoint (default: disabled)<br/>(env: LLAMA_ARG_ENDPOINT_SLOTS) |
160160
| `--props` | enable changing global properties via POST /props (default: disabled)<br/>(env: LLAMA_ARG_ENDPOINT_PROPS) |

ggml/CMakeLists.txt

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -360,27 +360,3 @@ write_basic_package_version_file(
360360
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ggml-config.cmake
361361
${CMAKE_CURRENT_BINARY_DIR}/ggml-version.cmake
362362
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ggml)
363-
364-
if (MSVC)
365-
set(MSVC_WARNING_FLAGS
366-
/wd4005 # Macro redefinition
367-
/wd4244 # Conversion from one type to another type, possible loss of data
368-
/wd4267 # Conversion from 'size_t' to a smaller type, possible loss of data
369-
)
370-
function(disable_msvc_warnings target_name)
371-
if(TARGET ${target_name})
372-
target_compile_options(${target_name} PRIVATE ${MSVC_WARNING_FLAGS})
373-
endif()
374-
endfunction()
375-
376-
disable_msvc_warnings(ggml-base)
377-
disable_msvc_warnings(ggml)
378-
disable_msvc_warnings(ggml-cpu)
379-
disable_msvc_warnings(ggml-cpu-x64)
380-
disable_msvc_warnings(ggml-cpu-sse42)
381-
disable_msvc_warnings(ggml-cpu-sandybridge)
382-
disable_msvc_warnings(ggml-cpu-haswell)
383-
disable_msvc_warnings(ggml-cpu-skylakex)
384-
disable_msvc_warnings(ggml-cpu-icelake)
385-
disable_msvc_warnings(ggml-cpu-alderlake)
386-
endif()

ggml/src/ggml-alloc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -816,10 +816,7 @@ static void ggml_gallocr_init_tensor(ggml_gallocr_t galloc, struct ggml_tensor *
816816
static bool ggml_gallocr_node_needs_realloc(ggml_gallocr_t galloc, struct ggml_tensor * node, struct tensor_alloc * talloc) {
817817
size_t node_size = 0;
818818
if (!node->data && !node->view_src) {
819-
// If we previously had data but don't now then reallocate
820-
if (talloc->buffer_id < 0) {
821-
return false;
822-
}
819+
GGML_ASSERT(talloc->buffer_id >= 0); // prevent segfault when misusing the API
823820
node_size = ggml_backend_buft_get_alloc_size(galloc->bufts[talloc->buffer_id], node);
824821
}
825822
return talloc->size_max >= node_size;

0 commit comments

Comments
 (0)