-
Notifications
You must be signed in to change notification settings - Fork 30.6k
[tests] re-enable aria fast tests #40846
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
Conversation
[For maintainers] Suggested jobs to run (before merge) run-slow: aria, idefics3, smolvlm |
class TransformersKwargs(TypedDict, total=False): | ||
""" | ||
Keyword arguments to be passed to the loss function | ||
Keyword arguments to be passed to the forward pass of a `PreTrainedModel`. |
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.
note: this class is not complete, e.g. it doesn't contain output_vision_hidden_states
. we may want to create variants of this class for documentation purposes 🤔
try: | ||
outputs = func(self, *args, **kwargs) | ||
except TypeError as original_exception: | ||
# If we get a TypeError, it's possible that the model is not receiving the recordable kwargs correctly. | ||
# Get a TypeError even after removing the recordable kwargs -> re-raise the original exception | ||
# Otherwise -> we're probably missing `**kwargs` in the decorated function | ||
kwargs_without_recordable = {k: v for k, v in kwargs.items() if k not in recordable_keys} | ||
try: | ||
outputs = func(self, *args, **kwargs_without_recordable) | ||
except TypeError: | ||
raise original_exception | ||
raise TypeError( | ||
"Missing `**kwargs` in the signature of the `@check_model_inputs`-decorated function " | ||
f"({func.__qualname__})" | ||
) |
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.
Took me a few minutes to detect that these lines were failing AND that the correct solution was simply to add **kwargs
-> added an informative exception so that external contributors can quickly fix related problems 🤗
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. |
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.
Thanks LGTM 🤗
self, | ||
pixel_values, | ||
patch_attention_mask: Optional[torch.BoolTensor] = None, | ||
**kwargs: Unpack[TransformersKwargs], |
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.
oh wow, I wonder how none of the tests caught it. Ideally i think we have to pass them over to vision attention for FA2. But that definitely might open a can of worms, I'll take note of it for now
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.
I confess I am not familiar with the full consequences of adding this line -- I saw that SiglipVisionTransformer
had them and it made CI green, so it should be fine :D
* rise from the dead * test
* rise from the dead * test
* rise from the dead * test
What does this PR do?
Aria tests were decorated with
@slow
in #38615 because they were slow. The tests were slow because the test model was quite large.This PR:
@slow
(non-slow test runtime reduced by 66% on my machine, ~1min -> ~20 secs)