-
Notifications
You must be signed in to change notification settings - Fork 12
[Transform] Extend set of known Hadamard matrices #351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find! instead of checking in and shipping the added safetensors file in our wheel; Could we programmatically download it when needed?
@rahul-tuli What’s the benefit to downloading the safetensors file? I understand the bin files are scary, but this introduces another level of file hosting + local artifact management to keep in mind. Other libraries such as Quark simply copy and paste the entire matrices into python code and ship with that, so clearly shipping with prebuilt data isn’t too problematic for them. I consider a SSOT safetensors file to be an improvement upon that approach. |
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
There's a few reasons behind my ask:
I still think hosting, and subsequently downloading this file on first use is better hygiene. However if @dsikka and @brian-dellabetta feel this is okay, feel free to ignore my ask, won't be blocking the PR over this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the point of storing a large subset of small hadamard sizes that we likely won’t see in most models?
@dsikka Is there a reason not to support as many hadamard matrix sizes as we can? |
If we dont have a usecase for certain sizes because they dont show up in most models, carrying them around seems like a waste of time and space. When do we expect to use hadamards of size 18? It would make a lot more sense if we storing sizes we expect to see/have seen in popular models as they have a large runtime to compute. |
For clarity, having |
Purpose
Changes
hadamards.safetensors
, which stores a list of known Hadamard matrices from http://www.neilsloane.com/hadamard/index.htmlsizes = [1, 2, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 256]
_get_hadK
to_fetch_hadamard_divisor
_fetch_hadamard_divisor
to query and fetch matrices from thehadamards.safetensors
filedtype
anddevice
args, removenumpy
dependenceis_pow2
as public function for testing, ect.Hadamard Fetch Script
download_hadamards.py
names.txt
Testing