Replies: 5 comments 11 replies
-
oh... i forgot about superblocks and blocks... that's why. Gonna have to normalize it all first... hopefully there is functions for that already. |
Beta Was this translation helpful? Give feedback.
-
@compilade I decided to give a stab at a simpler per tensor naive hashing for the UUIDv5 generation in #8048 It compiles... on my PC, but just can't figure out what I'm doing wrong with the windows CI checks. (FYI my PR is extremely naive and won't handle split ggufs files... but good start I guess?) But if this works out, it can be a good base to sanity check your proposed change to GGUFWriter to support a hash-only mode during conversion to precalcuate the consistent model UUID. |
Beta Was this translation helpful? Give feedback.
-
Just thinking, could we try quantizing the model using Qx_K, then calculate the hash purely based on scale of each block? (we don't care about the individual weights inside each block). |
Beta Was this translation helpful? Give feedback.
-
Fyi llama-gguf-hash C program now in the example folder and is now ready to use on top of main. Readme provided in that folder if you want usage examples. |
Beta Was this translation helpful? Give feedback.
-
While working with some LoRA recently, I'm thinking if it possible to have a hash method that measure the "distance" between models. An use case that I need atm is to check if distance of these 2 ggufs are within an acceptable range:
This can also be useful to test how far between Q4 to f16 of a particular model for example. (remind: the way we're measuring now is to compare perplexity, which requires to run the inference) One of the idea I'm having in my mind is flatten all weights into 1d vector, then calculate sum of sigmoid of each element:
A model having 7b parameters should have max sum = 7b, but I expect actual value to fall around 0 (median) Edit: this should work under one condition: most of weights value must fall inside -1 and 1 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In #7499 (comment) I had a thought about generating a uuid that is based on the weights of the model rather than the DOI or repository url.
This is my attempt at this idea. It be interesting to see if this makes sense to others.
For the UUIDv5 this is how I calculate it:
The idea I have with this approach is that regardless of the quantitation applied the model will all have the same UUID. I am not sure if this is a good idea, but this is the approach I'm trying out for now. But happy to hear feedback if it makes sense to use this to identify a model in KV store e.g.
general.uuid
So if I run this program this is what I expect:
But for some reason... the hashes are still different... even though in theory if it's just a straight quantitation... the +/- of each weight should be the same? Anyway this is what I got to so far in my experimentation... but hopefully maybe someone can chime in on what may be the better approach (or to just not do it and instead just manually require model creators to generate their own UUID and be responsible for keeping it consistent).
Beta Was this translation helpful? Give feedback.
All reactions