Skip to content

Commit

Permalink
Add model tests to push
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksKnezevic committed Dec 17, 2024
1 parent 1766a31 commit 9663e31
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
run: |
cp -r ${{ steps.strings.outputs.install-output-dir }}/tt-metal/* ${{ steps.strings.outputs.work-dir }}/third_party/tt-mlir/src/tt-mlir/third_party/tt-metal/src/tt-metal
- name: Run PyTorch tests
- name: Run PyTorch Unit tests
shell: bash
run: |
source env/activate
Expand All @@ -98,7 +98,28 @@ jobs:
name: test-reports-torch-${{ matrix.build.runs-on }}-${{ matrix.build.name }}
path: ${{ steps.strings.outputs.test_report_path_torch }}

- name: Run ONNX tests
- name: Run Supported Models
shell: bash
run: |
source env/activate
export LD_LIBRARY_PATH="/opt/ttmlir-toolchain/lib/:${{ steps.strings.outputs.install-output-dir }}/lib:${{ steps.strings.outputs.build-output-dir }}/lib:./lib/:${LD_LIBRARY_PATH}"
pytest -v tests/models/mgp-str-base/test_mgp_str_base.py::test_mgp_str_base[eval] \
tests/models/autoencoder_linear/test_autoencoder_linear.py::test_autoencoder_linear[eval] \
tests/models/MobileNetV2/test_MobileNetV2.py::test_MobileNetV2[eval] \
tests/models/beit/test_beit_image_classification.py::test_beit_image_classification[microsoft/beit-base-patch16-224-eval] \
tests/models/beit/test_beit_image_classification.py::test_beit_image_classification[microsoft/beit-large-patch16-224-eval] \
tests/models/perceiver_io/test_perceiver_io.py::test_perceiver_io[eval] \
tests/models/openpose/test_openpose_v2.py::test_openpose_v2[eval] \
--junit-xml=${{ steps.strings.outputs.test_report_path_models }}
- name: Upload Test Report Torch
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-reports-models-${{ matrix.build.runs-on }}-${{ matrix.build.name }}
path: ${{ steps.strings.outputs.test_report_path_models }}

- name: Run ONNX Unit tests
shell: bash
run: |
source env/activate
Expand Down
3 changes: 2 additions & 1 deletion tests/models/MobileNetV2/test_MobileNetV2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import pytest
from tests.utils import ModelTester
from tt_torch.tools.utils import CompilerConfig
from tt_torch.tools.utils import CompilerConfig, CompileDepth


class ThisTester(ModelTester):
Expand Down Expand Up @@ -42,6 +42,7 @@ def test_MobileNetV2(record_property, mode):
cc = CompilerConfig()
cc.enable_consteval = True
cc.consteval_parameters = True
cc.compile_depth = CompileDepth.TTNN_IR

tester = ThisTester(model_name, mode, compiler_config=cc)
results = tester.test_model()
Expand Down
3 changes: 2 additions & 1 deletion tests/models/beit/test_beit_image_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
import torch
from tests.utils import ModelTester
from tt_torch.tools.utils import CompilerConfig
from tt_torch.tools.utils import CompilerConfig, CompileDepth


class ThisTester(ModelTester):
Expand Down Expand Up @@ -52,6 +52,7 @@ def test_beit_image_classification(record_property, model_name, mode):
cc = CompilerConfig()
cc.enable_consteval = True
cc.consteval_parameters = True
cc.compile_depth = CompileDepth.TTNN_IR

tester = ThisTester(model_name, mode, compiler_config=cc)
results = tester.test_model()
Expand Down
3 changes: 2 additions & 1 deletion tests/models/mgp-str-base/test_mgp_str_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from transformers import MgpstrProcessor, MgpstrForSceneTextRecognition
import pytest
from tests.utils import ModelTester
from tt_torch.tools.utils import CompilerConfig
from tt_torch.tools.utils import CompilerConfig, CompileDepth


class ThisTester(ModelTester):
Expand Down Expand Up @@ -47,6 +47,7 @@ def test_mgp_str_base(record_property, mode):
cc = CompilerConfig()
cc.enable_consteval = True
cc.consteval_parameters = True
cc.compile_depth = CompileDepth.TTNN_IR

tester = ThisTester(model_name, mode, compiler_config=cc)
results = tester.test_model()
Expand Down
3 changes: 2 additions & 1 deletion tests/models/openpose/test_openpose_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from torchvision import transforms
import pytest
from tests.utils import ModelTester
from tt_torch.tools.utils import CompilerConfig
from tt_torch.tools.utils import CompilerConfig, CompileDepth


def get_image_tensor():
Expand Down Expand Up @@ -60,6 +60,7 @@ def test_openpose_v2(record_property, mode):
cc = CompilerConfig()
cc.enable_consteval = True
cc.consteval_parameters = True
cc.compile_depth = CompileDepth.TTNN_IR

tester = ThisTester(model_name, mode, compiler_config=cc)
results = tester.test_model()
Expand Down
3 changes: 2 additions & 1 deletion tests/models/perceiver_io/test_perceiver_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
from tests.utils import ModelTester
import torch
from tt_torch.tools.utils import CompilerConfig
from tt_torch.tools.utils import CompilerConfig, CompileDepth


class ThisTester(ModelTester):
Expand Down Expand Up @@ -47,6 +47,7 @@ def test_perceiver_io(record_property, mode):
cc = CompilerConfig()
cc.enable_consteval = True
cc.consteval_parameters = True
cc.compile_depth = CompileDepth.TTNN_IR

tester = ThisTester(model_name, mode, compiler_config=cc)
results = tester.test_model()
Expand Down

0 comments on commit 9663e31

Please sign in to comment.