[bugfix] Update modeling_llama.py so it skips keys correctly#36289
Closed
HDCharles wants to merge 0 commit intohuggingface:mainfrom
Closed
[bugfix] Update modeling_llama.py so it skips keys correctly#36289HDCharles wants to merge 0 commit intohuggingface:mainfrom
HDCharles wants to merge 0 commit intohuggingface:mainfrom
Conversation
4 tasks
Contributor
|
cc @SunMarc can you take a look? |
Contributor
Author
|
are these test failures actually blocking? it seems like other models just have the same issue. |
Member
|
This PR that was merged today actually fixes the issue that you are having (Cache is not a |
Member
|
Still, it would be indeed be better to only keep one of them. @ArthurZucker why do we have |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the llama model was using past_key_value and past_key_values interchangeably which caused issues because only one of those was actually skipped in _skip_keys_device_placement when both needed to be.
This PR changes it so only past_key_values is used.
without this fix, llama + torch.compile was having issues as in the surfaced issue below. Note, though this was surfaced due to a TorchAO recipe though the bug was unrelated to torchao
i think #35763 might have caused this bug but not sure
Fixes
pytorch/ao#1705