Compare commits

..

7 Commits

Author SHA1 Message Date
Yuri Khrustalev 3737e41370 metal : null-check buffer alloc to fix OOM crash (#25371)
* metal : null-check ggml_metal_buffer_init result to avoid OOM crash

ggml_backend_metal_buffer_type_alloc_buffer used the result of
ggml_metal_buffer_init without checking for NULL. ggml_metal_buffer_init
returns NULL when the underlying Metal allocation fails (e.g. an
out-of-memory condition), and the following ggml_metal_buffer_is_shared(res)
call dereferences it, turning a recoverable allocation failure into a hard
crash (EXC_BAD_ACCESS). This is easy to hit on memory-constrained devices
such as iOS when a model/context exceeds the available Metal budget.

Log the failure using the existing GGML_LOG_ERROR convention and return
NULL so the allocator surfaces a diagnosable error up the stack instead of
crashing.

* cont : fix log

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
2026-08-25 14:35:39 +03:00
Georgi Gerganov c1d0e7a004 llama.cpp : bump version to 0.3.0 (#27696)
* llama.cpp : bump version to 0.3.0

* ci : update release default desc

* scripts : add prompt for generating release summary
2026-08-25 12:42:21 +03:00
Georgi Gerganov 81191affa5 sync : ggml 2026-08-25 11:51:14 +03:00
Georgi Gerganov 93882361f1 ggml : bump version to 0.22.0 (ggml/1607)
* ggml : bump version to 0.22.0

* scripts : update default release desc
2026-08-25 11:51:14 +03:00
Saad Ali eb25b7263e grammar : parse \- in char classes as literal hyphen (#27591)
* grammar : accept "\-" escape in character classes

gbnf_escape_char_class() escapes '-' as "\-" but parse_char() rejected
that escape, so generated tool-call grammars failed to parse.

Assisted-by: Claude Code <claude@anthropic.com>

* tests : add parser test for "\-" in char classes

Assisted-by: Claude Code <claude@anthropic.com>

* tests : add integration test for "\-" in char classes

Assisted-by: Claude Code <claude@anthropic.com>

* tests : drop integration and parser tests
2026-08-25 09:05:24 +03:00
Neo Zhang 814d84bc9d sycl : mark tq2_0 as not supported (#27660) 2026-08-25 09:04:58 +03:00
fairydreaming 5ea87ddad2 webgpu : fix handling of infinity values during ARGSORT and TOP_K (#27538)
Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
2026-08-25 08:08:06 +03:00
11 changed files with 79 additions and 14 deletions
+4 -2
View File
@@ -84,11 +84,13 @@ jobs:
New version has been released.
## Assets
${{ steps.desc.outputs.nightly }}
**Web UI:** the `nightly-tag.txt` asset contains the tag of the corresponding nightly release
## More info
**More info:** [dist : releases and versioning of ggml-org projects](https://github.com/ggml-org/ggml/discussions/1579)
- [Releases and versioning of `ggml-org` projects](https://github.com/ggml-org/ggml/discussions/1579)
## ${{ steps.desc.outputs.changelog_title }}
+1 -1
View File
@@ -4,7 +4,7 @@ include(CheckIncludeFileCXX)
### llama.cpp version
set(LLAMA_VERSION_MAJOR 0)
set(LLAMA_VERSION_MINOR 2)
set(LLAMA_VERSION_MINOR 3)
set(LLAMA_VERSION_PATCH 0)
set(LLAMA_VERSION_BASE "${LLAMA_VERSION_MAJOR}.${LLAMA_VERSION_MINOR}.${LLAMA_VERSION_PATCH}")
+1 -1
View File
@@ -4,7 +4,7 @@ project("ggml" C CXX ASM)
### GGML Version
set(GGML_VERSION_MAJOR 0)
set(GGML_VERSION_MINOR 21)
set(GGML_VERSION_MINOR 22)
set(GGML_VERSION_PATCH 0)
set(GGML_VERSION_BASE "${GGML_VERSION_MAJOR}.${GGML_VERSION_MINOR}.${GGML_VERSION_PATCH}")
+5
View File
@@ -204,6 +204,11 @@ static ggml_backend_buffer_t ggml_backend_metal_buffer_type_alloc_buffer(ggml_ba
ggml_metal_device_t ctx_dev = (ggml_metal_device_t)buft->device->context;
ggml_metal_buffer_t res = ggml_metal_buffer_init(ctx_dev, size, shared);
if (res == NULL) {
GGML_LOG_ERROR("%s: failed to allocate Metal buffer of %zu bytes (out of memory)\n", __func__, size);
return NULL;
}
ggml_backend_buffer_i buf_i = ggml_metal_buffer_is_shared(res)
? ggml_backend_metal_buffer_shared_i
: ggml_backend_metal_buffer_private_i;
+14 -1
View File
@@ -6018,6 +6018,11 @@ static bool do_ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, cons
a->ne[0] > 128 && a->ne[2] == 1 && src0_type == GGML_TYPE_F16) {
return false;
}
if (src0_type == GGML_TYPE_TQ2_0) {
return false;
}
return true;
}
case GGML_OP_OUT_PROD:
@@ -6068,6 +6073,9 @@ static bool do_ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, cons
case GGML_OP_SET_ROWS:
{
if (op->type == GGML_TYPE_TQ2_0) {
return false;
}
auto res = (op->src[0]->type == GGML_TYPE_F32 || op->src[0]->type == GGML_TYPE_F16 ||
op->src[0]->type == GGML_TYPE_BF16) &&
(op->src[1]->type == GGML_TYPE_I64 || op->src[1]->type == GGML_TYPE_I32);
@@ -6186,11 +6194,16 @@ static bool do_ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, cons
src1_type == GGML_TYPE_IQ3_XXS ||
src1_type == GGML_TYPE_IQ3_S ||
src1_type == GGML_TYPE_IQ1_S ||
src1_type == GGML_TYPE_IQ1_M) {
src1_type == GGML_TYPE_IQ1_M ||
src1_type == GGML_TYPE_TQ2_0) {
return false;
}
}
if (src0_type == GGML_TYPE_TQ2_0 || src1_type == GGML_TYPE_TQ2_0) {
return false;
}
return true;
}
case GGML_OP_REPEAT_BACK:
+1 -1
View File
@@ -2559,7 +2559,7 @@ void ggml_sycl_op_mul_mat_vec_q(ggml_backend_sycl_context & ctx, const ggml_tens
}
break;
default:
GGML_ABORT("fatal error: unsupport data type=%s\n", ggml_type_name(src0->type));
GGML_ABORT("fatal error: unsupport src0 data type %s\n", ggml_type_name(src0->type));
}
}
GGML_UNUSED(src1);
+2 -1
View File
@@ -546,7 +546,8 @@ static void set_rows_sycl(ggml_backend_sycl_context & ctx, const ggml_tensor * s
stream);
break;
default:
GGML_ABORT("Unsupported tensor type!");
GGML_ABORT("Unsupported tensor type: src0 %s src1 %s dst %s", ggml_type_name(dst->src[0]->type),
ggml_type_name(dst->src[1]->type), ggml_type_name(dst->type));
break;
}
}
@@ -34,11 +34,9 @@ var<uniform> params: Params;
var<workgroup> shmem_idx: array<u32, WG_SIZE>;
#if ORDER == 0
#define EXTREME_VALUE 1e30
#define SWAP_COMPARE_UP >
#define SWAP_COMPARE_DOWN <
#else
#define EXTREME_VALUE -1e30
#define SWAP_COMPARE_UP <
#define SWAP_COMPARE_DOWN >
#endif
@@ -78,11 +76,9 @@ fn main(@builtin(workgroup_id) wid: vec3<u32>,
let dir_up = (lid.x & k) == 0;
let a_idx = shmem_idx[lid.x];
let b_idx = shmem_idx[ixj];
let a_val = select(EXTREME_VALUE, src[row_base + a_idx], a_idx < params.src_ne0);
let b_val = select(EXTREME_VALUE, src[row_base + b_idx], b_idx < params.src_ne0);
let should_swap = select(
(a_val SWAP_COMPARE_DOWN b_val),
(a_val SWAP_COMPARE_UP b_val),
b_idx >= params.src_ne0 || (a_idx < params.src_ne0 && src[row_base + a_idx] SWAP_COMPARE_DOWN src[row_base + b_idx]),
a_idx >= params.src_ne0 || (b_idx < params.src_ne0 && src[row_base + a_idx] SWAP_COMPARE_UP src[row_base + b_idx]),
dir_up);
if (should_swap) {
shmem_idx[lid.x] = b_idx;
+47
View File
@@ -0,0 +1,47 @@
Take a look at the changelog between the current version and the previous version - use the `./scripts/make-release-desc.sh [current-version]` to obtain it.
Write a summary of the change log in a few sections:
```
## Overview
[an overview using 1 to 3 sentences (no line breaks)]
### API changes (if applicable)
[summarize any API changes to `/include/*`, `/tools/mtmd/mtmd.h` and `/tools/server`]
### New models (if applicable)
[summarize new models added to the `src/models/` directory]
### Core changes (if applicable)
[summarize the changes to `/src/*`
### Multi-modality changes (if applicable)
[summarize the changes to `/tools/mtmd/`]
### Server changes (if applicable)
[summarize the changes to `/tools/server/`]
### UI changes (if applicable)
[summarize the changes to `/tools/ui/`]
### ggml changes (if applicable)
[if the version has been updated, link to the respective `ggml` releases on Github, f.ex `https://github.com/ggml-org/ggml/releases/tag/v0.22.0`. for each version bump, lookup the release description and copy the summary here]
```
Guidelines:
- All bullet point in the summary should be concise and rarely exceed a single line of 120 characters
- Avoid repeating `ggml`-specific changes - these should already be covered by the `ggml` release links
- Provide PR link for each bullet point where possible
- Don't add bullet point to state that there are no API changes in some module
Output just the summary in a markdown block, without any extra text.
+1 -1
View File
@@ -1 +1 @@
8599e0ea3756c4bac4ef813af2241cb1a8bbfb0b
36da57138425487184aa1da2eee2cde155909c6f
+1
View File
@@ -172,6 +172,7 @@ static std::pair<uint32_t, const char *> parse_char(const char * src) {
case '"':
case '[':
case ']':
case '-':
return std::make_pair(src[1], src + 2);
default:
throw std::runtime_error(std::string("unknown escape at ") + src);