Skip to content
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

fix falcon dummy input generator #1825

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eaidova
Copy link
Contributor

@eaidova eaidova commented Apr 23, 2024

What does this PR do?

during enabling falcon40b export for openvino, I found that this model is not covered by dummy input generator configuration and failed with shape mismatch. This PR fixes that.

I propose these changed into optimum-intel, but the proper place for it here.

Who can review?

Co-authored-by: Michael Benayoun <mickbenayoun@gmail.com>
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@echarlaix echarlaix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition @eaidova

Comment on lines +1093 to +1098
if normalized_config.new_decoder_architecture and normalized_config.multi_query:
self.num_kv_heads = normalized_config.num_attention_heads
elif normalized_config.new_decoder_architecture:
self.num_kv_heads = normalized_config.num_kv_heads
else:
self.num_kv_heads = 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be :

Suggested change
if normalized_config.new_decoder_architecture and normalized_config.multi_query:
self.num_kv_heads = normalized_config.num_attention_heads
elif normalized_config.new_decoder_architecture:
self.num_kv_heads = normalized_config.num_kv_heads
else:
self.num_kv_heads = 1
if normalized_config.new_decoder_architecture:
self.num_kv_heads = normalized_config.num_attention_heads
else:
self.num_kv_heads = normalized_config.num_kv_heads if not normalized_config.multi_query else 1

?

elif normalized_config.new_decoder_architecture:
self.num_kv_heads = normalized_config.num_kv_heads
else:
self.num_kv_heads = 1
self.head_dim = self.hidden_size // self.num_attention_heads

Copy link
Collaborator

@echarlaix echarlaix Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also shouldn't it be udpated here and here as well?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also why not have this value set in the normalized_config directly and use it in both FalconDummyPastKeyValuesGenerator and ORTFalconForCausalLM @fxmarty ? (removing the need to have this check in both places)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants