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] rename test_config_object to test_ds_config_object #31403

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

faaany
Copy link
Contributor

@faaany faaany commented Jun 13, 2024

What does this PR do?

test_config is a common test name for many models and is identified as NOT_DEVICE_TESTS in the conftest.py). So when users use the test marker not_device_test to run the test suit, tests/deepspeed/test_deepspeed.py::TrainerIntegrationDeepSpeed::test_config_object will be skipped. But test_config_object is not a CPU-only UT and should not be skipped. Can we rename it to test_ds_config_object?

@amyeroberts and @ydshieh

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.

Sounds sensible to me! Thanks for looking into and updating this.

Again, let's get confirmation from @ydshieh here :)

@faaany
Copy link
Contributor Author

faaany commented Jun 18, 2024

Hi @ydshieh , could you take a look at this PR? Thx a lot!

@ydshieh
Copy link
Collaborator

ydshieh commented Jun 18, 2024

Hi @faaany . Thank you. Good from my side to change the names. But looking at conftest.py

def pytest_collection_modifyitems(items):
    for item in items:
        if any(test_name in item.nodeid for test_name in NOT_DEVICE_TESTS):
            item.add_marker(pytest.mark.not_device_test)

I think the mentioned issue could be avoided by changing

test_name in item.nodeid

to

test_name == item.nodeid

WDYT, does it makes sense? If so could you give it a try. We can keep the both current change with what I suggest (if that works well)

@faaany
Copy link
Contributor Author

faaany commented Jun 19, 2024

Hi @ydshieh , I am not sure whether it is a good idea because there are also test_name like ModelTest::test_pipeline_ or /utils/ in the NOT_DEVICE_TESTS variable. So I thought maybe it was designed to use in. WDYT?

@ydshieh
Copy link
Collaborator

ydshieh commented Jun 19, 2024

Hi @ydshieh , I am not sure whether it is a good idea because there are also test_name like ModelTest::test_pipeline_ or /utils/ in the NOT_DEVICE_TESTS variable. So I thought maybe it was designed to use in. WDYT?

Wow, thank you for checking this. I think so (I'm not the author of this part of code 😅 )

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.

Works for me. Thank you!

@ydshieh ydshieh merged commit 077c139 into huggingface:main Jun 19, 2024
19 checks passed
@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.

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