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

[bart] minor test fixes #35965

Merged
merged 1 commit into from
Jan 30, 2025
Merged

[bart] minor test fixes #35965

merged 1 commit into from
Jan 30, 2025

Conversation

gante
Copy link
Member

@gante gante commented Jan 29, 2025

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)

@gante gante requested a review from ydshieh January 29, 2025 18:25
@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.

@@ -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")
Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Collaborator

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)

Copy link
Collaborator

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.

Copy link
Member Author

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

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Great, thank you!

@gante gante merged commit 8bc4c89 into huggingface:main Jan 30, 2025
25 checks passed
@gante gante deleted the green_bart branch January 30, 2025 10:00
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.

3 participants