Skip to content

ggml-alloc: avoid splitting on zero-size view tensors - #13

Merged
bryanwieg merged 1 commit into
rx9070-portfrom
fix/alloc-view-split-port
Sep 20, 2026
Merged

bryanwieg merged 1 commit into
rx9070-portfrom
fix/alloc-view-split-port

Conversation

@bryanwieg

Copy link
Copy Markdown
Owner

Ports the allocator correctness fix from historical private-fork commit 00d54526e24e3aba4c76474e3147cbf9c7cc034c.

The old split condition could fire while iterating a view tensor whose allocation size is zero, purely because the already-accumulated buffer size exceeded the backend maximum. That resets the running chunk at a view tensor and can leave trailing views outside the final allocated range.

This port is intentionally minimal: require this_size > 0 before a tensor can trigger a new buffer chunk.

No diagnostics, model-specific logic, or unrelated allocator changes are included.

When buffer splitting is driven only by the accumulated buffer size, a view
tensor with zero allocation size can trigger a split. That resets the running
size at the view and can leave trailing view tensors outside the final
allocated range.

Require the current tensor to have a nonzero allocation size before it can
start a new backend buffer chunk.

Ported semantically from historical private-fork commit
00d5452.
@bryanwieg
bryanwieg merged commit 2250f57 into rx9070-port Sep 20, 2026
7 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant