Compare commits

...

3 Commits

Author SHA1 Message Date
Prashant Kumar
d8c9225af8 Add unet_torch reference. (#283)
* Add unet_torch reference.

* Delete distilbert-base-uncased_torch_test.py
2022-08-19 13:35:10 +05:30
Prashant Kumar
62f3573d43 Add distilbert_torch reference. 2022-08-19 13:34:26 +05:30
Stanley Winata
b73f79be66 Add Substantial testing for IntelGPU 2022-08-18 21:21:43 -07:00
37 changed files with 950 additions and 1 deletions

View File

@@ -0,0 +1,109 @@
from shark.shark_inference import SharkInference
from shark.iree_utils._common import check_device_drivers, device_driver_info
from tank.model_utils import compare_tensors
from shark.shark_downloader import download_torch_model
from shark.parser import shark_args
import torch
import unittest
import numpy as np
import pytest
class BertBaseUncasedModuleTester:
def __init__(
self,
benchmark=False,
onnx_bench=False,
):
self.benchmark = benchmark
self.onnx_bench = onnx_bench
def create_and_check_module(self, dynamic, device):
model_mlir, func_name, input, act_out = download_torch_model(
"bert-base-uncased", dynamic
)
shark_module = SharkInference(
model_mlir,
func_name,
device=device,
mlir_dialect="linalg",
is_benchmark=self.benchmark,
)
shark_module.compile()
results = shark_module.forward(input)
assert True == compare_tensors(act_out, results)
if self.benchmark == True:
shark_args.onnx_bench = self.onnx_bench
shark_module.shark_runner.benchmark_all_csv(
(input),
"bert-base-uncased",
dynamic,
device,
"torch",
)
class BertBaseUncasedModuleTest(unittest.TestCase):
@pytest.fixture(autouse=True)
def configure(self, pytestconfig):
self.module_tester = BertBaseUncasedModuleTester(self)
self.module_tester.benchmark = pytestconfig.getoption("benchmark")
self.module_tester.onnx_bench = pytestconfig.getoption("onnx_bench")
def test_module_static_cpu(self):
dynamic = False
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
def test_module_dynamic_cpu(self):
dynamic = True
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_static_gpu(self):
dynamic = False
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_dynamic_gpu(self):
dynamic = True
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_static_vulkan(self):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_dynamic_vulkan(self):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":
unittest.main()

View File

@@ -0,0 +1,71 @@
from shark.iree_utils._common import check_device_drivers, device_driver_info
from shark.shark_inference import SharkInference
from shark.shark_downloader import download_tf_model
import iree.compiler as ireec
import unittest
import pytest
import numpy as np
class DistilBertModuleTester:
def __init__(
self,
benchmark=False,
):
self.benchmark = benchmark
def create_and_check_module(self, dynamic, device):
model, func_name, inputs, golden_out = download_tf_model(
"distilbert-base-uncased"
)
shark_module = SharkInference(
model, func_name, device=device, mlir_dialect="mhlo"
)
shark_module.compile()
result = shark_module.forward(inputs)
np.testing.assert_allclose(golden_out, result, rtol=1e-02, atol=1e-03)
class DistilBertModuleTest(unittest.TestCase):
@pytest.fixture(autouse=True)
def configure(self, pytestconfig):
self.module_tester = DistilBertModuleTester(self)
self.module_tester.benchmark = pytestconfig.getoption("benchmark")
@pytest.mark.xfail(reason="shark_tank hash issues -- awaiting triage")
def test_module_static_cpu(self):
dynamic = False
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.xfail(reason="shark_tank hash issues -- awaiting triage")
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_static_gpu(self):
dynamic = False
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.xfail(reason="shark_tank hash issues -- awaiting triage")
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_static_vulkan(self):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":
unittest.main()

View File

@@ -0,0 +1,95 @@
from shark.shark_inference import SharkInference
from shark.iree_utils._common import check_device_drivers, device_driver_info
from tank.model_utils import compare_tensors
from shark.parser import shark_args
from shark.shark_downloader import download_torch_model
import unittest
import numpy as np
import pytest
class DistilBertModuleTester:
def __init__(
self,
benchmark=False,
):
self.benchmark = benchmark
def create_and_check_module(self, dynamic, device):
model_mlir, func_name, input, act_out = download_torch_model(
"distilbert-base-uncased", dynamic
)
# from shark.shark_importer import SharkImporter
# mlir_importer = SharkImporter(
# model,
# (input,),
# frontend="torch",
# )
# minilm_mlir, func_name = mlir_importer.import_mlir(
# is_dynamic=dynamic, tracing_required=True
# )
shark_module = SharkInference(
model_mlir,
func_name,
device=device,
mlir_dialect="linalg",
is_benchmark=self.benchmark,
)
shark_module.compile()
results = shark_module.forward(input)
assert True == compare_tensors(act_out, results)
if self.benchmark == True:
shark_module.shark_runner.benchmark_all_csv(
(input),
"distilbert-base-uncased",
dynamic,
device,
"torch",
)
class DistilBertModuleTest(unittest.TestCase):
@pytest.fixture(autouse=True)
def configure(self, pytestconfig):
self.module_tester = DistilBertModuleTester(self)
self.module_tester.save_mlir = pytestconfig.getoption("save_mlir")
self.module_tester.save_vmfb = pytestconfig.getoption("save_vmfb")
self.module_tester.benchmark = pytestconfig.getoption("benchmark")
def test_module_static_cpu(self):
dynamic = False
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_static_gpu(self):
dynamic = False
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_static_vulkan(self):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":
unittest.main()

View File

@@ -0,0 +1,114 @@
from shark.shark_inference import SharkInference
from shark.iree_utils._common import check_device_drivers, device_driver_info
from shark.shark_downloader import download_torch_model
import unittest
import numpy as np
import pytest
class MobileNetV3ModuleTester:
def __init__(
self,
benchmark=False,
):
self.benchmark = benchmark
def create_and_check_module(self, dynamic, device):
model_mlir, func_name, input, act_out = download_torch_model(
"mobilenet_v3_small", dynamic
)
# from shark.shark_importer import SharkImporter
# mlir_importer = SharkImporter(
# model,
# (input,),
# frontend="torch",
# )
# minilm_mlir, func_name = mlir_importer.import_mlir(
# is_dynamic=dynamic, tracing_required=True
# )
shark_module = SharkInference(
model_mlir,
func_name,
device=device,
mlir_dialect="linalg",
is_benchmark=self.benchmark,
)
shark_module.compile()
results = shark_module.forward(input)
np.testing.assert_allclose(act_out, results, rtol=1e-02, atol=1e-03)
if self.benchmark == True:
shark_module.shark_runner.benchmark_all_csv(
(input),
"alexnet",
dynamic,
device,
"torch",
)
class MobileNetV3ModuleTest(unittest.TestCase):
@pytest.fixture(autouse=True)
def configure(self, pytestconfig):
self.module_tester = MobileNetV3ModuleTester(self)
self.module_tester.benchmark = pytestconfig.getoption("benchmark")
def test_module_static_cpu(self):
dynamic = False
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
def test_module_dynamic_cpu(self):
dynamic = True
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.xfail(reason="golden results don't match.")
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_static_gpu(self):
dynamic = False
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.xfail(reason="golden results don't match.")
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_dynamic_gpu(self):
dynamic = True
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.xfail(reason="stuck in the pipeline.")
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_static_vulkan(self):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_dynamic_vulkan(self):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":
unittest.main()

View File

@@ -0,0 +1,114 @@
from shark.shark_inference import SharkInference
from shark.iree_utils._common import check_device_drivers, device_driver_info
from tank.model_utils import compare_tensors
from shark.shark_downloader import download_torch_model
import unittest
import numpy as np
import pytest
class Resnet101ModuleTester:
def __init__(
self,
benchmark=False,
):
self.benchmark = benchmark
def create_and_check_module(self, dynamic, device):
model_mlir, func_name, input, act_out = download_torch_model(
"resnet101", dynamic
)
# from shark.shark_importer import SharkImporter
# mlir_importer = SharkImporter(
# model,
# (input,),
# frontend="torch",
# )
# minilm_mlir, func_name = mlir_importer.import_mlir(
# is_dynamic=dynamic, tracing_required=True
# )
shark_module = SharkInference(
model_mlir,
func_name,
device=device,
mlir_dialect="linalg",
is_benchmark=self.benchmark,
)
shark_module.compile()
results = shark_module.forward(input)
assert True == compare_tensors(act_out, results)
if self.benchmark == True:
shark_module.shark_runner.benchmark_all_csv(
(input),
"resnet101",
dynamic,
device,
"torch",
)
class Resnet101ModuleTest(unittest.TestCase):
@pytest.fixture(autouse=True)
def configure(self, pytestconfig):
self.module_tester = Resnet101ModuleTester(self)
self.module_tester.save_mlir = pytestconfig.getoption("save_mlir")
self.module_tester.save_vmfb = pytestconfig.getoption("save_vmfb")
self.module_tester.benchmark = pytestconfig.getoption("benchmark")
def test_module_static_cpu(self):
dynamic = False
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
def test_module_dynamic_cpu(self):
dynamic = True
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_static_gpu(self):
dynamic = False
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_dynamic_gpu(self):
dynamic = True
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_static_vulkan(self):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_dynamic_vulkan(self):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":
unittest.main()

View File

@@ -0,0 +1,114 @@
from shark.shark_inference import SharkInference
from shark.iree_utils._common import check_device_drivers, device_driver_info
from tank.model_utils import get_vision_model, compare_tensors
from shark.shark_downloader import download_torch_model
import unittest
import numpy as np
import pytest
class Resnet50ModuleTester:
def __init__(
self,
benchmark=False,
):
self.benchmark = benchmark
def create_and_check_module(self, dynamic, device):
model_mlir, func_name, input, act_out = download_torch_model(
"resnet50", dynamic
)
# from shark.shark_importer import SharkImporter
# mlir_importer = SharkImporter(
# model,
# (input,),
# frontend="torch",
# )
# minilm_mlir, func_name = mlir_importer.import_mlir(
# is_dynamic=dynamic, tracing_required=True
# )
shark_module = SharkInference(
model_mlir,
func_name,
device=device,
mlir_dialect="linalg",
is_benchmark=self.benchmark,
)
shark_module.compile()
results = shark_module.forward(input)
assert True == compare_tensors(act_out, results)
if self.benchmark == True:
shark_module.shark_runner.benchmark_all_csv(
(input),
"resnet50",
dynamic,
device,
"torch",
)
class Resnet50ModuleTest(unittest.TestCase):
@pytest.fixture(autouse=True)
def configure(self, pytestconfig):
self.module_tester = Resnet50ModuleTester(self)
self.module_tester.save_mlir = pytestconfig.getoption("save_mlir")
self.module_tester.save_vmfb = pytestconfig.getoption("save_vmfb")
self.module_tester.benchmark = pytestconfig.getoption("benchmark")
def test_module_static_cpu(self):
dynamic = False
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
def test_module_dynamic_cpu(self):
dynamic = True
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_static_gpu(self):
dynamic = False
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_dynamic_gpu(self):
dynamic = True
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_static_vulkan(self):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_dynamic_vulkan(self):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":
unittest.main()

View File

@@ -0,0 +1,91 @@
from shark.shark_inference import SharkInference
from shark.iree_utils._common import check_device_drivers, device_driver_info
from shark.shark_downloader import download_torch_model
import unittest
import numpy as np
import pytest
class UnetModuleTester:
def __init__(
self,
benchmark=False,
):
self.benchmark = benchmark
def create_and_check_module(self, dynamic, device):
model_mlir, func_name, input, act_out = download_torch_model(
"unet", dynamic
)
# from shark.shark_importer import SharkImporter
# mlir_importer = SharkImporter(
# model,
# (input,),
# frontend="torch",
# )
# minilm_mlir, func_name = mlir_importer.import_mlir(
# is_dynamic=dynamic, tracing_required=True
# )
shark_module = SharkInference(
model_mlir,
func_name,
device=device,
mlir_dialect="linalg",
is_benchmark=self.benchmark,
)
shark_module.compile()
results = shark_module.forward(input)
np.testing.assert_allclose(act_out, results, rtol=1e-02, atol=1e-03)
if self.benchmark == True:
shark_module.shark_runner.benchmark_all_csv(
(input),
"unet",
dynamic,
device,
"torch",
)
class UnetModuleTest(unittest.TestCase):
@pytest.fixture(autouse=True)
def configure(self, pytestconfig):
self.module_tester = UnetModuleTester(self)
self.module_tester.benchmark = pytestconfig.getoption("benchmark")
def test_module_static_cpu(self):
dynamic = False
device = "cpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("gpu"), reason=device_driver_info("gpu")
)
def test_module_static_gpu(self):
dynamic = False
device = "gpu"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("vulkan"), reason=device_driver_info("vulkan")
)
def test_module_static_vulkan(self):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":
unittest.main()

View File

@@ -87,6 +87,14 @@ class MiniLMModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -100,6 +100,14 @@ class MiniLMModuleTest(unittest.TestCase):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -99,6 +99,15 @@ class AlbertModuleTest(unittest.TestCase):
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":
unittest.main()

View File

@@ -101,6 +101,14 @@ class AlexnetModuleTest(unittest.TestCase):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -103,6 +103,14 @@ class BertBaseUncasedModuleTest(unittest.TestCase):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -57,6 +57,14 @@ class BertBaseUncasedModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -94,6 +94,14 @@ class BertBaseUncasedModuleTest(unittest.TestCase):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -54,6 +54,14 @@ class CamemBertModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -57,6 +57,14 @@ class ConvBertModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -58,6 +58,14 @@ class DebertaBaseModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -57,6 +57,14 @@ class DistilBertModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -113,6 +113,15 @@ class DistilBertModuleTest(unittest.TestCase):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
# @pytest.mark.skip(reason="DistilBert needs to be uploaded to cloud.")
# @pytest.mark.skipif(
# check_device_drivers("intel-gpu"),
# reason=device_driver_info("intel-gpu"),
# )
# def test_module_static_intel_gpu(self):
# dynamic = False
# device = "intel-gpu"
# self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -54,6 +54,14 @@ class ElectraModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -63,6 +63,14 @@ class ConvNextTinyModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
# @pytest.mark.skipif(
# check_device_drivers("intel-gpu"),
# reason=device_driver_info("intel-gpu"),
# )
# def test_module_static_intel_gpu(self):
# dynamic = False
# device = "intel-gpu"
# self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -60,6 +60,14 @@ class FunnelModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
# @pytest.mark.skipif(
# check_device_drivers("intel-gpu"),
# reason=device_driver_info("intel-gpu"),
# )
# def test_module_static_intel_gpu(self):
# dynamic = False
# device = "intel-gpu"
# self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -60,6 +60,14 @@ class VitBaseModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
# @pytest.mark.skipif(
# check_device_drivers("intel-gpu"),
# reason=device_driver_info("intel-gpu"),
# )
# def test_module_static_intel_gpu(self):
# dynamic = False
# device = "intel-gpu"
# self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -54,6 +54,14 @@ class LayoutLMModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -55,6 +55,14 @@ class LongformerModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -100,6 +100,14 @@ class MobileNetV3ModuleTest(unittest.TestCase):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -57,6 +57,14 @@ class MpNetModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
# @pytest.mark.skipif(
# check_device_drivers("intel-gpu"),
# reason=device_driver_info("intel-gpu"),
# )
# def test_module_static_intel_gpu(self):
# dynamic = False
# device = "intel-gpu"
# self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -55,6 +55,14 @@ class RemBertModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -100,6 +100,14 @@ class Resnet101ModuleTest(unittest.TestCase):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -99,7 +99,14 @@ class Resnet18ModuleTest(unittest.TestCase):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":
unittest.main()

View File

@@ -67,6 +67,14 @@ class Resnet50ModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -100,6 +100,14 @@ class Resnet50ModuleTest(unittest.TestCase):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -60,6 +60,14 @@ class RobertaBaseModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -57,6 +57,14 @@ class TapasBaseModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -55,6 +55,14 @@ class FlauBertModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -100,6 +100,14 @@ class WideResnet50ModuleTest(unittest.TestCase):
dynamic = True
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":

View File

@@ -57,6 +57,14 @@ class XLMRobertaModuleTest(unittest.TestCase):
dynamic = False
device = "vulkan"
self.module_tester.create_and_check_module(dynamic, device)
@pytest.mark.skipif(
check_device_drivers("intel-gpu"),
reason=device_driver_info("intel-gpu"),
)
def test_module_static_intel_gpu(self):
dynamic = False
device = "intel-gpu"
self.module_tester.create_and_check_module(dynamic, device)
if __name__ == "__main__":