Skip to content

Commit f73a1f6

Browse files
authored
[TEST][TEDD] improve TEDD tests to also run on CPU Docker image. (#6643)
* Amend regular expressions to match with what is being reported by CPU Docker image Graphviz * Fix typo on dependency checking function * Organise imports
1 parent 0922d17 commit f73a1f6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/python/contrib/test_tedd.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
from tvm import te
18-
import numpy as np
1917
import re
18+
19+
from tvm import te
2020
from tvm import topi
2121

2222

@@ -25,7 +25,7 @@ def findany(pattern, str):
2525
assert len(matches) > 0, "Pattern not found.\nPattern: " + pattern + "\nString: " + str
2626

2727

28-
def checkdepdency():
28+
def checkdependency():
2929
import pkg_resources
3030

3131
return not {"graphviz", "ipython"} - {pkg.key for pkg in pkg_resources.working_set}
@@ -55,7 +55,7 @@ def verify():
5555
findany(r"Tensor_3_0 -> Stage_4:I_1", str)
5656
findany(r"Stage_4:O_0 -> Tensor_4_0", str)
5757

58-
if checkdepdency():
58+
if checkdependency():
5959
verify()
6060

6161

@@ -79,16 +79,16 @@ def verify():
7979
findany(r"subgraph cluster_Stage_0", str)
8080
findany(r"subgraph cluster_Stage_1", str)
8181
# Check itervars and their types
82-
findany(r"i\(kDataPar\)\<br/\>range\(min=0, ext=n\)", str)
83-
findany(r"k\(kCommReduce\)\<br/\>range\(min=0, ext=m\)", str)
82+
findany(r"\(kDataPar\)\<br/\>range\(min=0, ext=n\)", str)
83+
findany(r"\(kCommReduce\)\<br/\>range\(min=0, ext=m\)", str)
8484
# Check the split node
8585
findany(r"Split_Relation_1_0 +.+\>Split", str)
8686
# Check all edges to/from the split node
8787
findany(r"IterVar_1_1:itervar -> Split_Relation_1_0:Input", str)
8888
findany(r"Split_Relation_1_0:Outer -> IterVar_1_2:itervar", str)
8989
findany(r"Split_Relation_1_0:Inner -> IterVar_1_3:itervar", str)
9090

91-
if checkdepdency():
91+
if checkdependency():
9292
verify()
9393

9494

@@ -129,18 +129,18 @@ def verify():
129129
# and compute
130130
findany(
131131
r"Stage_1.*A\.shared<br/>Scope: shared.+>0.+>"
132-
r"ax0\(kDataPar\).+>1.+ax1\(kDataPar\).+>2.+>ax2\(kDataPar\).+>"
133-
r"\[A\(ax0, ax1, ax2\)\]",
132+
r"ax0.*\(kDataPar\).+>1.+ax1.*\(kDataPar\).+>2.+>ax2.*\(kDataPar\).+>"
133+
r"\[A[\[\(]ax0, ax1, ax2[\)\]]\]",
134134
str,
135135
)
136136
# Check itervars of types different from KDataPar
137-
findany(r"bk\(kVectorized\)", str)
138-
findany(r"r.outer\(kCommReduce\)", str)
137+
findany(r"bk.*\(kVectorized\)", str)
138+
findany(r"r.outer.*\(kCommReduce\)", str)
139139
findany(r"label=ROOT", str)
140140
# Check the compute_at edge
141141
findany(r"Stage_1.*\[color\=\"\#000000\"\]", str)
142142

143-
if checkdepdency():
143+
if checkdependency():
144144
verify()
145145

146146

0 commit comments

Comments
 (0)