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_model_parallelism device-agnostic #30844

Merged
merged 4 commits into from
May 24, 2024

Conversation

faaany
Copy link
Contributor

@faaany faaany commented May 16, 2024

What does this PR do?

As the title suggests, test_model_parallelism is not GPU-specific and could also work on other accelerators, e.g. XPU device. Below are the before and after the fix for pytest -rA tests/models/bart/test_modeling_bart.py::BartModelTest::test_model_parallelism:
BEFORE

================================================ short test summary info ================================================
FAILED tests/models/bart/test_modeling_bart.py::BartModelTest::test_model_parallelism - AssertionError: device(type='xpu', index=0) != device(type='cuda', index=0)
============================================= 1 failed, 4 warnings in 3.75s =============================================

AFTER

================================================ short test summary info ================================================
PASSED tests/models/bart/test_modeling_bart.py::BartModelTest::test_model_parallelism
============================================= 1 passed, 4 warnings in 5.96s =============================================

Pls help revie this PR, thx! @amyeroberts and @ydshieh

@ydshieh ydshieh self-assigned this May 16, 2024
@ydshieh ydshieh self-requested a review May 21, 2024 15:26
@ydshieh
Copy link
Collaborator

ydshieh commented May 23, 2024

Good from my side, thanks. Let's maybe wait a remark the our accelerate experts before merge.

Copy link
Member

@SunMarc SunMarc left a comment

Choose a reason for hiding this comment

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

Thanks for the fix ! Left a comment

tests/test_modeling_common.py Show resolved Hide resolved
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.

Thanks!

@amyeroberts amyeroberts merged commit 04c7c17 into huggingface:main May 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

4 participants