openvino/tests/layer_tests
Katarzyna Mitrus 142114ccbc
[Op] Squeeze update - no throw on non-squeezable dims (#24715)
### Details:
- Changes needed to enable Squeeze (and models) with axes pointing to
non-squeezable dims (currently ov throws an error for such case) -
considered as backward compatible change
- If agreed to update functionality within the same version of the op,
actual changes are needed only in shape infer related functions to cover
**Template, CPU and GPU plugins**:
    -  src/core/shape_inference/include/squeeze_shape_inference.hpp
    -  src/plugins/intel_cpu/src/shape_inference/custom/reshape.cpp
    -  The rest of the changes are test related.
 - Pytorch FE Squeeze test enabled - passed

### Tickets:
 - 142387
2024-06-03 09:59:07 +00:00
..
common [OVC] Import openvino-tokenizers extensions from ovc tool (#24681) 2024-05-26 15:40:40 +00:00
jax_tests copyright year update (#23370) 2024-03-14 09:37:02 +00:00
mo_python_api_tests [GHA] Move tokenizers build to reusable job (#23909) 2024-04-19 19:12:17 +00:00
onnx_tests copyright year update (#23370) 2024-03-14 09:37:02 +00:00
ovc_python_api_tests [PT FE]: fix segfault when resolving nested dict as model input (#24719) 2024-05-27 21:24:01 +00:00
py_frontend_tests Fixed bug with inlined inputs (#24448) 2024-05-22 07:29:36 +00:00
pytorch_tests [Op] Squeeze update - no throw on non-squeezable dims (#24715) 2024-06-03 09:59:07 +00:00
tensorflow2_keras_tests [TFL FE] GELU implementation (#23669) 2024-04-24 21:55:26 +00:00
tensorflow_lite_tests copyright year update (#23370) 2024-03-14 09:37:02 +00:00
tensorflow_tests [TF FE] Xfail test for Rint on arm (#24810) 2024-06-03 12:12:42 +04:00
.gitignore Add layer tests (#5789) 2021-06-16 12:50:16 +03:00
CMakeLists.txt copyright year update (#23370) 2024-03-14 09:37:02 +00:00
README.md [DOCS][Layer Tests] Update layer test documentation (#23485) 2024-03-15 16:17:15 +00:00
conftest.py copyright year update (#23370) 2024-03-14 09:37:02 +00:00
pytest.ini Quantization support for torch.compile (#23779) 2024-04-03 12:36:56 +00:00
requirements.txt [TF FE] Reduce redundant deps and routines for layer tests (#24314) 2024-04-30 08:24:24 +00:00

README.md

Layer Tests

The layer tests primarily aim to validate support for PyTorch, TensorFlow, TensorFlow Lite, and ONNX frameworks' operations by OpenVINO. The test pipeline includes the following steps:

  1. Creation of a model with the tested operation using original framework API
  2. Conversion of the created model using OpenVINO's convert_model method
  3. Inference of both the original and converted models using the framework and OpenVINO on random input data
  4. Checking whether the inference results from OpenVINO and the framework are the same or different within a tolerance threshold

Setup Environment

To set up the environment for launching layer tests, perform the following steps:

  1. Install the OpenVINO wheel package. If you're testing changes in OpenVINO, build your local wheel package for installation. Find instructions on how to build on wiki page.
    pip install openvino.whl
    
  2. (Optional) Install the OpenVINO Tokenizers wheel package if you're testing the support of operations using conversion and operation extensions from OpenVINO Tokenizers. If you're testing changes in OpenVINO Tokenizers, build your local wheel package for installation. Find instructions on how to build on GitHub page
    pip install openvino_tokenizers.whl
    
  3. Install requirements for running layer tests.
    cd tests/layer_tests
    pip install -r requirements.txt
    

Run Tests

Set environment variables TEST_DEVICE and TEST_PRECISION to select device and inference precision for OpenVINO inference. Allowed values for TEST_DEVICE are CPU and GPU. Allowed values for TEST_PRECISION are FP32 and FP16.

Example to run the TensorFlow layer test for the tf.raw_ops.Unique operation on CPU with default inference precision for device:

cd tests/layer_tests
export TEST_DEVICE="CPU"
pytest tensorflow_tests/test_tf_Unique.py

Example to run the PyTorch layer test for the torch.linalg.cross operation on CPU and GPU with FP16 and FP32 inference precisions:

cd tests/layer_tests
export TEST_DEVICE="CPU;GPU"
export TEST_PRECISION="FP32;FP16"
pytest pytorch_tests/test_cross.py