set tensor names on block params (so weights aren't unnamed leaf_N)#1622
Merged
Conversation
GGMLBlock::get_param_tensors builds each param's full hierarchical name but only uses it as the map key; the tensor's own name is never set, so weights appear as unnamed "leaf_N" in graph dumps, profiling, and to any tooling that inspects weights by name. Set the name where it's already constructed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GGMLBlock::get_param_tensorsalready builds each weight's full hierarchical name (e.g.double_blocks.0.img_attn.qkv.weight) but only uses it as the map key — the ggml tensor's own name is never set, so in the compute graph the weight tensors are unnamed and ggml auto-assignsleaf_N.That makes a couple of things harder than they need to be:
leaf_Ninstead of the layer name, so you can't tell which weight a node belongs to.The fix is one line, where the full name is already in hand:
Pure metadata —
ggml_set_nameonly sets the tensor'snamefield, so there's no change to data, shapes, or the compute graph; generation output is unchanged. Names are bounded byGGML_MAX_NAMEas elsewhere. All blocks route their leaf params through this base method, so every weight gets named.Tested: clean Vulkan build; a Flux (Krea Q4) generation runs and produces a normal image.