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

make cuda-only tests device-agnostic #2044

Merged
merged 6 commits into from
Sep 13, 2024
Merged

Conversation

faaany
Copy link
Contributor

@faaany faaany commented Sep 9, 2024

What does this PR do?

As the title suggests, below are the results on XPU:

================================================ short test summary info ================================================
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_00_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_01_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_02_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_03_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_04_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_05_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_06_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_07_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_08_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_09_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_10_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_11_trl_internal_testing_tiny_random_LlamaForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_12_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_13_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_14_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_15_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_16_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_17_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_18_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_19_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_20_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_21_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_22_HuggingFaceM4_tiny_random_MistralForCausalLM
PASSED tests/slow/test_sft_slow.py::SFTTrainerSlowTester::test_sft_trainer_transformers_mp_gc_device_map_23_HuggingFaceM4_tiny_random_MistralForCausalLM
============================== 24 passed, 378 deselected, 81 warnings in 196.87s (0:03:16) ==============================

@faaany
Copy link
Contributor Author

faaany commented Sep 9, 2024

@qgallouedec

Copy link
Member

@lewtun lewtun 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 clean implementation @faaany ! Since we don't currently have dedicated tests per hardware, this approach seems good to me having separate decorators like require_torch_gpu and require_torch_xpu as we do in transformers.

Can you please run make precommit to solve the code quality issues?

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

@faaany
Copy link
Contributor Author

faaany commented Sep 12, 2024

Thanks for the clean implementation @faaany ! Since we don't currently have dedicated tests per hardware, this approach seems good to me having separate decorators like require_torch_gpu and require_torch_xpu as we do in transformers.

Can you please run make precommit to solve the code quality issues?

Hi @lewtun , thanks for reviewing my PR! style fixed.

@lewtun lewtun merged commit d47220f into huggingface:main Sep 13, 2024
9 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.

3 participants