-
Notifications
You must be signed in to change notification settings - Fork 11
Harden KV Cache qparams #262
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Kyle Sayers <[email protected]>
Signed-off-by: Kyle Sayers <[email protected]>
…_kv_initialization
Signed-off-by: Kyle Sayers <[email protected]>
…_kv_initialization
|
||
expected_shape = 1 # per tensor | ||
|
||
param = next(module.parameters()) |
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.
WHAAAAAAAAAAAAAAT 😨 we just assumed next(model.parameters()) give us the weight param
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.
Sorry this needs to be reworked. This is meant to be called on an "attention" module, so we need to get the k_proj and v_proj attributes, not the weight attribute.
But yes, making any assumption of ordering on module.parameters()
is incorrect
The base branch was changed.
param = next(module.parameters()) | ||
scale_dtype = param.dtype | ||
device = param.device | ||
weight_param = getattr(module, "weight", next(module.parameters())) |
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.
Should this be q_proj weights?
Purpose
parameters()
is not the weightPrerequisites