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

Fix some tests #35682

Merged
merged 10 commits into from
Jan 17, 2025
Merged

Fix some tests #35682

merged 10 commits into from
Jan 17, 2025

Conversation

Cyrilvallez
Copy link
Member

@Cyrilvallez Cyrilvallez commented Jan 13, 2025

What does this PR do?

Fixes some tests:

  • Glm (add a decorator to avoid oom)
  • Cohere (fix dtype issue)
  • Cohere2 (fix model name + fix expected completion + use decorator to avoid oom), see also Fix mask slicing for models with HybridCache #35681 which was discovered
  • DiffLlama (removes _support_flex_attention)

@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.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Let's use tooslow, otherwise LGTM!

Comment on lines 989 to 997
def require_torch_large_gpu(test_case, memory: float = 20):
"""Decorator marking a test that requires a GPU with more than `memory` GiB of memory."""
if torch_device != "cuda":
return unittest.skip(reason=f"test requires a GPU with more than {memory} GiB of memory")(test_case)

return unittest.skipUnless(
torch.cuda.get_device_properties(0).total_memory / 1024**3 > memory,
f"test requires a GPU with more than {memory} GiB of memory",
)(test_case)
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 also just use the @tooslow 😉

@Cyrilvallez
Copy link
Member Author

From what I see, @tooslow is just a skip, while according to a discussion offline with @ydshieh, the runners may sometimes run on A10 (but this is not deterministic by model type ATM), so @require_torch_large_gpu is not strictly equivalent (it will sometimes run the test if the runner is on a10 instead of t4)

@ydshieh
Copy link
Collaborator

ydshieh commented Jan 17, 2025

Yes, CI will run A10 on some special events. Let's go with this new require_torch_large_gpu and see how it goes.

@ydshieh
Copy link
Collaborator

ydshieh commented Jan 17, 2025

I have to double check if the CI bot has the access to those repo. decorated with require_read_token. Update here later

Update: CohereForAI/c4ai-command-r7b-12-2024 ok

@Cyrilvallez
Copy link
Member Author

Thanks for double-checking @ydshieh! I applied your comments. Merging then as we agree!

@Cyrilvallez Cyrilvallez merged commit ab1afd5 into main Jan 17, 2025
26 checks passed
@Cyrilvallez Cyrilvallez deleted the fix-some-tests branch January 17, 2025 12:10
bursteratom pushed a commit to bursteratom/transformers that referenced this pull request Jan 31, 2025
* cohere tests

* glm tests

* cohere2 model name

* create decorator

* update

* fix cohere2 completions

* style

* style

* style

* add cuda in comments
elvircrn pushed a commit to elvircrn/transformers that referenced this pull request Feb 13, 2025
* cohere tests

* glm tests

* cohere2 model name

* create decorator

* update

* fix cohere2 completions

* style

* style

* style

* add cuda in comments
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.

4 participants