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] enable benchmark unit tests on XPU #29284

Merged
merged 7 commits into from Feb 27, 2024

Conversation

faaany
Copy link
Contributor

@faaany faaany commented Feb 26, 2024

What does this PR do?

Test Summary before Fix:

================================================== short test summary info ===================================================
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:149: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:38: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:70: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:54: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:165: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:85: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:102: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:182: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:202: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:118: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:133: test requires TensorFlow
FAILED tests/benchmark/test_benchmark.py::BenchmarkTest::test_inference_fp16 - ValueError: Mixed precision is possible only for GPU.
FAILED tests/benchmark/test_benchmark.py::BenchmarkTest::test_train_no_configs_fp16 - ValueError: Mixed precision is possible only for GPU.

Test Summary after Fix:

$ RUN_SLOW=1 TRANSFORMERS_TEST_DEVICE="xpu" TRANSFORMERS_TEST_DEVICE_SPEC="spec.py" python -m pytest -ra tests/benchmark
==================================================== test session starts =====================================================
platform linux -- Python 3.10.13, pytest-8.0.0, pluggy-1.4.0
rootdir: /soft/fanli/transformers
configfile: pyproject.toml
plugins: xdist-3.5.0, anyio-4.2.0, hypothesis-6.98.0
collected 24 items                                                                                                           

tests/benchmark/test_benchmark.py .............                                                                        [ 54%]
tests/benchmark/test_benchmark_tf.py sssssssssss                                                                       [100%]
================================================== short test summary info ===================================================
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:149: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:38: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:70: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:54: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:165: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:85: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:102: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:182: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:202: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:118: test requires TensorFlow
SKIPPED [1] tests/benchmark/test_benchmark_tf.py:133: test requires TensorFlow
======================================== 13 passed, 11 skipped, 30 warnings in 10.63s ========================================

@faaany faaany changed the title enable unit tests on XPU enable failed unit tests on XPU Feb 26, 2024
@faaany faaany changed the title enable failed unit tests on XPU enable unit tests on XPU Feb 26, 2024
@faaany faaany marked this pull request as ready for review February 27, 2024 04:09
@faaany faaany changed the title enable unit tests on XPU [tests] enable benchmark unit tests on XPU Feb 27, 2024
@faaany
Copy link
Contributor Author

faaany commented Feb 27, 2024

@amyeroberts @muellerz pls have a review, thx!

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.

LGTM - thanks for adding!

@amyeroberts amyeroberts merged commit 63a0c8f into huggingface:main Feb 27, 2024
17 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