[PR #15301] [MERGED] ggml: skip cublasGemmBatchedEx during graph reservation #61804

Closed
opened 2026-04-29 16:49:06 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15301
Author: @jessegross
Created: 4/3/2026
Status: Merged
Merged: 4/3/2026
Merged by: @jessegross

Base: mainHead: jessegross/gemma4-reserve


📝 Commits (1)

  • 0cf2922 ggml: skip cublasGemmBatchedEx during graph reservation

📊 Changes

2 files changed (+45 additions, -3 deletions)

View changed files

📝 llama/patches/0020-ggml-No-alloc-mode.patch (+24 -3)
📝 ml/backend/ggml/ggml/src/ggml-cuda/common.cuh (+21 -0)

📄 Description

cublasGemmBatchedEx fails during graph capture when pool allocations return fake pointers. This is triggered when NUM_PARALLEL is greater than 1 for models like gemma4 that use batched matmuls. Skip it during reservation since the memory tracking is already handled by the pool allocations.

Fixes #15249


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15301 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 4/3/2026 **Status:** ✅ Merged **Merged:** 4/3/2026 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/gemma4-reserve` --- ### 📝 Commits (1) - [`0cf2922`](https://github.com/ollama/ollama/commit/0cf2922e9308b0b3e07f9c74b38b59c7367b331d) ggml: skip cublasGemmBatchedEx during graph reservation ### 📊 Changes **2 files changed** (+45 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `llama/patches/0020-ggml-No-alloc-mode.patch` (+24 -3) 📝 `ml/backend/ggml/ggml/src/ggml-cuda/common.cuh` (+21 -0) </details> ### 📄 Description cublasGemmBatchedEx fails during graph capture when pool allocations return fake pointers. This is triggered when NUM_PARALLEL is greater than 1 for models like gemma4 that use batched matmuls. Skip it during reservation since the memory tracking is already handled by the pool allocations. Fixes #15249 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 16:49:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#61804