Skip to content

Commit

Permalink
Changelist to get Tests passing on main
Browse files Browse the repository at this point in the history
Some models were marked `compilation_xfail`:
* Bloom
* MNIST
* TorchVision Object Detection
* DETR

This also adds configuration for Ubuntu 24.04 and configures the url for
pip install in GH actions
  • Loading branch information
jmalone-tt committed Feb 27, 2025
1 parent ff84874 commit 645591a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/actions/common_repo_setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ runs:
run: |
df -h
python3 -m pip install --upgrade pip
python3 -m pip config set global.extra-index-url https://download.pytorch.org/whl/cpu
python3 -m pip install -r requirements-dev.txt
python3 -m pip install pytest-github-report
df -h
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/common_repo_setup/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,13 @@
"libhwloc-dev",
"graphviz",
"patchelf"
],
"ubuntu-24.04": [
"software-properties-common",
"build-essential",
"python3.10-venv",
"libhwloc-dev",
"graphviz",
"patchelf"
]
}
2 changes: 1 addition & 1 deletion tests/models/bloom/test_bloom.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _load_inputs(self):

@pytest.mark.parametrize(
"mode",
["eval"],
[pytest.param("eval", marks=pytest.mark.compilation_xfail)],
)
@pytest.mark.converted_end_to_end
def test_bloom(record_property, mode):
Expand Down
7 changes: 6 additions & 1 deletion tests/models/detr/test_detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ def _load_inputs(self):

@pytest.mark.parametrize(
"mode",
["eval"],
[
pytest.param(
"eval",
marks=pytest.mark.compilation_xfail,
),
],
)
def test_detr(record_property, mode):
model_name = "DETR"
Expand Down
2 changes: 1 addition & 1 deletion tests/models/mnist/test_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _load_inputs(self):

@pytest.mark.parametrize(
"mode",
["train", pytest.param("eval", marks=pytest.mark.converted_end_to_end)],
["train", pytest.param("eval", marks=pytest.mark.compilation_xfail)],
)
def test_mnist_train(record_property, mode):
model_name = "Mnist"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _load_inputs(self):
@pytest.mark.parametrize(
"model_info",
[
("ssd300_vgg16", "SSD300_VGG16_Weights"),
pytest.param(("ssd300_vgg16", "SSD300_VGG16_Weights"), marks=pytest.mark.compilation_xfail),
("ssdlite320_mobilenet_v3_large", "SSDLite320_MobileNet_V3_Large_Weights"),
("retinanet_resnet50_fpn", "RetinaNet_ResNet50_FPN_Weights"),
("retinanet_resnet50_fpn_v2", "RetinaNet_ResNet50_FPN_V2_Weights"),
Expand Down
6 changes: 3 additions & 3 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import torch
import numpy as np
import collections
import re
from collections.abc import Mapping, Sequence
from typing import List, Dict, Tuple


Expand Down Expand Up @@ -60,9 +60,9 @@ def compile_model(self, model, option):
return model

def run_model(self, model, inputs):
if isinstance(inputs, collections.Mapping):
if isinstance(inputs, Mapping):
return model(**inputs)
elif isinstance(inputs, collections.Sequence):
elif isinstance(inputs, Sequence):
return model(*inputs)
else:
return model(inputs)
Expand Down

0 comments on commit 645591a

Please sign in to comment.