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

Function test_example_npu_patterns_registered

tests/python/contrib/test_example_npu.py:109–131  ·  view source on GitHub ↗

Test that all expected patterns are registered

()

Source from the content-addressed store, hash-verified

107
108
109def test_example_npu_patterns_registered():
110 """Test that all expected patterns are registered"""
111 import tvm.relax.backend.contrib.example_npu # noqa: F401
112
113 patterns = get_patterns_with_prefix("example_npu")
114 pattern_names = {p.name for p in patterns}
115
116 # Core patterns that should always be available
117 core_patterns = {
118 "example_npu.dense",
119 "example_npu.matmul",
120 "example_npu.conv1d",
121 "example_npu.conv2d",
122 "example_npu.max_pool2d",
123 }
124
125 assert core_patterns.issubset(pattern_names), (
126 f"Missing core patterns: {core_patterns - pattern_names}"
127 )
128
129 # Check that at least some activation patterns are available
130 activation_patterns = {name for name in pattern_names if "relu" in name or "sigmoid" in name}
131 assert len(activation_patterns) > 0, "No activation patterns found"
132
133
134@example_npu_enabled

Callers 1

Calls 1

get_patterns_with_prefixFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…