-
Notifications
You must be signed in to change notification settings - Fork 33.1k
[AMD CI] Fix test failures across important models #44632
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
Changes from all commits
81d6ce3
eba6b69
47b9cfb
e8dcd2f
ec59b94
4a2142d
014f4b9
62fa178
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -579,7 +579,7 @@ def test_tokenizer_integration(self): | |
| fast_tokenizer.add_tokens("<image>", True) | ||
|
|
||
| prompt = "<|im_start|>system\nAnswer the questions.<|im_end|><|im_start|>user\n<image>\nWhat is shown in this image?<|im_end|><|im_start|>assistant\n" | ||
| EXPECTED_OUTPUT = ['<|im_start|>', 'sy', 'st', 'em', '\n', 'An', 'sw', 'er', ' ', 'the', ' ', 'qu', 'est', 'ions', '.', '<|im_end|>', '<|im_start|>', 'us', 'er', '\n', '<image>', '\n', 'What', ' ', 'is', ' ', 'sh', 'own', ' ', 'in', ' ', 'th', 'is', ' ', 'im', 'age', '?', '<|im_end|>', '<|im_start|>', 'ass', 'ist', 'ant', '\n'] # fmt: skip | ||
| EXPECTED_OUTPUT = ['<|im_start|>', 'system', '\n', 'Answer', '▁the', '▁questions', '.', '<|im_end|>', '<|im_start|>', 'user', '\n', '<image>', '\n', 'What', '▁is', '▁shown', '▁in', '▁this', '▁image', '?', '<|im_end|>', '<|im_start|>', 'ass', 'istant', '\n'] # fmt: skip | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to use (I don't know if this updated values are good across different hardware however : A10, AMD etc.)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are good for A10 as well : https://github.com/huggingface/transformers/actions/runs/23034484105/job/66899818920 |
||
| self.assertEqual(slow_tokenizer.tokenize(prompt), EXPECTED_OUTPUT) | ||
| self.assertEqual(fast_tokenizer.tokenize(prompt), EXPECTED_OUTPUT) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -183,11 +183,9 @@ def test_model_450m_long_prompt_sdpa(self): | |
|
|
||
| @slow | ||
| def test_speculative_generation(self): | ||
| EXPECTED_TEXT_COMPLETION = Expectations({ | ||
| (None, None): "My favourite condiment is 100% natural and organic, and I love to use it to make my own sauces.", | ||
| ("xpu", 3): "My favourite condiment is 100% natural, organic, gluten-free, vegan, and vegetarian. I have been making", | ||
| }) # fmt: off | ||
|
|
||
| EXPECTED_TEXT_COMPLETION = ( | ||
| "My favourite condiment is 100% natural, organic, gluten-free, vegan, and vegetarian. I have been making" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good for A10 as well : |
||
| ) | ||
| prompt = "My favourite condiment is " | ||
| tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2-7B", use_fast=False) | ||
| model = Qwen2ForCausalLM.from_pretrained("Qwen/Qwen2-0.5B", device_map="auto", dtype=torch.float16) | ||
|
|
||
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.
could you share more info about what was wrong when passing as pos. arguments?
I am fine for the change, but just prefer some details 🙏
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 parent
GenerationMixin.prepare_inputs_for_generationaddednext_sequence_lengthas the 2nd positional arg (right afterinput_ids). So when the talker passedpast_key_valuespositionally in that slot, it got bound tonext_sequence_lengthinstead. Thennext_sequence_lengthalso came in through**kwargsfrom the caller → duplicate value → TypeError.