Skip to content

ggml : remove DIAG_MASK_INF and DIAG_MASK_ZERO - #31946

Merged
ggerganov merged 1 commit into
ggml-org:gg/ggml-prune-deprecatedfrom
losewayy:remove-diag-mask-v1
Nov 10, 2026
Merged

ggerganov merged 1 commit into
ggml-org:gg/ggml-prune-deprecatedfrom
losewayy:remove-diag-mask-v1

Conversation

@losewayy

@losewayy losewayy commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Overview

ref #17654

Remove GGML_OP_DIAG_MASK_INF, GGML_OP_DIAG_MASK_ZERO and the four ggml_diag_mask_* functions for v1.0.0, as discussed in #17654. This PR targets the #29801 branch.

This also removes their CPU, CUDA, Vulkan, SYCL, OpenCL and CANN kernels, the backward cases, the DIAG_MASK_INF case in the Vulkan debug check, the test-backend-ops cases and the docs/ops entries. No model in the repo uses these ops.

To migrate:

  • ggml_diag_mask_zero(ctx, a, 0) -> ggml_tri(ctx, a, GGML_TRI_TYPE_LOWER_DIAG), for a contiguous square F32 a, not in place
  • ggml_diag_mask_inf before a softmax -> pass an additive mask to ggml_soft_max_ext, with 0 for visible and -INFINITY for masked positions

Additional information

Removing these ops shifts the IDs of later ops, as the ADD1 removal in #29801 already does. I left the RPC and backend API versions unchanged so they can be bumped once for the whole branch. Note that the RPC handshake does not check the patch version, so a patch bump alone would not catch a mismatch.

Validation

test-backend-ops test -b CPU -o DIAG,TRI,FILL,SOFT_MAX,SOFT_MAX_BACK
test-backend-ops test -o DIAG,TRI,FILL,SOFT_MAX,SOFT_MAX_BACK
  • All supported cases pass on CPU, NVIDIA Vulkan and AMD Vulkan.
  • The RPC multi-server test passes with the client and servers built from this branch.
  • The OpenCL backend and ggml-cuda.cu compile. SYCL and CANN were not built, the changes there are removals only.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - Codex helps with implementation and code review.

@ggerganov ggerganov self-assigned this Nov 9, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation testing Everything test related Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language Ascend NPU issues specific to Ascend NPUs OpenCL Issues specific to the OpenCL backend CUDA Related to the CUDA backend labels Nov 9, 2026
@ggerganov
ggerganov merged commit b18af06 into ggml-org:gg/ggml-prune-deprecated Nov 10, 2026
45 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ascend NPU issues specific to Ascend NPUs CUDA Related to the CUDA backend documentation Improvements or additions to documentation ggml changes relating to the ggml tensor library for machine learning OpenCL Issues specific to the OpenCL backend SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language testing Everything test related Vulkan Issues specific to the Vulkan backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants