Skip to content

Commit

Permalink
Test for TVMC compile with TensorRT integration
Browse files Browse the repository at this point in the history
  • Loading branch information
akmaru committed May 25, 2021
1 parent 20a86ca commit e5b1a92
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/python/driver/tvmc/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,20 @@ def test_compile_tflite_module_with_external_codegen_vitis_ai(tflite_mobilenet_v
assert type(tvmc_package.params) is bytearray
assert os.path.exists(dumps_path)

def test_compile_tflite_module_with_external_codegen_tensorrt(tflite_mobilenet_v1_0_25_128):
pytest.importorskip("tflite")

tvmc_model = tvmc.load(tflite_mobilenet_v1_0_25_128)
tvmc_package = tvmc.compiler.compile_model(
tvmc_model, target="tensorrt, llvm", dump_code="relay")
dumps_path = tvmc_package.package_path + ".relay"

# check for output types
assert type(tvmc_package) is TVMCPackage
assert type(tvmc_package.graph) is str
assert type(tvmc_package.lib_path) is str
assert type(tvmc_package.params) is bytearray
assert os.path.exists(dumps_path)

@mock.patch("tvm.relay.build")
@mock.patch("tvm.driver.tvmc.composite_target.get_codegen_by_target")
Expand Down
1 change: 1 addition & 0 deletions tests/python/driver/tvmc/test_composite_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def test_get_codegen_names():

assert "ethos-n77" in names
assert "vitis-ai" in names
assert "tensorrt" in names
assert len(names) > 0


Expand Down

0 comments on commit e5b1a92

Please sign in to comment.