Skip to content

quantize: filter per-layer metadata when pruning layers (#27976) - #28597

Open
Sumire-no-kai wants to merge 1 commit into
ggml-org:masterfrom
Sumire-no-kai:issue-27976-prune-metadata
Open

quantize: filter per-layer metadata when pruning layers (#27976)#28597
Sumire-no-kai wants to merge 1 commit into
ggml-org:masterfrom
Sumire-no-kai:issue-27976-prune-metadata

Conversation

@Sumire-no-kai

@Sumire-no-kai Sumire-no-kai commented Sep 8, 2026

Copy link
Copy Markdown

Overview

Pruning model layers updates block_count and tensor lists, but leaves per-layer GGUF metadata arrays at their original length. This mismatch causes load failures or metadata inconsistency for pruned models.

Filter known per-layer metadata arrays by original layer index during layer pruning while preserving their original GGUF data types.

Add regression tests covering metadata array truncation, removal of deleted layer elements, preservation of scalar and non-layer metadata, and reloading of the pruned model.

Fixes #27976

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, assisted across the development including root-cause analysis, testing and cross-verification, regression test design, and code review.

Pruning model layers updates block\_count and tensor lists, but leaves per-layer GGUF metadata arrays at their original length. This mismatch causes load failures or metadata inconsistency for pruned models.

Filter known per-layer metadata arrays by original layer index during layer pruning while preserving their original GGUF data types.

Add regression tests covering metadata array truncation, removal of deleted layer elements, preservation of scalar and non-layer metadata, and reloading of the pruned model.
@github-actions github-actions Bot added the testing Everything test related label Sep 8, 2026
@ggml-gh-bot

This comment was marked as resolved.

@ggml-gh-bot ggml-gh-bot Bot added the draft PR will be changed to draft by github-actions bot label Sep 8, 2026
@github-actions
github-actions Bot marked this pull request as draft September 8, 2026 09:19
@github-actions github-actions Bot removed the draft PR will be changed to draft by github-actions bot label Sep 8, 2026
@Sumire-no-kai
Sumire-no-kai marked this pull request as ready for review September 8, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: prune-layers updates the block_count but not the per-layer array metadata which causes the output to not load.

1 participant