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

[tests] make test device-agnostic #30444

Merged
merged 2 commits into from
Apr 24, 2024
Merged

[tests] make test device-agnostic #30444

merged 2 commits into from
Apr 24, 2024

Conversation

faaany
Copy link
Contributor

@faaany faaany commented Apr 24, 2024

What does this PR do?

Make test_from_pretrained_disk_offload_derived_to_base_model and test_from_pretrained_disk_offload_task_model tests work not only on GPU device, but also other accelerator devices.

Results on my XPU device:

========================================================== PASSES ==========================================================
__________________________ ModelUtilsTest.test_from_pretrained_disk_offload_derived_to_base_model __________________________
---------------------------------------------------- Captured log call -----------------------------------------------------
WARNING  root:big_modeling.py:435 Some parameters are on the meta device device because they were offloaded to the disk and cpu.
WARNING  root:big_modeling.py:435 Some parameters are on the meta device device because they were offloaded to the disk and cpu.
================================================= short test summary info ==================================================
PASSED tests/test_modeling_utils.py::ModelUtilsTest::test_from_pretrained_disk_offload_derived_to_base_model
============================================== 1 passed, 3 warnings in 1.46s ===============================================

@amyeroberts and @ArthurZucker

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Another great improvement to our tests - thanks!

@amyeroberts amyeroberts merged commit 16c8e17 into huggingface:main Apr 24, 2024
18 checks passed
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.

None yet

2 participants