This is an automated email from the ASF dual-hosted git repository.

manupa pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 265030eea4 [ETHOSN] Use partition_for_ function when running tests 
(#11945)
265030eea4 is described below

commit 265030eea4cf0447b5744b759d763158373167a2
Author: Luke Hutton <[email protected]>
AuthorDate: Thu Jun 30 18:11:21 2022 +0100

    [ETHOSN] Use partition_for_ function when running tests (#11945)
    
    Keeps the tests in parity with the partition_for_ function so any
    changes are reflected in the tests.
    
    Change-Id: I580cc381d382c777484e8251c609867a69da8e67
---
 tests/python/contrib/test_ethosn/infrastructure.py | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/tests/python/contrib/test_ethosn/infrastructure.py 
b/tests/python/contrib/test_ethosn/infrastructure.py
index a4c2090815..e1bbcf8ad3 100644
--- a/tests/python/contrib/test_ethosn/infrastructure.py
+++ b/tests/python/contrib/test_ethosn/infrastructure.py
@@ -28,7 +28,7 @@ from PIL import Image
 import os
 
 from . import _infrastructure
-from tvm.relay.op.contrib import get_pattern_table
+from tvm.relay.op.contrib import partition_for_ethosn
 
 
 def get_real_image(im_height, im_width):
@@ -155,17 +155,7 @@ def build(mod, params, npu=True, expected_host_ops=0, 
npu_partitions=1):
     ):
         with tvm.target.Target("llvm"):
             if npu:
-                f = relay.build_module.bind_params_by_name(mod["main"], params)
-                mod = tvm.IRModule()
-                mod["main"] = f
-                pattern = get_pattern_table("ethos-n")
-                mod = relay.transform.InferType()(mod)
-                mod = relay.transform.MergeComposite(pattern)(mod)
-                mod = relay.transform.AnnotateTarget("ethos-n")(mod)
-                mod = relay.transform.InferType()(mod)
-                mod = relay.transform.MergeCompilerRegions()(mod)
-                mod = relay.transform.InferType()(mod)
-                mod = relay.transform.PartitionGraph()(mod)
+                mod = partition_for_ethosn(mod, params, variant="n78")
                 host_op_count = get_host_op_count(mod)
                 assert (
                     host_op_count == expected_host_ops

Reply via email to