Skip to content

Commit 29087bc

Browse files
committed
Add common compute sets to compute set name checking
Summary: This should help reduce CI breaking. Ref T38708 TF2.4 Only Test Plan: CI Reviewers: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, vladimirm, babakk Reviewed By: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, vladimirm, babakk Maniphest Tasks: T38708 Differential Revision: https://phabricator.sourcevertex.net/D56756
1 parent 6de845d commit 29087bc

19 files changed

+61
-175
lines changed

tensorflow/compiler/plugin/poplar/tests/casts_elimination_test.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def testReductionSumVectorF16NoConverts(self):
5151
report = pva.openReport(report_helper.find_report())
5252
# Check that there are no casts to float at the beginning.
5353
ok = [
54-
'__seed*', 'host-exchange-local-copy-',
5554
'Sum/reduce*/ReduceOnTile/InToIntermediateNoExchange/Reduce',
5655
'Sum/reduce*/ReduceFinalStage/IntermediateToOutput/Reduce'
5756
]
@@ -95,7 +94,6 @@ def testNoCastsF16ReduceWithReshape(self):
9594

9695
report = pva.openReport(report_helper.find_report())
9796
ok = [
98-
'__seed*',
9997
'Sum/reduce*/Reduce',
10098
]
10199
self.assert_all_compute_sets_and_list(report, ok)
@@ -124,10 +122,7 @@ def testMultipleReduces(self):
124122
self.assertAllClose(result, 7.5)
125123

126124
report = pva.openReport(report_helper.find_report())
127-
ok = [
128-
'__seed*', 'host-exchange-local-copy-', 'Sum/reduce*/Reduce',
129-
'Sum_1/reduce*/Reduce', 'add/add'
130-
]
125+
ok = ['Sum/reduce*/Reduce', 'Sum_1/reduce*/Reduce', 'add/add']
131126
self.assert_all_compute_sets_and_list(report, ok)
132127

133128
def testNoCastsF16ToF32ToF16(self):
@@ -170,8 +165,8 @@ def testDontRemoveCastsIfUsed(self):
170165

171166
report = pva.openReport(report_helper.find_report())
172167
ok = [
173-
'__seed*', 'host-exchange-local-copy-', 'add/*/expression/Cast',
174-
'add/*/expression/Op/Add', 'Cast_1/convert.*/Cast'
168+
'add/*/expression/Cast', 'add/*/expression/Op/Add',
169+
'Cast_1/convert.*/Cast'
175170
]
176171
self.assert_all_compute_sets_and_list(report, ok)
177172

@@ -194,8 +189,7 @@ def testReduceMean(self):
194189

195190
report = pva.openReport(report_helper.find_report())
196191
ok = [
197-
'__seed*', 'host-exchange-local-copy-', 'Mean/fusion/Reduce',
198-
'Mean/fusion*/Op/Multiply', 'Mean/convert*/Cast'
192+
'Mean/fusion/Reduce', 'Mean/fusion*/Op/Multiply', 'Mean/convert*/Cast'
199193
]
200194
self.assert_all_compute_sets_and_list(report, ok)
201195

@@ -218,10 +212,7 @@ def testReduceMax(self):
218212
self.assertAllClose(result, [val, val])
219213

220214
report = pva.openReport(report_helper.find_report())
221-
ok = [
222-
'__seed*', 'host-exchange-local-copy-', 'Max/reduce*/Reduce',
223-
'Cast/convert*/Cast'
224-
]
215+
ok = ['Max/reduce*/Reduce', 'Cast/convert*/Cast']
225216
self.assert_all_compute_sets_and_list(report, ok)
226217

227218

tensorflow/compiler/plugin/poplar/tests/conv3d_test.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ def test3DConv3x3x3_WithBias(self):
8181
self.assertAllClose(result, np.zeros([1, 14, 14, 14, 32]))
8282

8383
report = pva.openReport(report_helper.find_report())
84-
ok = [
85-
'__seed*', 'host-exchange-local-copy-',
86-
'convolution/convolution.*/Conv_3x3x3', 'BiasAdd/fusion/Op/Add'
87-
]
84+
ok = ['convolution/convolution.*/Conv_3x3x3', 'BiasAdd/fusion/Op/Add']
8885
self.assert_all_compute_sets_and_list(report, ok)
8986

9087
def test3DConv8x8x8_WithBias(self):
@@ -115,7 +112,6 @@ def test3DConv8x8x8_WithBias(self):
115112

116113
report = pva.openReport(report_helper.find_report())
117114
ok = [
118-
'__seed*', 'host-exchange-local-copy-', 'Copy_',
119115
'Conv3D/convolution.*/Conv_8x8x8_stride4x4x4', 'BiasAdd/fusion/Op/Add'
120116
]
121117
self.assert_all_compute_sets_and_list(report, ok)
@@ -147,10 +143,7 @@ def test3DConv1x1x1_WithBias(self):
147143
self.assertAllClose(result, np.zeros([1, 1, 1, 1, 8]))
148144

149145
report = pva.openReport(report_helper.find_report())
150-
ok = [
151-
'__seed*', 'host-exchange-local-copy-',
152-
'Conv3D/convolution.*/Conv_1x1', 'add/fusion/Op/Add'
153-
]
146+
ok = ['Conv3D/convolution.*/Conv_1x1', 'add/fusion/Op/Add']
154147
self.assert_all_compute_sets_and_list(report, ok)
155148

156149
def test3DConvBackpropInput(self):
@@ -181,8 +174,7 @@ def test3DConvBackpropInput(self):
181174

182175
report = pva.openReport(report_helper.find_report())
183176
ok = [
184-
'__seed*', 'Conv3DBackpropInputV2/conv-with-reverse/Conv_2x2x2',
185-
'copy*/OnTileCopy-'
177+
'Conv3DBackpropInputV2/conv-with-reverse/Conv_2x2x2',
186178
]
187179
self.assert_all_compute_sets_and_list(report, ok)
188180

@@ -213,9 +205,7 @@ def test3DConvBackpropFilter(self):
213205
self.assertAllClose(result, np.zeros([2, 2, 2, 3, 5]))
214206

215207
report = pva.openReport(report_helper.find_report())
216-
ok = [
217-
'__seed*', 'Copy_', 'Conv3DBackpropFilterV2/convolution.*/Conv_8x8x8'
218-
]
208+
ok = ['Conv3DBackpropFilterV2/convolution.*/Conv_8x8x8']
219209
self.assert_all_compute_sets_and_list(report, ok)
220210

221211

tensorflow/compiler/plugin/poplar/tests/conv_graph_caching_sharded_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def testConvolutionsDontMatchDifferentDevices(self):
6767
report = pva.openReport(report_helper.find_report())
6868
# Note how there are two convolutions
6969
ok = [
70-
'__seed*', '*OnTileCopy*', 'vs/conv2d/Conv2D/convolution.*',
70+
'*OnTileCopy*', 'vs/conv2d/Conv2D/convolution.*',
7171
'Copy_vs/conv2d/Conv2D/convolution.*',
7272
'vs/conv2d_1/Conv2D/convolution.*'
7373
]

tensorflow/compiler/plugin/poplar/tests/conv_graph_caching_test.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ def testConvolutionsMatch(self):
7575
# Would fail if there were two convolutions in the graph as they would be
7676
# called conv2d and conv2d_1
7777
ok = [
78-
'__seed*', 'host-exchange-local-copy-', 'Copy_',
79-
'vs/conv2d/Conv2D/convolution.*/Conv_1x1', 'Copy_'
78+
'vs/conv2d/Conv2D/convolution.*/Conv_1x1',
8079
]
8180
self.assert_all_compute_sets_and_list(report, ok)
8281

@@ -118,9 +117,6 @@ def testConvolutionsDontMatchDifferentTypes(self):
118117
report = pva.openReport(report_helper.find_report())
119118
# Matches two convolutions
120119
ok = [
121-
'__seed*',
122-
'host-exchange-local-copy-',
123-
'Copy_',
124120
'vs/conv2d/Conv2D/convolution.*/Conv_1x1',
125121
'vs/Cast/convert.*/Cast',
126122
'vs/conv2d_1/Conv2D/convolution.*/Conv_1x1',
@@ -162,7 +158,6 @@ def testConvolutionsDontMatchDifferentShapes(self):
162158
report = pva.openReport(report_helper.find_report())
163159
# Matches two convolutions
164160
ok = [
165-
'__seed*', 'host-exchange-local-copy-',
166161
'vs/conv2d/Conv2D/convolution.*/Conv_1x1',
167162
'vs/conv2d_1/Conv2D/convolution.*/Conv_1x1'
168163
]
@@ -204,7 +199,6 @@ def testConvolutionsDontMatchDifferentConvParams(self):
204199
report = pva.openReport(report_helper.find_report())
205200
# Matches two convolutions
206201
ok = [
207-
'__seed*', 'host-exchange-local-copy-', 'Copy_',
208202
'vs/conv2d/Conv2D/convolution.*/Conv_1x1',
209203
'vs/conv2d_1/Conv2D/convolution.*/Conv_1x1'
210204
]
@@ -260,8 +254,6 @@ def testConvolutionsMatchFwdBwdWu(self):
260254
# Both BackpropFilter should be shared
261255
# pylint: disable=line-too-long
262256
ok = [
263-
'__seed*',
264-
'copy*/OnTileCopy',
265257
'vs/conv1/Conv2D/convolution.*/Conv_1x1',
266258
'Sum/reduce.*/ReduceOnTile/InToIntermediateNoExchange/Reduce',
267259
'Sum/reduce.*/ReduceFinalStage/IntermediateToOutput/Reduce',
@@ -323,9 +315,6 @@ def testConvolutionsMatchFwdBwdWuVariableLR(self):
323315
# Both BackpropFilter should be shared
324316
# pylint: disable=line-too-long
325317
ok = [
326-
'__seed*',
327-
'host-exchange-local-copy-',
328-
'Copy_',
329318
'Sum/reduce.*/ReduceOnTile/InToIntermediateNoExchange/Reduce',
330319
'Sum/reduce.*/ReduceFinalStage/IntermediateToOutput/Reduce',
331320
'gradients/vs/conv1/Conv2D_grad/Conv2DBackpropFilter/fusion.*/Conv_4x4',
@@ -493,7 +482,7 @@ def model(device):
493482
self.assert_max_tile_memory(report, 401526, tolerance=0.2)
494483

495484
# Would fail if there were two convolutions in the graph
496-
ok = ['__seed*', 'a/convolution', '[cC]opy']
485+
ok = ['a/convolution']
497486
self.assert_all_compute_sets_and_list(report, ok)
498487

499488

tensorflow/compiler/plugin/poplar/tests/conv_test.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ def testConv8x8_WithBias(self):
156156
fmt)))
157157

158158
report = pva.openReport(report_helper.find_report())
159-
ok = [
160-
'__seed*', 'host-exchange-local-copy-',
161-
'cnv4*/convolution.*/Conv_8x8_stride4x4', 'ba4*/fusion/Op/Add'
162-
]
159+
ok = ['cnv4*/convolution.*/Conv_8x8_stride4x4', 'ba4*/fusion/Op/Add']
163160
self.assert_all_compute_sets_and_list(report, ok)
164161

165162
def testConv1x1_WithBias(self):
@@ -195,10 +192,7 @@ def testConv1x1_WithBias(self):
195192
self.assertAllClose(result, np.zeros(self._ip_shp([1, 1, 1, 16], fmt)))
196193

197194
report = pva.openReport(report_helper.find_report())
198-
ok = [
199-
'__seed*', 'Copy_', 'cnv5*/convolution.*/Conv_1x1',
200-
'ba5*/fusion/Op/Add'
201-
]
195+
ok = ['cnv5*/convolution.*/Conv_1x1', 'ba5*/fusion/Op/Add']
202196
self.assert_all_compute_sets_and_list(report, ok)
203197

204198
def testConvBackpropInput(self):
@@ -230,8 +224,6 @@ def testConvBackpropInput(self):
230224
report = pva.openReport(report_helper.find_report())
231225
# pylint: disable=line-too-long
232226
ok = [
233-
'__seed*',
234-
'Copy_',
235227
'Conv2DBackpropInput/conv-with-reverse/Conv_2x2',
236228
]
237229
# pylint: enable=line-too-long
@@ -265,8 +257,6 @@ def testConvBackpropFilter(self):
265257

266258
report = pva.openReport(report_helper.find_report())
267259
ok = [
268-
'__seed*',
269-
'[cC]opy',
270260
'Conv2DBackpropFilter/convolution.*/Conv_8x8',
271261
]
272262
self.assert_all_compute_sets_and_list(report, ok)
@@ -297,10 +287,7 @@ def testDepthwiseConv3x2(self):
297287
[[43, 36, 33, 25, 19, 10], [61, 51, 45, 34, 25, 13]]]])
298288

299289
report = pva.openReport(report_helper.find_report())
300-
ok = [
301-
'__seed*', 'host-exchange-local-copy-',
302-
'depthwise/convolution.*/Conv_1x1', 'add/fusion*/Add'
303-
]
290+
ok = ['depthwise/convolution.*/Conv_1x1', 'add/fusion*/Add']
304291
self.assert_all_compute_sets_and_list(report, ok)
305292

306293
def testDepthwiseConv3x1(self):
@@ -329,10 +316,7 @@ def testDepthwiseConv3x1(self):
329316

330317
report = pva.openReport(report_helper.find_report())
331318
# pylint: disable=line-too-long
332-
ok = [
333-
'__seed*', 'host-exchange-local-copy-',
334-
'depthwise/convolution.*/Conv_1x1', 'add/fusion*/Add'
335-
]
319+
ok = ['depthwise/convolution.*/Conv_1x1', 'add/fusion*/Add']
336320
# pylint: enable=line-too-long
337321
self.assert_all_compute_sets_and_list(report, ok)
338322

@@ -361,7 +345,6 @@ def testDepthwiseConvBackpropInput(self):
361345
report = pva.openReport(report_helper.find_report())
362346
# pylint: disable=line-too-long
363347
ok = [
364-
'__seed*', 'copy*OnTileCopy-',
365348
'DepthwiseConv2dNativeBackpropInput/conv-with-reverse/Conv_3x3/Convolve',
366349
'DepthwiseConv2dNativeBackpropInput/conv-with-reverse/Conv_3x3/WeightsTranspose'
367350
]
@@ -393,7 +376,6 @@ def testDepthwiseConvBackpropInput1x1(self):
393376
report = pva.openReport(report_helper.find_report())
394377
# pylint: disable=line-too-long
395378
ok = [
396-
'__seed*',
397379
'DepthwiseConv2dNativeBackpropInput/conv-with-reverse/*Transpose',
398380
'DepthwiseConv2dNativeBackpropInput/conv-with-reverse/Conv_1x1',
399381
]

0 commit comments

Comments
 (0)