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

Update "past_sequence_length + 1" shape dimension name to "past_sequence_length + sequence_length" #2088

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PatrikPerssonInceptron
Copy link

@PatrikPerssonInceptron PatrikPerssonInceptron commented Nov 4, 2024

When exporting a LLM to onnx with ``--task text-generation-with-past, the attention_mask and output kv-cache shapes contain a dimension set to "past_sequence_length + 1". This assumes that the input token sequence length is 1 which may not be the case when e.g. filling the kv-cache with the input prompt.

Fix

I updated the strings "past_sequence_length + 1" to "past_sequence_length + sequence_length" to reflect the case when the input sequence is longer than 1.

@fxmarty, @echarlaix, @JingyaHuang, @michaelbenayoun

…gth"

instead of "past_sequence_length + 1" since the output length depends on
the input sequence_length which may not be 1, e.g. when filling the kv-cache
@PatrikPerssonInceptron PatrikPerssonInceptron changed the title [FIX][ONNX] Changed "past_sequence_length + 1" shape variable name to "past_sequence_length + sequence_length" Changed "past_sequence_length + 1" shape variable name to "past_sequence_length + sequence_length" Nov 11, 2024
@PatrikPerssonInceptron PatrikPerssonInceptron changed the title Changed "past_sequence_length + 1" shape variable name to "past_sequence_length + sequence_length" Update "past_sequence_length + 1" shape dimension name to "past_sequence_length + sequence_length" Nov 13, 2024
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.

1 participant