-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
[bart] minor test fixes #35965
[bart] minor test fixes #35965
Conversation
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. |
@@ -4532,6 +4532,8 @@ def test_flash_attention_2_padding_matches_padding_free_with_position_ids(self): | |||
config.max_position_embeddings = max_new_tokens + dummy_input.shape[1] + 1 | |||
|
|||
model = model_class(config) | |||
if "position_ids" not in inspect.signature(model.forward).parameters: | |||
self.skipTest("Model does not support position_ids") |
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.
For the record: self.skipTest
will skip here and break the for loop for model_class in self.all_generative_model_classes
.
Here is somehow fine as it's rare to have a model architecture with some model classes having position_ids
but not other model class.
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.
That is indeed undesirable :(
Do you have a better suggestion? continue
to skip the iteration on the loop also doesn't seem adequate.
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.
we can have pytest-subtests
installed in CI env. and using TestCase.subTest
and skip inside it where necessary.
But I have installed it yet because it's will change the test summary outputs (for which some adjustments have to be done IMO).
(I also had to fix something in pytest-subtests repository)
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.
For now, let's just do whatever you prefer (skip or continue), it's fine, we are aware of the situation and might take an action.
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.
Okay :)
I'm going to merge as is then -- as you wrote, it's uncommon for a model to have subclasses with different inputs regarding the input modality
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, thank you!
What does this PR do?
Makes
RUN_SLOW=1 py.test tests/models/bart/test_modeling_bart.py
green.(Issues found while working on #35802)