MCPcopy Index your code
hub / github.com/apache/tvm / test_example_npu_codegen

Function test_example_npu_codegen

tests/python/contrib/test_example_npu.py:205–221  ·  view source on GitHub ↗

Test code generation for the example NPU backend

()

Source from the content-addressed store, hash-verified

203
204@example_npu_enabled
205def test_example_npu_codegen():
206 """Test code generation for the example NPU backend"""
207 import tvm.relax.backend.contrib.example_npu # noqa: F401
208
209 mod = MatmulReLU
210 patterns = get_patterns_with_prefix("example_npu")
211
212 # Partition and generate code
213 partitioned_mod = FuseOpsByPattern(patterns, bind_constants=False, annotate_codegen=True)(mod)
214 partitioned_mod = MergeCompositeFunctions()(partitioned_mod)
215 partitioned_mod = RunCodegen()(partitioned_mod)
216
217 assert partitioned_mod is not None
218
219 # The module should now contain external function calls
220 main_func = partitioned_mod["main"]
221 assert main_func is not None
222
223
224@example_npu_enabled

Callers 1

Calls 4

get_patterns_with_prefixFunction · 0.90
FuseOpsByPatternFunction · 0.90
MergeCompositeFunctionsFunction · 0.90
RunCodegenFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…