-
Notifications
You must be signed in to change notification settings - Fork 220
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
changing dimensions of batch size, kv cache and num_input_heads #793
changing dimensions of batch size, kv cache and num_input_heads #793
Conversation
…genai into ly/handling_tensors_access_in_genai
…genai into ly/handling_tensors_access_in_genai
…com/lamiayous/openvino.genai into ly/handling_tensors_access_in_genai
…genai into ly/handling_tensors_access_in_genai
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, thanks @lamiayous!
LGTM 👍
jenkins_build |
jenkins_build |
Failing checks are caused by broken master. Ignore them until #807 is merged. |
Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
KVAxesPosition axes; | ||
if (model_type == "chatglm") { | ||
axes.batch = 1u; | ||
axes.seq_len = 0u; |
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.
why this approach https://github.com/openvinotoolkit/openvino.genai/blob/master/samples/cpp/prompt_lookup_decoding_lm/prompt_lookup_decoding_lm.cpp#L13 is not used? it seems generic and does not required model type
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.
@ilya-lavrenov Yes, you're right. The only drawback is that this function cannot be used for .blob
's case as they will be stateless + static.
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.
how is it supposed to pass compiled blob via current LLMPipeline API ?
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.
It's on review so far: #811
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.
The current solution aim to handle qwen
/ chatglm
cases that are crucial for now.
But in general, I'd prefer using your approach but somewhere inside StatefulToStateless
transformation, so that it could save necessary metadata
that will be available from both xml
/ blob
formats.
…com/lamiayous/openvino.genai into ly/handling_tensors_access_in_genai
build_jenkins |
Once KV-cache tensors are exposed from the stateful model, they should be reshaped to have static size. Current implementation of reshape function assumes that KV-cache dimension is always equal to 2 and batch dimension always equal to 0. For chatglm and Qwen this is not the case. This PR identifies the KV-cache and batch dimensions by reading the models config.json file